首先是结果回溯和结果图片:
根据回溯,下方是unrpyc.py内回溯调用的相关代码(最后一个是Python2.7内的):
#File "C:\D\unrpyc-master\unrpyc.py", line 190, in worker
#tag_outside_block=args.tag_outside_block, init_offset=args.init_offset, try_harder=args.try_harder)
#下方是代码
def worker(t):
(args, filename, filesize) = t
try:
if args.write_translation_file:
return extract_translations(filename, args.language)
else:
if args.translation_file is not None:
translator = translate.Translator(None)
translator.language, translator.dialogue, translator.strings = magic.loads(args.translations, class_factory)
else:
translator = None
return decompile_rpyc(filename, args.clobber, args.dump, decompile_python=args.decompile_python,
no_pyexpr=args.no_pyexpr, comparable=args.comparable, translator=translator,
tag_outside_block=args.tag_outside_block, init_offset=args.init_offset, try_harder=args.try_harder)
except Exception as e:
with printlock:
print("Error while decompiling %s:" % filename)
print(traceback.format_exc())
return False
#File "C:\D\unrpyc-master\unrpyc.py", line 153, in decompile_rpyc
#ast = read_ast_from_file(in_file)
#下方是代码
with open(input_filename, 'rb') as in_file:
if try_harder:
ast = deobfuscate.read_ast(in_file)
else:
ast = read_ast_from_file(in_file)
#File "C:\D\unrpyc-master\unrpyc.py", line 125, in read_ast_from_file
#raw_contents = raw_contents.decode('zlib')
#下方是代码
def read_ast_from_file(in_file):
# .rpyc files are just zlib compressed pickles of a tuple of some data and the actual AST of the file
raw_contents = in_file.read()
if raw_contents.startswith("RENPY RPC2"):
# parse the archive structure
position = 10
chunks = {}
while True:
slot, start, length = struct.unpack("III", raw_contents[position: position + 12])
if slot == 0:
break
position += 12
chunks[slot] = raw_contents[start: start + length]
raw_contents = chunks[1]
raw_contents = raw_contents.decode('zlib')
data, stmts = magic.safe_loads(raw_contents, class_factory, {"_ast", "collections"})
return stmts
#File "C:\Python27\lib\encodings\zlib_codec.py", line 43, in zlib_decode
#output = zlib.decompress(input)
#下方是代码
def zlib_decode(input,errors='strict'):
""" Decodes the object input and returns a tuple (output
object, length consumed).
input must be an object which provides the bf_getreadbuf
buffer slot. Python strings, buffer objects and memory
mapped files are examples of objects providing this slot.
errors defines the error handling to apply. It defaults to
'strict' handling which is the only currently supported
error handling for this codec.
"""
assert errors == 'strict'
output = zlib.decompress(input)
return (output, len(input))