Making the base
First of all, make a DLL main. You need to creat a new thread from here. This is becouse you want to run the dll next to the game. This way you can make a "Realtime" hack!
Do you want to know more about DLL main.. Just searth my other tuts.
Code:
//DLLmain Input:
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved ) {
DisableThreadLibraryCalls(hDll);
char msg[10] = {unic[5],unic[0],unic[6],unic[5],unic[4],unic[1],unic[3],unic[1],unic[2]};
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)runner, NULL, NULL, NULL);
}
return true;
}
This is just a simple DLL Main. You can add a msg box and more.
This wil creat the thread "runner".
Cheak if Cshell is loaded
First I wait a while till you know cshell.dll is loaded:
But it is posable that some one has as slow pc.. So I made a try catch structure to catch this:
Code:
BOOL WINAPI runner(LPVOID) {
Sleep(9800);
try {
DWORD dllfile = (DWORD)GetModuleHandleA("Cshell.dll");
if(dllfile == false) {
throw 1;
}
}
catch (int error) {
switch(error) {
case 1:
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)runner, NULL, NULL, NULL);
return false;
default:
//Unkown error!
return false;
}
}
Beep(1000,1000);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)doyourstuffhere, NULL, NULL, NULL);
return true;
}
This will try to load Cshell.dll. It will continue till it is loaded. Why try catch? its a nice methode to solve bugs.
This tries to load cshell.dll. If this doesn’t work then It will send an error to the catch. This will handle the error.
If Cshell is loaded. It will lauche a new thread “doyourstuffhere”. The existing thread will finish. So you have a “clean start”.
Hack thread
Just define the thread:
Code:
DWORD WINAPI doyourstuffhere(LPVOID param) {
}
And do your stuff.
How to change memory
Load cshell:
Code:
DWORD cshell = (DWORD)LoadLibraryA( "CShell.dll" );
Make a pointer to a class
Code:
DWORD Wapenclass = *(PDWORD)(cshell + 0xA65EE8);
Do your hacks. There is a possibility that you need to do other stuff. Like find the weapon location and more. I made for 4 classes a offset how to make it.
Basic player:
Code:
if(Playerbasic) {
*(float*)(Playerbasic + 0x88) = (float)0;
*(float*)(Playerbasic + 0x8C) = (float)0;
*(float*)(Playerbasic + 0x90) = (float)0;
*(float*)(Playerbasic + 0x94) = (float)0;
}
Other player
Code:
if(Playercl) {
*(float*)(Playercl + 0x04) = (float)0;
}
Weapon array:
Code:
if(Wapenclass) {
for(int i=0 ; i<533 ; i++) {
DWORD curwapen = *(DWORD*)(Wapenclass +(4*i));
if (curwapen) {
*(float*)( curwapen + 0x2698) = (float)1;
*(float*)( curwapen + 0x269c) = (float)1;
}
}
}
}
Wall class:
Code:
if(Wallclass) {
for(int i = 0;i<64;i++) {
*(float*)(Wallclass+(i*0x04F4)+0x04E8) = (float)1; //String is "EdgeShotEnabled"
*(float*)(Wallclass+(i*0x04F4)+0x04EC) = (float)1; //String is "WallShotEnabled"
*(float*)(Wallclass+(i*0x04F4)+0x04F0) = (float)1; //String is "PerfectWallShotEnabled"
}
}
}
You can make the pointer to the classes this way:
Code:
DWORD Wapenclass = *(PDWORD)(cshell + 0xA65EE8);
DWORD Wallclass = *(PDWORD)(cshell + 0xA65ED4);
DWORD Playerbasic = *(PDWORD)(cshell + 0x9FF160);
DWORD Playercl = *(PDWORD)(cshell + 0xA65ECC);
How does that pointing part work?
You just make a pointer to the location you want to change. Then you make it what ever you want.
That is all.
GL all!