I got a little problem with my program, still trying to figure out a way around it.
I inject my dll into a program with CreateProcessEx, and then, if I try to hook the winsock before the program has made any attempt to send information to the net, the program where I injected my dll crashes. It doesn't give any error while hooking... it just crashes when the program actually tries to access the internet.
Also, after hooking, I can't send packets from my application until a packet is actually sent from the other program (this is easily explained by the "DataSocket := 0"). Still, is there anyway around this?
Thx in advance,
Cogumel0
Winsock Hook problem
function HookCallback?
I don't even use that nor do I know what it's for or even where to put it
This is how I hook it and all I do to hook it:
I don't even use that nor do I know what it's for or even where to put it
This is how I hook it and all I do to hook it:
Code: Select all
Function HookWinsock(): boolean;//True if successful
begin
try
hookapi('ws2_32.dll','send', @sendHookProc, @sendNextHook);
hookapi('wsock32.dll','send', @sendHookProc, @sendNextHook);
HookWinsock:=True;
except
HookWinsock:=False;
end;
end;