Need Explenation and help

Posts 115 of 15 · Page 1 of 1
Need Explenation and help
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);
}
Quote Originally Posted by UnderAmour View Post
@aeronyx
@AVGN

Should be moved to the help section...
It has to do with coding so it should b in the coding help section were it is... Y do u want to move it to just the regular help section????
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.
this is the hook right??? if it is how would i go about updating it? thanks
The function is fine you need to update your addresses for where you want to hook
so i just need to update 0xE9... do i find the update one in cshell how would i find the updated byte???
Quote Originally Posted by Skaterforeva1 View Post
so i just need to update 0xE9... do i find the update one in cshell how would i find the updated byte???
No, the function is fine you need to update your addresses for where you want to hook
Quote Originally Posted by Refrain View Post
No, the function is fine you need to update your addresses for where you want to hook
im sry im still a semi noob. what is that lol...
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 ^^
Quote Originally Posted by cubanelite View Post
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 ^^
so update the dwtable right above it. were would i find that.
d3d graphics use a com interface so hook table
ugh i give up... i will just stick to my stupid hotkey base. thank you to everyone that tried to assist me.
Quote Originally Posted by Skaterforeva1 View Post
ugh i give up... i will just stick to my stupid hotkey base. thank you to everyone that tried to assist me.
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.):
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];
}
Hope I Helped.
Quote Originally Posted by cubanelite View Post
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.):
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];
}
Hope I Helped.
ahh thanks... i will still stick to my hotkey but i will def try to fix this in my free time.
Posts 115 of 15 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?