PyCPython
PyCParser
PyCPython | PyCParser | |
---|---|---|
1 | 1 | |
16 | 342 | |
- | - | |
10.0 | 10.0 | |
over 4 years ago | over 4 years ago | |
Python | Python | |
- | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PyCPython
-
30 Years of Decompilation and the Unsolved Structuring Problem: Part 1
A funny anecdote: Some time ago, I was writing a C-to-Python translator.
(Why? Just for fun, https://github.com/albertz/PyCParser, even more just-for-fun goal was this: https://github.com/albertz/PyCPython).
It literally would translate the C code in equivalent Python code, using ctypes heavily. It was mostly straight-forward, except for mapping goto (thus related to this control flow structuring problem).
Of course, there are some hacks to introduce goto in Python, which in many cases would operate on the Python bytecode, which actually has the JUMP_ABSOLUTE op, but there are also other ways (https://stackoverflow.com/questions/6959360/goto-in-python).
I could also have translated C directly to equivalent Python bytecode and not Python source code, but I really wanted to have Python source code.
My ugly solution worked basically like this: Whenever there was some goto in a function, it would translate it as follows:
First, we flatten any Python AST into a series of statements,
PyCParser
-
30 Years of Decompilation and the Unsolved Structuring Problem: Part 1
A funny anecdote: Some time ago, I was writing a C-to-Python translator.
(Why? Just for fun, https://github.com/albertz/PyCParser, even more just-for-fun goal was this: https://github.com/albertz/PyCPython).
It literally would translate the C code in equivalent Python code, using ctypes heavily. It was mostly straight-forward, except for mapping goto (thus related to this control flow structuring problem).
Of course, there are some hacks to introduce goto in Python, which in many cases would operate on the Python bytecode, which actually has the JUMP_ABSOLUTE op, but there are also other ways (https://stackoverflow.com/questions/6959360/goto-in-python).
I could also have translated C directly to equivalent Python bytecode and not Python source code, but I really wanted to have Python source code.
My ugly solution worked basically like this: Whenever there was some goto in a function, it would translate it as follows:
First, we flatten any Python AST into a series of statements,
What are some alternatives?
angr - A powerful and user-friendly binary analysis platform!