pycdc
pycdc copied to clipboard
Python bindings & package
Hi,
Thanks for this tool, I've been finding myself needing to recover functions from Python __code__
objects. To facilitate / speed up this step, I propose this PR, which adds Python bindings to allow using pycdc
on marshaled objects from Python directly.
The key changes are the following:
- Addition of Python bindings using
pybind11
. - A new Python package
pycdc
, enabling users topip install .
. - Additional dedicated CMake file, to keep changes to the codebase minimal.
- Conversion of C style IO to C++ streams, to enable output redirection to Python.
- Necessary Python build files like
setup.py
,pyproject.toml
I've tried to keep changes to the codebase and requirements to a minimum. Please let me know if there are any improvements needed.
I've not added Github actions at this point but having the package on PyPi would be great. I can add them if the above changes work for you.
Additionally, this would solve https://github.com/zrax/pycdc/issues/192
This sounds like a neat feature... In order to make it easier to review, I merged the first part (using C++ iostreams) separately, since that has other benefits as well and doesn't appear to impact performance much. Can you rebase this on the latest master when you get a chance?
Thank you for you efforts ! I've rebased and added an option for decompyling non-marshaled outputs (decompyle(..., version=None)
, similar to no -c -v ...
)