I've spending the last few days messing with random hooking tutorials, and I even made the InsertDateTime redirect for Notepad and scared a few people by thinking I gave them a virus xD
I'm moved back to CoD and I used OllyDBG to locate the "WEAPON_FIRING" function in cgamex86.dll. but I'm not sure the adress is correct... because when I inject my DLL without any function hooking, CoD starts up, but when I add my hooks, it doesn't start up.
3000CCC5 |. E8 26C50000 CALL cgamex86.300191F0
3000CCCA |. 83C4 04 ADD ESP,4
3000CCCD |. 5E POP ESI
3000CCCE |. C3 RETN
3000CCCF 68 E46D0530 PUSH cgamex86.30056DE4 ASCII"WEAPON_FIRING"
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
MessageBox(0, "Injected!", "TehBlizzy's CoDHook", MB_OK);
WEAPON_FIRING = (int (__stdcall*)(void))DetourFunction((PBYTE)<adress?>, (PBYTE)HookWEAPON_FIRING);
DetourRemove((PBYTE)<adress?>, (PBYTE)WEAPON_FIRING); //Remove hook
/* Returns TRUE on success, FALSE on failure */
Can anyone point me in the right direction of what address(es) I'm supposed to hook and get this to work?
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
int (__stdcall* WEAPON_FIRING)(void);
MessageBox(0, "You just fired a round.", "Function Called", MB_OK);
#endif /* _DLL_H_ */