Skip to content

Convert Python's dis disassembly output to xasm format so that you can use the xasm tool to get the assembly results (in .pyc).

License

Notifications You must be signed in to change notification settings

c10udlnk/dis2xasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dis2xasm

Convert Python's dis disassembly output to xasm format so that you can use the xasm tool to get the assembly results (in .pyc).

No more worrying about tearing Python bytecode text in CTF! ^0^/

dependencies

python3 -m pip install xasm xdis

usage

python3 dis2xasm.py chal.txt

or use it in Python:

>>> from dis2xasm import dis2xasm
>>> dx = dis2xasm("bytecode", (3, 8)) # "bytecode" is the bytecode's filename
>>> dx.run()
>>> dx.write("bytecode.pyasm") # custom output filename
[+] bytecode.pyasm has been written!
>>> dx.xasm2pyc() # use xasm to get .pyc
Wrote Python 3.8 bytecode file "xasm_bytecode.pyc"; 46934 bytes.

And then you can use some decompiler like decompile3 or pycdc to get its source code.

About

Convert Python's dis disassembly output to xasm format so that you can use the xasm tool to get the assembly results (in .pyc).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages