X893

How to recovery source python code from pyo file

This article describe method to recovery source code from compiled python code file.
Download pyo code file from device to your computer. If you use linux - skip up to decompyle description. I use windows as host and use next steps to prepare decompile.

First download vmware workstation and install it.

2. Create virtual machine and install debian system (i use debian-40r4a-etchnhalf-i386-netinst.iso only with standard system option)

3. Install decompile package

	apt-get install decompyle

 

4. Open file /usr/lib/python2.4/site-packages/decompyle/Scanner.py with editor

	nano /usr/lib/python2.4/site-packages/decompyle/Scanner.py

 

5. Change line 58

	self.__pyversion = float('%d.%d' % version_info[0:2])

 

to

	self.__pyversion = 1.5 ## float('%d.%d' % version_info[0:2])

 

6. Decompyle pyo file

	decompyle -o . example.pyo

 

7. View source file

	nano example.pyo_dis

0 comment(s) so far

Post your comment

Thanks for your comments

  • Comment

Github
Bitbucket
SF.net

Skype
Telegram

Subscribe to x893 blog Subscribe