Closed ariffinsetya closed 5 years ago
Looks to me like someone modified the archive format a bit by making the header longer. By reinterpreting your data back to bytes it reads
b' DDGAME\x01\x00\x00\x005\x00\x00\x00\xf3+\x00\x00\x02\x00\x00\x00(,\x00\x00\xfcF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00x\xda\xb5}\x07'
Which suggests to me that the author replaced the header "RENPY RPC2" with "RENPY RPC2 DDGAME". By correcting for this the slot table decodes correctly.
in read_ast_from_file, replace position = 10 by position = 17 and it should decode properly.
thank you @CensoredUsername I'll try to do what you suggested
@CensoredUsername it's worked.
I met a problem when i tried to decompile some .rpyc file it fails on function read_ast_from_file.
Traceback (most recent call last): File "c:\Users\Ari\Downloads\Compressed\unrpyc-master\unrpyc.py", line 153, in worker no_pyexpr=args.no_pyexpr, comparable=args.comparable, translator=translator, init_offset=args.init_offset) File "c:\Users\Ari\Downloads\Compressed\unrpyc-master\unrpyc.py", line 112, in decompile_rpyc ast = read_ast_from_file(in_file) File "c:\Users\Ari\Downloads\Compressed\unrpyc-master\unrpyc.py", line 82, in read_ast_from_file raw_contents = chunks[1] KeyError: 1
It works fine with other .rpyc files that i had.I tried to check by print some line on the function, because I'm not that familliar with python that's the limit of what i can do, but when i tried to decompile rpyc that works
do you have any idea why this happened?
what i did with the function `` 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
``