making my first Wh

Posts 1–15 of 15 · Page 1 of 1
making my first Wh
Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"



BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 
					 )
{
	switch (ul_reason_for_call)
	{
	
		
		




	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}


void ChopperBoxes()
{
	
	DWORD dwCall = 0x49B010;
	__asm{
		push 0x0
		call [dwCall]
		add esp, 0x4
	}
}
my problem is that how do i call "chopperBoxes" function if I just type "ChopperBoxes();" then it tells "chopperBoxes identifier not found"
Simple:

A- Learn Programming.
B- Hook some MW2 rendering function.
C- Call the Chopper Boxes from the hooked function.
Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "Hooking.h"


BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					   )
					 

					 
{

	switch (ul_reason_for_call)
	{
	
		
		
		CallHook(ChopperBoxes);

		




	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}


void ChopperBoxes()
{
	
	DWORD dwCall = 0x49B010;
	__asm{
		push 0x0
		call [dwCall]
		add esp, 0x4
	}
}
}
am I corect now?

Hooking.h

Code:
#define CALL_NEAR32 0xE8U
#define JMP_NEAR32 0xE9U
#define NOP 0x90U

struct CallHook {
	BYTE bOriginalCode[5];
	PBYTE pPlace;
	PVOID pOriginal;

	void initialize(PBYTE place);
	int installHook(void (*hookToInstall)(), bool unprotect);
	int releaseHook(bool unprotect);
};

struct PointerHook {
	PVOID* pPlace;
	PVOID pOriginal;

	void initialize(PVOID* place);
	int installHook(void (*hookToInstall)(), bool unprotect);
	int releaseHook(bool unprotect);
};

struct StompHook {
	BYTE bOriginalCode[15];
	BYTE bCountBytes;
	PBYTE pPlace;

	void initialize(BYTE countBytes, PBYTE place);
	int installHook(void (*hookToInstall)(), bool useJump, bool unprotect);
	int releaseHook(bool unprotect);
};
You absolutly dont understand what you are doing...

like Insane said, start by point A -> learning programming.


cheers
Quote Originally Posted by inmate View Post
You absolutly dont understand what you are doing...

like Insane said, start by point A -> learning programming.


cheers
If you don't know how to program, then don't feel like you've got to say something.
You're just making yourself look like a retard to any decent thinker out there.

What is he right now? He's learning.
Instead of turning him away you can help him in the right direction.
No wonder MPGH's community is shit.
Everyone who actually didn't whine and tried stuff themselves got turned away.
Look what's left. People like you.. and @MarkHC.

@OP Shoot me a PM if you're still busy.
Quote Originally Posted by Unscrewed View Post
What is he right now? He's learning.
No. He's just leeching code without even stop and try to see what the code does. No one learn that way. And what you want us to do? Give him a full working code so he can put he can compile and release as his own? That's not going to happen. I'd be happy to help when he shows that he has already done some of the "work" on his own. But when someone just come here with a empty main function asking for help... well... dunno about you, but I got other things to do...
ohey its mw2player, why don't you just make another d3d overlay and go to your arev friends and say: "omg i haxed fordeltaons"
Quote Originally Posted by mike3x3 View Post
ohey its mw2player, why don't you just make another d3d overlay and go to your arev friends and say: "omg i haxed fordeltaons"
look at -InSane-'s signature I hope you understood ;D
kinda agree i mean if you just give a dll source code dafuq you tryna get i mean thats default code when you make a dll in c++ do you even know what any of it means yet theres more to just hooking you gota learn some directx stuff aswell aswell as if you want your hacks UD then learn external hacks which uses GDI reads process memory and not write so you just get the players coords base health etc and then draw your own tags and boxes sounds easy coz it easy once you learn c++ i swear man its easy just look on youtube for Buckys c++ tuts or anything i mean just dedicate time making like simple little apps first then going to console trainers etc you cant just expect a fuken BoxEsp or lineEsp from the sound of it thats what you want from just a dll source i mean seriously
Code:
//////////////////////DLLMAIN.CPP////////////////////////

#include <windows.h>
#include "Hooks.h"

