I'm trying to make wallhack using memcpy function. (sorry for bad english, hope you understand this post)
cod2 Offset is:
004DC80E C74424 14 80000000 MOV DWORD PTR SS:[ESP+14],80
now i need to change this in memory to get a wallhack:
004DC80E C74424 14 88000000 MOV DWORD PTR SS:[ESP+14],88
looks like memcpy function does not work !
NoRecoil works great, but wallhack crashes the game.Code:// dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" DWORD old; DWORD patch[5] = { 0xC7, 0x44, 0x24, 0x14, 0x88 }; void NoRecoil () { //fgdfdfdf } BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: MessageBox (0,L"Test",L"COD2 chit",64); /// No recoil DetourFunction((PBYTE)0x004F5860,(PBYTE)NoRecoil); /// wh VirtualProtect((void*)0x4DC80E,sizeof(patch),PAGE_READWRITE,&old); memcpy ((void*)0x4DC80E,(const void*)patch,sizeof(patch)); //*((BYTE*)0x4DC80E) = 0xC7, 0x44, 0x24, 0x14, 0x88 ; VirtualProtect((void*)0x4DC80E,sizeof(patch),old,0); break; case DLL_PROCESS_DETACH: DetourRemove ((PBYTE)0x004F5860,(PBYTE)NoRecoil); break; } return TRUE; }
Pls help, maybe i did something wrong.
Thx.
*
ok, i got it.
i need to write just one byte (not 5 lol ) to a adress 0x004DC812.
now works great (on non PB servers,ofcourse)


LinkBack URL
About LinkBacks
)
Reply With Quote




Bookmarks