Tutorial by Examples

EXTENDED_ARG = 145 # All opcodes greater than this have 2 operands HAVE_ARGUMENT = 90 # All opcodes greater than this have at least 1 operands cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is', 'is ... # A list of comparator id's. The indecies are used as opera...
Python is a hybrid interpreter. When running a program, it first assembles it into bytecode which can then be run in the Python interpreter (also called a Python virtual machine). The dis module in the standard library can be used to make the Python bytecode human-readable by disassembling classes, ...
To disassemble a Python module, first this has to be turned into a .pyc file (Python compiled). To do this, run python -m compileall <file>.py Then in an interpreter, run import dis import marshal with open("<file>.pyc", "rb") as code_f: code_f.read(8) # M...

Page 1 of 1