The game's scripting engine operates as a stack-based VM. When a script requires an action, it pushes arguments onto the stack and calls a native function using a specific identifier (a hash). The VM resolves this hash to a memory address and executes the corresponding machine code.
Script Hook V operates through a process of memory manipulation and code injection. Its primary objective is to locate the native function lookup table and create a persistent thread for custom code.