BOOL APIENTRY DllMain(HMODULE hDllModule, DWORD dwReason, LPVOID lpVoid)
{
   if(dwReason==DLL_PROCESS_ATTACH)
         CallDetour();
   return TRUE;
}

////////////////////////HOOKS.H/////////////////////////

void *DetourFunction (BYTE *src, const BYTE *dst, const int len)
{
	BYTE *jmp = (BYTE*)malloc(len+5);
	DWORD dwBack;

	VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwBack);
	memcpy(jmp, src, len);
	jmp += len;
	jmp[0] = 0xE9;
	*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
	src[0] = 0xE9;
	*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
	for (int i=5; i<len; i++)
		src[i]=0x90;
	VirtualProtect(src, len, dwBack, &dwBack);
	return (jmp-len);
}

void MakeJMP( BYTE *pAddress, DWORD dwJumpTo, DWORD dwLen )
{
	DWORD dwOldProtect, dwBkup, dwRelAddr;

	VirtualProtect(pAddress, dwLen, PAGE_EXECUTE_READWRITE, &dwOldProtect);
	dwRelAddr = (DWORD) (dwJumpTo - (DWORD) pAddress) - 5;
	*pAddress = 0xE9;

	*((DWORD *)(pAddress + 0x1)) = dwRelAddr;
	for(DWORD x = 0x5; x < dwLen; x++) *(pAddress + x) = 0x90;
	VirtualProtect(pAddress, dwLen, dwOldProtect, &dwBkup);

	return;
}

void CallChopper()
{
   //Draw2D Boxes here
}

__declspec(naked) Draw2DHook()
{
  __asm
  {
    PUSHAD;
    PUSHFD;
  }
  // CallChopper();
  __asm
  {
    POPAD;
    POPFD;
    //Do overwritten shit here
  }
}

void CallDetour()
{
    //Hook aCI
    //Hook Draw2D with Draw2D Hook
}
Enjoy you lil leecher.

---------- Post added at 04:26 AM ---------- Previous post was at 02:33 AM ----------

Quote Originally Posted by ZReal View Post
kinda agree i mean if you just give a dll source code dafuq you tryna get i mean thats default code when you make a dll in c++ do you even know what any of it means yet theres more to just hooking you gota learn some directx stuff aswell aswell as if you want your hacks UD then learn external hacks which uses GDI reads process memory and not write so you just get the players coords base health etc and then draw your own tags and boxes sounds easy coz it easy once you learn c++ i swear man its easy just look on youtube for Buckys c++ tuts or anything i mean just dedicate time making like simple little apps first then going to console trainers etc you cant just expect a fuken BoxEsp or lineEsp from the sound of it thats what you want from just a dll source i mean seriously
Also, coding a wh in MW3 is as easy as this so why not MW2? Same concept for AC130 Boxes:

Code:
#include <windows.h>
#include <iostream>

typedef struct
{
	int Valid;                     //0x0 - [0x009FC748]
	char _0x0004[0x8];             //0x4 - [0x009FC74C]
	char Name[16];                 //0xC - [0x009FC754]
	int Team;                      //0x1C - [0x009FC764]
	char _0x0020[0x4];             //0x20 - [0x009FC768]
	int Rank;                      //0x24 - [0x009FC76C]
	char _0x0028[0x10];            //0x28 - [0x009FC770]
	int Perk;                      //0x38 - [0x009FC780]
	char _0x003C[0x8];             //0x3C - [0x009FC784]
	int Score;                     //0x44 - [0x009FC78C]
	char _0x0048[0x458];           //0x48 - [0x009FC790]
	int Attacking;                 //0x4A0 - [0x009FBE8]
	char _0x04A4[0x4];             //0x4A4 - [0x009FBEC]
	int Zooming;			       //0x4A8 - [0x009FBF0]
	char _0x04AC[0xB8];            //0x4AC - [0x009FBF4]
}ClientInfo_T; //[SIZE: 0x560]

ClientInfo_T* Clients[18];

