How to make a logger

Posts 1–15 of 21 · Page 1 of 2
How to make a logger
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+0x50
- 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
      CreateThread(0,0,(LPTHREAD_START_ROUTINE)Func,0,0,0);
}
don't forget to close the file when the game close:
Code:
if( reason == DLL_PROCESS_DETACH)
{
      file.close;
}
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+0x50);
      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.

Here's mine from CF EU : CrossFire Europe PlayerClient Log 2012 - Pastebin.com

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+0x50);
      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
}
thx for the tut
gonna make it now
i'm happy that you like it even though that i'm not good at explaining things to others.
ppl at school often say it.
Nice tut bro
Thanks, your tutorial helped me a lot.
Veryu nice tut!
Good job
Should be stickied
useful information and Deserving Work
Good Tut
Good Job

i made my logger on another way , getting string to get FSTP Strings then show it in
Quote Originally Posted by darkness99 View Post
Good Job

i made my logger on another way , getting string to get FSTP Strings then show it in
thanks. I know that there's still other ways to do it. But I thought it was better to make it for ppl that don't have advanced knowledge at c++
still have no clue how i should do it
can't someone make me a keylogger?
whats a logger?
you mean a key logger?
@ultrapgnoob
what is a logger???
not really a tut, just a source code ^^
i already posted one very long time ago , but i didnt have so much clicks..
Posts 1–15 of 21 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us