Wednesday, June 18, 2014

[Level 2] Python reverse engineering.

If you want to reverse engineering of python source code, you could use pylint to get class diagram. ref:
$ apt-cache search pyreverse
pylint - python code static checker and UML diagram generator
$ sudo apt-get -y install pylint

$ pyreverse ./*.py
$ dotty ./
$ doggy ./
$ pyreverse -o png ./*.py
$ eog ./classes_No_Name.png
$ eog ./packages_No_Name.png

related projects:
Wish this helps.

Stanley Huang

[Level 1] How to trace the source code more efficient.

If you want to trace python call stack, you could get call sequence by using call_seq module. You could download call_seq from pypi website. After you download it, you could prepare the python script like following.
python from call_seq import CallSeq
trail = CallSeq()
# the code you want to trace.
After you create the output json file, then you could use browser module of call_seq to get visualization of call sequence.
$ python -m call_seq.browser ./output.json

Wish this helps.

Stanley Huang