[Tutorial] How to make a Addy Logger

On miércoles, 27 de abril de 2011 0 comentarios

Today I'm showing you guys how to create your own addie logger!
CREDITZ: Dean-Wingess and NeoI.I.I - I only fixed some function errors
First of all create a normal project in C++.
Make it Win32 Dll without precompiled headers.

First of all we create the Functions!

We need to create a Header called: Log.h

Create it and paste:


Code:
char *GetDirectoryFile(char *filename);
void __cdecl Writelog (const char * fmt, ...);
void logging(HMODULE hDll);
#pragma message("master.h : Building Addylogger. Credits:Dean-Wingess, Neo I.I.I")
Save it

Then we need the Find pattern function!
create a header called: Pattern.h
And Paste:

Code:
DWORD dwSize;
DWORD dwStartAddress;

BOOL bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for(;*szMask;++szMask,++pData,++bMask)
{
if(*szMask == 'x' && *pData != *bMask)
return 0;
}
return (*szMask)==NULL;
}


DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
for(DWORD i=0; i < dwLen; i++)
if( bCompare( (BYTE*)( dwAddress+i ),bMask,szMask) )
return (DWORD)(dwAddress+i);
return 0;
}
After that we finished on creating the functions.

Create the Cpp Files:
Log.cpp

Paste:

Code:
#include 
#include 
#include 
#include 
#include 


using namespace std;

ofstream ofile;
char dlldirectory[320];

char *GetDirectoryFile(char *filename)
{
static char path[320];
strcpy(path, dlldirectory);
strcat(path, filename);
return path;
}

void __cdecl Writelog(const char *fmt, ...)
{
if(ofile != NULL)
{
if(!fmt) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, fmt);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
va_end (va_alist);
ofile << logbuf << endl;
}}

void logging(HMODULE hDll){
DisableThreadLibraryCalls(hDll);
GetModuleFileName(hDll, dlldirectory, 512);
for(int i = strlen(dlldirectory); i > 0; i--) { if(dlldirectory[i] == '\\') { dlldirectory[i+1] = 0; break; } }
ofile.open(GetDirectoryFile("Adresses.txt"), ios::app); // here put the output filename
}
Main.cpp
paste:

Code:
#include 
#include 
#include "Log.h"
#include "Pattern.h"

bool IsGameReadyForHook()
{
if( GetModuleHandleA( "ClientFX.fxd" ) != NULL 
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;

return false;
}

void SearchPatterns(void)
{
while (!IsGameReadyForHook()){
Sleep(50);
}
while(true){
dwSize = 0x500000; 

//Example DWORD dwPlayerPointer = FindPattern((PBYTE)"\x00\x00\x00\x00\x00\x00\x00};", "x????xxxx", 1, true);

DWORD nametags1 = FindPattern((DWORD)GetModuleHandleA("CShell.dll"), 0x9c0000, (PBYTE)"\x75\x21\x80\x7B\x00\x00", "xxxx??");
DWORD nametags2 = FindPattern((DWORD)GetModuleHandleA("CShell.dll"), 0x9c0000, (PBYTE)"\x75\x05\xBD\x00\x00\x00\x00\x8B\x17", "xxx????xx");
//-------------------------------------------------------------//
Writelog("//==============Dean-Wingess N3x0n Logger==============\\");
Writelog("//==============Created and developed by:==============\\");
Writelog("//======================Dean-Wingess===================\\");
Writelog("//====================== Neo I.I.I ===================\\");
Writelog("//====================== FlaVour ===================\\");
Writelog("");
Writelog("#define NoReload 0x%X",NoReload);
Writelog("#define FallDamage 0x%X",FallDamage);


Writelog("");
Writelog("//*************************Next log*********************************");



ExitProcess(0);
}
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if (dwReason==DLL_PROCESS_ATTACH)
{
logging(hDll);
ShellExecuteA(0,"open","http://mpgh.net",0,0,SW_MINIMIZE);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)SearchPatterns, NULL, NULL, NULL);
}
return TRUE;
}
WARNING:THE PATTERN ARE OLD - IAM TO LAZY TO GET THE NEWEST

Please dont ask questions like "what i have to do with it."
its for people,who understand c++!

0 comentarios:

Publicar un comentario