-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbd.py
More file actions
37 lines (32 loc) · 1.23 KB
/
bd.py
File metadata and controls
37 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from decoder import Decoder
from enums import *
import sys
def main():
if len(sys.argv) < 3:
print("bone_density")
print("usage:")
print(" python bd.py encrypted_file.pyc _pytransform.dll")
print(" python bd.py encrypted_file.pyc pytransform.pyd")
print(" use the pytransform.pyd file if you have it,")
print(" otherwise, use the _pytransform.dll version.")
print("")
print("note: only windows dlls/pyds are supported right now.")
exit(1)
pyc_path = sys.argv[1]
asm_path = sys.argv[2]
decode_mode = DecodeMode.Unknown
if asm_path.lower().endswith("_pytransform.dll"):
decode_mode = DecodeMode.BasicMode
elif asm_path.lower().endswith("pytransform.pyd"):
decode_mode = DecodeMode.SuperMode
else:
print("I can't figure out what mode to decode in")
print("since the assembly file name isn't either")
print("_pytransform.dll or pytransform.pyd.")
print("Please rename it back to the original name.")
print("If it came like this, it's probably not supported.")
exit(1)
decoder = Decoder(pyc_path, asm_path, decode_mode)
decoder.decode()
if __name__ == "__main__":
main()