Help File:sym generateAPIHookScript

From Cheat Engine
Jump to navigation Jump to search

sym_generateAPIHookScript[edit]

This function takes several strings and convert it into a working AutoAssembler script.

Function Definition

BOOL sym_addressToName (char *address,
                          char *addresstojumpto,
                          char *addresstogetnewcalladdress,
                          char *script,
                          int maxscriptsize);
address
The address you want to hook. (e.g. "00401234", "somegamemod.dll+1234" or "apidll!functionname")
addresstojumpto
Address of the routine you want to jump to. (e.g. "mydll!myhook" or just a static address like "0x12345678").
addresstogetnewcalladdress
Address to store the address of the routine in so you can call it without the hook. (Useful when you want to call the original routine from your own hook).
script
Output a pointer to a buffer where you want the script in.
maxscriptsize
Ensures the script won't exceed the buffer.

Returns TRUE if the script was properly generated and there was enough space. The script will be filled with the script you can feed to the Auto Assembler.