Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopping at the middle of the decompilation #134

Closed
lululepu opened this issue Jun 1, 2024 · 2 comments
Closed

Stopping at the middle of the decompilation #134

lululepu opened this issue Jun 1, 2024 · 2 comments

Comments

@lululepu
Copy link

lululepu commented Jun 1, 2024

Hey when i do this:

loaded = xdis.load_module_from_file_object(io.BytesIO(v))
insts: list[dis.Instruction] = xdis.Bytecode(loaded[3], xdis.get_opcode(loaded[0], False)).dis(loaded[3])
print(insts)

i get the dis of "v" but its not complete like stop at the middle of the decompilation:

             860 LOAD_CONST           (None)
             862 RETURN_VALUE
         >>  864 LOAD_CONST           (None)
             866 RETURN_VALUE
         >>  868 LOAD_CONST           (None)
             870 RETURN_VALUE

End here

but when i use pydisasm command or dis module i get it completely can i get help?

@rocky
Copy link
Owner

rocky commented Jun 1, 2024

This is vague. A complete example that anyone can run to replicate is needed.

It feels like you haven't done your homework before asking help. Does this occur for all bytecode, or just some particular bytecode? If particular bytecode what are the characteristics of the bytecode, e.g. which python version and so on.

Aside from being vague the code is a bit complicated too. Can you simplify it by filling in parameter with constant values?

BTW the type annotation list[dis.Instruction] is wrong. An xdis.Instruction is not the same thing as a dis.Instruction.

@lululepu
Copy link
Author

lululepu commented Jun 1, 2024

Hey, sorry for the inconvenience. I found a way to "fix" it. I didn't know that this method didn't disassemble all the code (func/class). Thanks for the response, and sorry for the low-quality issue. I don't do this often, and I wrote the code quickly. Thx :D

@lululepu lululepu closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants