View previous topic :: View next topic |
Author |
Message |
jonimane How do I cheat?
Reputation: 0
Joined: 23 Nov 2010 Posts: 3
|
Posted: Tue Nov 23, 2010 8:04 pm Post subject: Delphi Question x.x |
|
|
i hooked two function(recv and send) of ws2_32.dll with this:
Code: | procedure hook(target, newfunc:pointer);
var
jmpto:dword;
OldProtect: Cardinal; // old protect in memory
begin
jmpto := dword(newfunc) - dword(target) - 5;
VirtualProtect(target, 5, PAGE_EXECUTE_READWRITE, @OldProtect);
pbyte(target)^ := $e9;
pdword(dword(target) + 1)^ := jmpto;
end; |
And i am using this funcions to retrieve de unhooked funcions:
Code: |
function unhookedSend(socket:integer; var data; datalen,flags:integer):Integer; assembler; stdcall;
asm
mov edi, edi
push ebp
mov esp, ebp
jmp [realSend];
end;
function unhookedRecv(socket:integer; data: pchar; datalen,flags:integer):Integer; assembler; stdcall;
asm
mov edi, edi
push ebp
mov esp, ebp
jmp [realRecv];
end;
|
but when i call every unhooked function... isn't work x.x
hooked functions:
Code: | function hookSend(socket:integer; var data; datalen,flags:integer): Integer;
begin
Result := unhookedSend(socket, data, datalen, flags);
end;
function hookRecv(socket: integer; data: pchar; datalen,flags: integer): Integer;
begin
Result := unhookedRecv(socket, data, datalen, flags);
end; |
what is the problem? x.x
ps: sorry for my english x.x
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Wed Nov 24, 2010 7:28 am Post subject: |
|
|
do you write realSend and realRecv ?
also, why "var data;' instead of "data:pchar;" ?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
jonimane How do I cheat?
Reputation: 0
Joined: 23 Nov 2010 Posts: 3
|
Posted: Wed Nov 24, 2010 7:39 am Post subject: |
|
|
realSend is a var...
Code: | var
realSend: Pointer;
realRecv: Pointer;
|
var because i have tested with a pchar type and don't works too x.x
more i will change to pchar when it works =]
i call this hook on:
Code: | realSend := Pointer(DWord(GetProcAddress(GetModuleHandle('ws2_32.dll'), 'send')) + 5);
hook(GetProcAddress(GetModuleHandle('ws2_32.dll'), 'send'), @hookSend);
realRecv := Pointer(DWord(GetProcAddress(GetModuleHandle('ws2_32.dll'), 'recv')) + 5);
hook(GetProcAddress(GetModuleHandle('ws2_32.dll'), 'recv'), @hookRecv);
|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Wed Nov 24, 2010 8:03 am Post subject: |
|
|
define "Not work"
Crash when called ?
Nothing being hooked at all?
Harddisk explodes ?
anyhow, also add stdcall; after the hookSend and hookRecv functions
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
jonimane How do I cheat?
Reputation: 0
Joined: 23 Nov 2010 Posts: 3
|
Posted: Wed Nov 24, 2010 9:01 am Post subject: |
|
|
HardDisk Explodes \o/ =]
ps: this program is a dll... i inject on a process... that process use hooked functions
not work:
when i send a packet with a process... the packet don't be sended x.x
i will test with stdcall on hooked functions =]
Thx 4 all =]
@edit
works!!! i saw the problem kkkk
the problem was a LdrLoadDll hook kkkkkkkkkkkk
thx !!!!!!!
|
|
Back to top |
|
 |
|