the ability to call functions inside the process within scripts
These are called
extern functions.
Syntax:
- Code: Select all
extern INT __stdcall FuncName( INT iParm0, FLOAT fParm1 /*Etc.*/ ) = { "gamex86.dll", 0x0002EFC8 };
Usage:
- Code: Select all
INT iGetPlayers = FuncName( 0, fX ); // Call the remote function an store the return.
if ( FuncName( 90, 0.0f ) ) {} // Call the remote function and branch based off the return.
extern INT iMaxPlayers = { "gamex86.dll", 0x89EC };
iMaxPlayers += FuncName( iMaxPlayers, 90.0f ); // Pass an extern variable into the parameter list and add the return to an extern variable.
It has been planned for over a year but it is not simple to implement.
However, thanks to the additions of a few recent features it can finally be implemented.
GetProcAddress and GetModuleHandle for current process possible?
The planned feature (available in MHS 4.0.0.7) is
MHS_ADDRESS GetRemoteFunctionAddress( library, function ).
To create a breakpoint structure properly:
- Code: Select all
SCRIPT_ADD_BP bpBreak = { 0 }; // = { 0 } is required; it sets the entire structure to 0.
bpBreak.dwRange; // Required for software read/write breakpoints.
bpBreak.aAddress = 0x01005334; // The address is required.
// Everything else is optional; since the structure is set to 0’s it will have no name, no condition, no callback functions, and will not be active.
// You can then update only the structure members that are important for this breakpoint.
bpBreak.pcName = "Hello";
L. Spiro