Hello guys,
Wanted to share with you my new detour function:
Code:
void PlaceJMP( BYTE *bt_DetourAddress, DWORD dw_FunctionAddress, DWORD dw_Size)
{
DWORD dw_OldProtection, dw_Distance;
VirtualProtect(bt_DetourAddress, dw_Size, PAGE_EXECUTE_READWRITE, &dw_OldProtection);
dw_Distance = (DWORD)(dw_FunctionAddress - (DWORD)bt_DetourAddress) - 5;
*bt_DetourAddress = 0xE9;
*(DWORD*)(bt_DetourAddress + 0x1) = dw_Distance;
for(int i = 0x5; i < dw_Size; i++) *(bt_DetourAddress + i) = 0x90;
VirtualProtect(bt_DetourAddress, dw_Size, dw_OldProtection, NULL);
return;
}
it does the same as the old detour function but the code is optimized and the variables now have better names !
The surprise:
The simple memory hacking is still possible
@
giniyat101 you were right
any way not even "CreateThread" function needed or hook