Skip to content

Python Hooking

Memphis Marshall edited this page Sep 13, 2024 · 2 revisions

LunaJuice is capable of hooking Python functions within executables. All Python versions from 2.7 to 3.13 are currently supported, but the Python interpreter must be running for hooking to occur.

Basic docs while I write:

When defining a hook function, you can use original(...) to call the original function. The function will be executed in its own namespace, with the builtins and globals of __main__ stored in variables builtins and globals respectively. While builtins of the original call scope are available in Python 3.10 and above, this could introduce undefined behaviour and will not work on earlier Python versions.

Not Supported:

  • C functions (can be hooked in C mode)
  • Instance methods (but whole class can be hooked instead)

Clone this wiki locally