rocky / python-xdis

Python cross-version bytecode library and disassembler
GNU General Public License v2.0
292 stars 95 forks source link

Cover more code flags in disassembly output #138

Closed greenozon closed 2 months ago

greenozon commented 2 months ago

Description

For the moment I'm observing the case when pydisasm output leaves some flags as hex values, but it'd be nice to decode it into user friendly strings

Priority

Low

Tests

version used:

pydisasm --version pydisasm, version 6.1.2.dev0

example of the sample .pyc:

# Flags:             0x0100001f (0x1000000 | NESTED | VARKEYWORDS | VARARGS | NEWLOCALS | OPTIMIZED)

expected output: 0x1000000 decoded into FUTURE_ANNOTATIONS as the module is using

from future import annotations

Thanks!

Attached sample .pyc: rewriter.cpython-311.zip