void FixBlindPerks()
{
	for(int i = 0; i < 18; i++) 
	{
		Clients[i] = (ClientInfo_T*)(0x009FC748 + ((int)0x560*i));
		if(Clients[i] != Clients[*(int*)0x8FF250])
		{
			if(Clients[i]->Perk & 0x20 || Clients[i]->Perk & 0x40)
				Clients[i]->Perk = 0x0;
		}
	}
}
void CallChopper()
{
	if(*(int*)0x8FF110 != 0)
	{
		DWORD dwCall = 0x5AA470;
		FixBlindPerks();
		__asm
		{
			push 0x0;
			call [dwCall];
			add esp, 0x4;
		}
	}
}

void HookUiShowList(int a1, int a2, int a3, int a4)
{
	__asm PUSHAD;
	if(!Chopper) CallChopper();
	__asm POPAD;
	uiShowList(a1, a2, a3, a4);
}

void *DetourFunction (BYTE *src, const BYTE *dst, const int len)
{
	BYTE *jmp = (BYTE*)malloc(len+5);
	DWORD dwBack;

	VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwBack);
	memcpy(jmp, src, len);
	jmp += len;
	jmp[0] = 0xE9;
	*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
	src[0] = 0xE9;
	*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
	for (int i=5; i<len; i++)  
		src[i]=0x90;
	VirtualProtect(src, len, dwBack, &dwBack);
	return (jmp-len);
}

BOOL APIENTRY DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
             uiShowList = (tUiShowList)DetourFunction((PBYTE)OffsetUiShowList, (PBYTE)&HookUiShowList, 5);
        }
        return TRUE;
}
And a Namehack as simple as:
Code:
typedef void (__cdecl *sub_588A10)(int a1, int a2, float a3);
sub_588A10 origDrawNameTag = NULL;

//IN Main.cpp
void __cdecl CG_DrawNameTagsHook(int a1, int a2, float a3)
{
	if(drawNameTags)	return origDrawNameTag(a1, a2, 1.0f);
	else return origDrawNameTag(a1, a2, a3);
}

//DllMain
origDrawNameTag = (sub_588A10)DetourFunction((PBYTE)0x588A10, (PBYTE)&CG_DrawNameTagsHook, 6);
Again, same concept.
Quote Originally Posted by Kenshin13 View Post
Code:
//////////////////////DLLMAIN.CPP////////////////////////

#include <windows.h>
#include "Hooks.h"

BOOL APIENTRY DllMain(HMODULE hDllModule, DWORD dwReason, LPVOID lpVoid)
{
   if(dwReason==DLL_PROCESS_ATTACH)
         CallDetour();
   return TRUE;
}

////////////////////////HOOKS.H/////////////////////////

void *DetourFunction (BYTE *src, const BYTE *dst, const int len)
{
	BYTE *jmp = (BYTE*)malloc(len+5);
	DWORD dwBack;

	VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwBack);
	memcpy(jmp, src, len);
	jmp += len;
	jmp[0] = 0xE9;
	*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
	src[0] = 0xE9;
	*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
	for (int i=5; i<len; i++)
		src[i]=0x90;
	VirtualProtect(src, len, dwBack, &dwBack);
	return (jmp-len);
}

void MakeJMP( BYTE *pAddress, DWORD dwJumpTo, DWORD dwLen )
{
	DWORD dwOldProtect, dwBkup, dwRelAddr;

	VirtualProtect(pAddress, dwLen, PAGE_EXECUTE_READWRITE, &dwOldProtect);
	dwRelAddr = (DWORD) (dwJumpTo - (DWORD) pAddress) - 5;
	*pAddress = 0xE9;

	*((DWORD *)(pAddress + 0x1)) = dwRelAddr;
	for(DWORD x = 0x5; x < dwLen; x++) *(pAddress + x) = 0x90;
	VirtualProtect(pAddress, dwLen, dwOldProtect, &dwBkup);

	return;
}

void CallChopper()
{
   //Draw2D Boxes here
}

__declspec(naked) Draw2DHook()
{
  __asm
  {
    PUSHAD;
    PUSHFD;
  }
  // CallChopper();
  __asm
  {
    POPAD;
    POPFD;
    //Do overwritten shit here
  }
}

void CallDetour()
{
    //Hook aCI
    //Hook Draw2D with Draw2D Hook
}
Enjoy you lil leecher.

