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 ----------
Originally Posted by
ZReal
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.