could someone please explain to me how this works and how i would go about updating it.... please actualy explain it and help me not just update it for me. thanks. btw this is not mine. the is from nubzgetkillz base.
Code:void *Salta(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] = 0xE9; *(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5; src[0] = 0xE9; *(DWORD*)(src+1) = (DWORD)(dst - src) - 5; VirtualProtect(src, len, dwback, &dwback); return (jmp-len); }
It looks like it writes a far jmp instruction at the `src`, where the target is the `dst`, taking up `len+5` bytes.
E9 is the byte that represents the JMP opcode, and the following it is the 32-bit operand that specifies the destination to jump to, since it is a far jmp instruction.
The function is fine you need to update your addresses for where you want to hook
in that hack base, that is the detour not the hook... I think? i might be wrong... o.o The hook is right above it.
Whatever it is, you don't need to update it, (I use it in my private hack.) All you need to do is update the hook above it ^^
Last edited by cubanelite; 12-08-2011 at 02:52 PM.
d3d graphics use a com interface so hook table
Way she fuckin goes boys
Don't quit It's worth the time and effort you put into it man!
This is the code you need to replace, you need to find a working hook to replace it though. (might be hard to find (or make) a new one.):
Hope I Helped.Code:void CreateDev(DWORD * dwVTable){ LPDIRECT3D9 pD3d9 = NULL; LPDIRECT3DDEVICE9 pD3DDevice = NULL; pD3d9 = Direct3DCreate9(D3D_SDK_VERSION); if(pD3d9 == NULL){ return; } D3DPRESENT_PARAMETERS pPresentParms; ZeroMemory(&pPresentParms,sizeof(pPresentParms)); pPresentParms.Windowed = TRUE; pPresentParms.BackBufferFormat = D3DFMT_UNKNOWN; pPresentParms.SwapEffect = D3DSWAPEFFECT_DISCARD; if(FAILED(pD3d9->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,GetDesktopWindow(),D3DCREATE_SOFTWARE_VERTEXPROCESSING,&pPresentParms,&pD3DDevice))){ return; } DWORD * dwTable = ( DWORD* )pD3DDevice; dwTable = ( DWORD* ) dwTable[0]; dwVTable[0] = dwTable[16]; dwVTable[1] = dwTable[17]; dwVTable[2] = dwTable[82]; }
OBrozz (12-09-2011),Skaterforeva1 (12-08-2011)
cubanelite (12-08-2011)