Only x86 is officially supported as that is what I have.
So for hardware breakpoints and software crashes, there is really no way I can help.
In fact I am amazed hardware breakpoints work at all on that version.
But I also want to make it read from that addy and change it.
The idea: I write the Z coord to a static addy. Then I read it from a trainer, user change the coord = writes to the addy, game then reads from the same addy and updates coord.
You won’t be able to create such a complicated system this way; they would both be overwriting each other, probably causing a lot of jitter.
You don’t need to store the coordinate to a static address at all.
If your trainer is going to modify it every time that code is executed, send it to the trainer directly and put the modified value onto the stack.
The easiest way is to modify the value before it is even pushed onto the stack.
At address 0x0066BD66, you should get the value at EAX+24, modify it in the trainer, and write the new value back to EAX+24.
You don’t have to modify the FPU stack at all.
Just a note, MHS can do all of this too.
Typically you would want to use a script breakpoint handler for this so you can test your theories before trying to make a stand-alone .EXE trainer, which, needless to say, would require its own attaching mechanism, debugger, and code project.
In the scripts you would have to write a handler function, which works exactly the same way as hotkey handlers. Here is an example:
- Code: Select all
VOID On_BP_1( LPVOID lpvAddress, LPPROC_INFO_MHS lpProcInfo ) {
extern FLOAT e_fThis = { "", lpProcInfo->pcContext->Eax + 0x24 };
// Modify the float value however we please.
e_fThis = 90.0f;
}
Then set an execute (software) breakpoint on address 0x0066BD66 and set the Callback as this:
Script Function Parm:
1
The parameter 1 indicates that when the breakpoint is hit, it will call your script function On_BP_
1().
So if you set
Parm to 2 you would have to write On_BP_2() in the script, etc.
What will happen:
The execute breakpoint at 0x0066BD66 will be hit.
The breakpoint will call the Prolog function, but it is not set so nothing will happen.
Then the breakpoint will call the Callback function. This is set to
Script Function so it will take the Parm value (
1) and call the script function determined by the Parm (
On_BP_1).
Inside your On_BP_1() function you create an “
extern” variable as a FLOAT type at address
EAX+24 inside the target process. After the extern variable is declared, modifying it will change the data in the target process, so when we set it to 90.0f we are actually writing 90.0f into the target process (at address
EAX+24).
The target process will resume after the script function returns.
At this point, it will execute the real code at address 0x0066BD66, which reads the value from EAX+24 and stores it into the FPU stack. This value was modified by us already, so our modified value is now being used by the game as if it was the original value.
L. Spiro