---------- Post added at 04:26 AM ---------- Previous post was at 02:33 AM ----------



Also, coding a wh in MW3 is as easy as this so why not MW2? Same concept for AC130 Boxes:

Code:
#include <windows.h>
#include <iostream>

typedef struct
{
	int Valid;                     //0x0 - [0x009FC748]
	char _0x0004[0x8];             //0x4 - [0x009FC74C]
	char Name[16];                 //0xC - [0x009FC754]
	int Team;                      //0x1C - [0x009FC764]
	char _0x0020[0x4];             //0x20 - [0x009FC768]
	int Rank;                      //0x24 - [0x009FC76C]
	char _0x0028[0x10];            //0x28 - [0x009FC770]
	int Perk;                      //0x38 - [0x009FC780]
	char _0x003C[0x8];             //0x3C - [0x009FC784]
	int Score;                     //0x44 - [0x009FC78C]
	char _0x0048[0x458];           //0x48 - [0x009FC790]
	int Attacking;                 //0x4A0 - [0x009FBE8]
	char _0x04A4[0x4];             //0x4A4 - [0x009FBEC]
	int Zooming;			       //0x4A8 - [0x009FBF0]
	char _0x04AC[0xB8];            //0x4AC - [0x009FBF4]
}ClientInfo_T; //[SIZE: 0x560]

ClientInfo_T* Clients[18];

void FixBlindPerks()
{
	for(int i = 0; i < 18; i++) 
	{
		Clients[i] = (ClientInfo_T*)(0x009FC748 + ((int)0x560*i));
		if(Clients[i] != Clients[*(int*)0x8FF250])
		{
			if(Clients[i]->Perk & 0x20 || Clients[i]->Perk & 0x40)
				Clients[i]->Perk = 0x0;
		}
	}
}
void CallChopper()
{
	if(*(int*)0x8FF110 != 0)
	{
		DWORD dwCall = 0x5AA470;
		FixBlindPerks();
		__asm
		{
			push 0x0;
			call [dwCall];
			add esp, 0x4;
		}
	}
}

void HookUiShowList(int a1, int a2, int a3, int a4)
{
	__asm PUSHAD;
	if(!Chopper) CallChopper();
	__asm POPAD;
	uiShowList(a1, a2, a3, a4);
}

void *DetourFunction (BYTE *src, const BYTE *dst, const int len)
{
	BYTE *jmp = (BYTE*)malloc(len+5);
	DWORD dwBack;

	VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwBack);
	memcpy(jmp, src, len);
	jmp += len;
	jmp[0] = 0xE9;
	*(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
	src[0] = 0xE9;
	*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
	for (int i=5; i<len; i++)  
		src[i]=0x90;
	VirtualProtect(src, len, dwBack, &dwBack);
	return (jmp-len);
}

BOOL APIENTRY DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
             uiShowList = (tUiShowList)DetourFunction((PBYTE)OffsetUiShowList, (PBYTE)&HookUiShowList, 5);
        }
        return TRUE;
}
And a Namehack as simple as:
Code:
typedef void (__cdecl *sub_588A10)(int a1, int a2, float a3);
sub_588A10 origDrawNameTag = NULL;

//IN Main.cpp
void __cdecl CG_DrawNameTagsHook(int a1, int a2, float a3)
{
	if(drawNameTags)	return origDrawNameTag(a1, a2, 1.0f);
	else return origDrawNameTag(a1, a2, a3);
}

//DllMain
origDrawNameTag = (sub_588A10)DetourFunction((PBYTE)0x588A10, (PBYTE)&CG_DrawNameTagsHook, 6);
Again, same concept.
I've Already made it -_-
from? My source?
Quote Originally Posted by Kenshin13 View Post
from? My source?
no. >_______>
@Kenshin13 Stop feeding the copy&pasters with copy&pasted stuff. JK
Quote Originally Posted by MarkHC View Post
@Kenshin13 Stop feeding the copy&pasters with copy&pasted stuff. JK
C&P? Oh No You Didn't.
LOL Nah Well, structs/offsets were C&P except for name esp (which I happened to find.....after you -_-)
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us