detour
can anyone teach me how to make a detour or have a detour i can use?
im getting so many errors... it says the arguments for getModuleHandle has to be lpcwstr but we r inputing a const char...
if( GetModuleHandle( "Kernel32.dll" ) != NULL
&& GetModuleHandle( "d3d9.dll" ) != NULL
&& GetModuleHandle( "Engine.exe" ) != NULL
&& GetModuleHandle( "CShell.dll" ) != NULL
&& GetModuleHandle( "Clientfx.fxd" ) != NULL )
i get error at all the underlined... im getting like 30 errors idk what to do
- - - Updated - - -
hey can you take a look at the code you sent me? i dont know how to fix the errors...
LPVOID DetourCreate(BYTE *src, CONST BYTE *dst, CONST INT len)
{
BYTE *jmp = (BYTE*)malloc(len + 5);
DWORD dwBack;
VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
memcpy(jmp, src, len);
jmp += len;
jmp[0] = '\xE9';
*(DWORD*)(jmp + 1) = (DWORD)(src + len - jmp) - 5;
src[0] = '\x90';
src[1] = '\xD1';
src[2] = '\xC8';
src[3] = '\x85';
src[4] = '\xC0';
src[5] = '\xE9';
*(DWORD*)(&src[6]) = (DWORD)(dst - src) - 10;
for (INT i = 10; i < len; i++) src[i] = 0x90;
VirtualProtect(src, len, dwBack, &dwBack);
return (jmp - len);
}
LPVOID DetourCreate(BYTE *src, CONST BYTE *dst, CONST INT len)
{
BYTE *jmp = (BYTE*)malloc(len + 5);
DWORD dwBack;
VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
memcpy(jmp, src, len);
jmp += len;
jmp[0] = '\xE9';
*(DWORD*)(jmp + 1) = (DWORD)(src + len - jmp) - 5;
src[0] = '\xD1';
src[1] = '\xC8';
src[2] = '\x85';
src[3] = '\xC0';
src[4] = '\x90';
src[5] = '\xE9';
*(DWORD*)(&src[6]) = (DWORD)(dst - src) - 10;
for (INT i = 10; i < len; i++) src[i] = 0x90;
VirtualProtect(src, len, dwBack, &dwBack);
return (jmp - len);
}
LPVOID DetourCreate(BYTE *src, CONST BYTE *dst, CONST INT len)
{
BYTE *jmp = (BYTE*)malloc(len + 5);
DWORD dwBack;
VirtualProtect(src, len, PAGE_READWRITE, &dwBack);
memcpy(jmp, src, len);
jmp += len;
jmp[0] = '\xE9';
*(DWORD*)(jmp + 1) = (DWORD)(src + len - jmp) - 5;
src[0] = '\xD1';
src[1] = '\xC8';
src[2] = '\x90';
src[3] = '\x85';
src[4] = '\xC0';
src[5] = '\xE9';
*(DWORD*)(&src[6]) = (DWORD)(dst - src) - 10;
for (INT i = 10; i < len; i++) src[i] = 0x90;
VirtualProtect(src, len, dwBack, &dwBack);
return (jmp - len);
}
this is the detour im using... i get errors... i just paste this in to the detour.h and build it but then it gives me errors about tpresent in main.cpp...
the only error i get in detour.h is: function 'LPVOID DetourCreate(BYTE *,const BYTE *,const INT)' already has a body line 30
Man, learn a basic of c++
i solved it all but it crashed when i injected it...
well... time to search
- - - Updated - - -
idk what to do... how do i fix?