Well I'm not good at making tutorials but I'm making it for you ppl.
What you need is :
- a simple undetected memory base
- c++ basics
- memory hacking knowledge
- filestream knowledge
(- a cup of coffee )
First we need to know what to log.
Here's some examples :
- PlayerClient : ClientShell+0x64
- WeaponClass : WeaponMgr+weaponID*4
- Player Class : ClientShell+playerID*PlayerClass_Size
....
I will choose PlayerClient as I want to find WalkThruWall.
WalkThruWall is using 3 offsets but we will use only 2 of these because one of them is FallThruFloor which is useless for me as I'm not searching for it.
The default values of WalkThruWall when alive are 56 56.
For FallThruFloor it's 140.
Both of the 3 offsets are float values.
Now we will make our logger.
We add this declaration before all the func so you can access it thru any functions :
Code:
ofstream file;
using std::ofstream;
using std::ios;
using std::hex;
using std::dec;
using std::endl
then at the DLL Injection we add this:
Code:
if( reason == DLL_PROCESS_ATTACH)
{
file.open("myLog.txt", ios::trunc); // this line
}
don't forget to close the file when the game close:
Code:
if( reason == DLL_PROCESS_DETACH)
{
file.close(); // this line
}
And then in your function you will log each 4 bytes as float as the data type of walkthruwall is float.
You must check if you're ingame. PlayerClient is null while not ingame.
Add an hotkey if you want.
Code:
int Func(void)
{
// some codes
DWORD ClientShell = *(DWORD*)(CShell+0x??????);
DWORD PlayerClient = *(DWORD*)(ClientShell+0x64);
if(PlayerClient)(
{
for(int i=0;i<512;i+=4)
file << "0x" << hex << i << " = " << dec << *(float*)(PlayerClient+i) << endl;
ExitProcess(0); // Use this only if you don't make it a hotkey feature
}
// some codes
}
You got everything now.
If everything goes well when you get ingame the game close and you get a file named myLog with everything you need.
Bonus
In this bonus I would like to add that you can value check to get your offsets easily.
Edit your code like this:
Code:
int Func(void)
{
// some codes
DWORD ClientShell = *(DWORD*)(CShell+0x??????);
DWORD PlayerClient = *(DWORD*)(ClientShell+0x64);
if(PlayerClient)(
{
for(int i=0;i<512;i++) // we will check each bytes this time
if(*(float*)(PlayerClient+i) == 56.0f) // 56.0f or any value you wanna check.
file << "0x" << hex << i << " = " << dec << *(float*)(PlayerClient+i) << endl;
ExitProcess(0); // Use this only if you don't make it a hotkey feature
}
// some codes
}