[Snippet]
Dll Template
#include <Windows.h>
DWORD WINAPI dwThread( LPVOID )
{
return 0;
}
BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lvpReserved )
{
switch( dwReason )
{
case DLL_PROCESS_ATTACH:
CreateThread( 0, 0, dwThread, 0, 0, 0 );
break;
case DLL_PROCESS_DETACH:
break;
}
}
Console Attach Dll
#include <Windows.h>
#include <stdio.h>
DWORD WINAPI dwConsole( LPVOID )
{
//Windows Console
AllocConsole();
AttachConsole( GetCurrentProcessId() );
freopen( "CON", "w", stdout );
//Print Text on console
printf( "CONSOLE ATTACHED!\n" );
return 0;
}
BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lvpReserved )
{
switch( dwReason )
{
case DLL_PROCESS_ATTACH:
CreateThread( 0, 0, dwConsole, 0, 0, 0 );
break;
case DLL_PROCESS_DETACH:
break;
}
}
Using Classes
class CClass;
class CClass
{
public:
char cName[16]; //0x0000
DWORD dwHealth; //0x0010
DWORD dwAmmo; //0x0014
};
CClass* cClass = (CClass*)0xFFFFFFF;
[Class Name* randomname = (Class Name*)Address]
void hack()
{
cClass->dwHealth = 999;
}
Print Text from Class
class CClass;
class CClass
{
public:
char cName[16]; //0x0000
DWORD dwHealth; //0x0010
DWORD dwAmmo; //0x0014
};
CClass* cClass = (CClass*)0xFFFFFFF;
char Name[256];
sprintf( Name, "Name:%S [H:%X]", cClass->cName, cClass->dwHealth );
PrintText( Name );
Comes out as:
Name:Code[V] [H: 100]
by Code[V]