Step 6
Code injection, to alter opcodes where the original is not the same length as the new one.
I've got this working but it's not quite ready yet, still writing it up.
When you edit opcodes and they don't have the same length, the game often crashes or you get undesired results...for this there's something called code injection. You'll need a new API call for this, so I've written one up, TrainerFunctions.cs.
You can make an instance of the Class by this line:
TrainerFunctions.AllFunctions pKernel = new TrainerFunctions.AllFunctions();
Here's how you use the functions in it:
VIrtualAllocEx:
pKernel.VirtualAllocEx(4096);
//allocates 4096 bytes of memory in the opened process.
//pKernel.lpAddress is where the memory will be allocated
pKernel.VirtualFreeEx();
//frees the last allocated chunk of memory THE LAST ONLY!
Then edit the opcodes, replace the original one with jmp pKernel.lpAddress and nop the incomplete opcodes. Where you no longer need the allocated memory, add the make an opcode: that jumps to the last complete opcode where you jmped to pKernel.lpAddress.
It's that simple! And you've now figured out all functions to make trainers in C#, and if you want to do this in VB, you can use the converter..it does a pretty good job.
You've now completed Step 6! And the entire guide! If you have an suggestions, email me!