 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
kb3z0n Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 542
|
Posted: Tue Dec 02, 2008 12:29 am Post subject: [Tutorial]How to make a DLL For Halo CE(In C++) |
|
|
Alright, so what we are going to cover are some basic things,
Creating Threads,
WriteProcessMemory,
GetAsyncKeyState.
Alright lets get started,
go create an empty project in VC++ 2008.
Add a new file to the source folder called
Now, Lets Get on to the real coding, Don't forget to include your header.
First we are going to get the .
The one we are going to use, is ,
That means, when the DLL is injected to the process.
So lets start. Include your header
| Code: | | #include <windows.h> |
Now, lets get the simple API ENTRY Code,
| Code: | BOOL APIENTRY DllMain( HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
} |
Now lets add our CALL reason.
| Code: | if(ul_reason_for_call == DLL_PROCESS_ATTACH)
{
} |
So it would look something like this.
| Code: | BOOL APIENTRY DllMain( HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
if(ul_reason_for_call == DLL_PROCESS_ATTACH)
{
}
} |
Now lets create a simple Thread, Called Halo.
| Code: |
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Halo, 0, 0, NULL);
|
So now it should look like this :
| Code: | BOOL APIENTRY DllMain( HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
if(ul_reason_for_call == DLL_PROCESS_ATTACH)
{
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Halo, 0, 0, NULL);
}
} |
Lets continue, lets add the code at the top..
Note the : &Halo, thats the name of our thread.
But Erase the & so it's : Halo
Let's continue on.
Add this above your code,
| Code: |
bool Halo(void)
{
}
|
Now here you can use a simple MessageBox, using the Command.
But we're going to skip that.. Lets continue,
Lets add a loop for the hotkeys.
| Code: |
for(;;(Sleep(250)))
{
}
|
for(; is our loop, but i added a Sleep to it,because it can be very laggy.
Now it should look somthing like :
| Code: |
bool halo(void)
{
for(;;(Sleep(250)));
{
}
}
|
Now, lets get this tutorial done, Lets use the Now.
add this inbetween the 2 brackets of the loop.
| Code: |
if(GetAsyncKeyState(VK_F1))
{
}
|
That means, if you press F1 then..etc
Now heres a simple hack for Halo CE Trial,
| Code: |
************************
* HUD *
************************
* Address = 0x4BAD03BC *
* On = 0x01 *
* Off = 0x00 *
************************
|
(Credits to HaloTrialHacking.com)
To toggle the HUD off,
So add this inbetween the two brackets of the GetAsyncKeyState
| Code: |
BYTE One9[0xC] = {0x01};
WriteProcessMemory(((HANDLE)-1), (void*)0x4BAD03BC, &One9,1, 0);
|
And inject it! that should be all
Final code :
| Code: |
#include <windows.h>
bool Halo(void)
{
for(;;(Sleep(250)))
{
if(GetAsyncKeyState(VK_F1))
{
BYTE One9[0xC] = {0x01};
WriteProcessMemory(((HANDLE)-1), (void*)0x4BAD03BC, &One9,1, 0);
}
}
return 0;
}
BOOL APIENTRY DllMain( HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
if(ul_reason_for_call == DLL_PROCESS_ATTACH)
{
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Halo, 0, 0, NULL);
}
}
|
Credits : Smartz993 for the HANDLE -1
HaloTrialHacking : For Addresses./WriteProcessMemory
Me : For tutorial.
EDIT : If i'm wrong can someone please correct me?
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Dec 02, 2008 12:42 am Post subject: |
|
|
Your formatting is fucked.
WriteProcessMemory is pointless in a DLL, you already have direct access to the memory if you're injected.
|
|
| Back to top |
|
 |
kb3z0n Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 542
|
Posted: Tue Dec 02, 2008 12:44 am Post subject: |
|
|
| Oh, well thats what i used D:, whats better to use then?
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Dec 02, 2008 12:53 am Post subject: |
|
|
| slovach wrote: | | you already have direct access to the memory if you're injected. |
that's what you should use. Something like this is imo the easiest way.
| Code: | DWORD* blah = (DWORD*)0x00123456;
*blah = 0x01; |
or you could just do this, which is probably what it'd compile into anyway.
| Code: | | mov dword ptr ds:[0x00123456], 0x01 |
Last edited by hcavolsdsadgadsg on Tue Dec 02, 2008 12:56 am; edited 1 time in total |
|
| Back to top |
|
 |
kb3z0n Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 542
|
Posted: Tue Dec 02, 2008 12:54 am Post subject: |
|
|
| Alright, thanks ;D
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|