Skip to content

Instantly share code, notes, and snippets.

@tanaka-geek
Created May 5, 2021 09:08
Show Gist options
  • Save tanaka-geek/6a67a576e0bec2d0f531635086fb743e to your computer and use it in GitHub Desktop.
Save tanaka-geek/6a67a576e0bec2d0f531635086fb743e to your computer and use it in GitHub Desktop.
reversing python

Python has an even looser definition of compiling, but still has a compiled layer in the form of Python byte code stored as ".pyc" files.

These pyc files tend to be much more easily reversible than Java and C# so unless the source has been obfuscated you can almost always retrieve the exact source code made to create the final executable.

file byte-compiled-program
byte-compiled-program: python 2.7 byte-compiled

$ python -i byte-compiled-program
>>> dir()
['__builtins__', '__doc__', '__name__', '__package__', 'secret']
>>> print secret
secret value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment