Re: Need a jump opcode generator.




"Skybuck Flying" <spam@xxxxxxxxxxx> wrote in message
news:f8cbs7$nnu$1@xxxxxxxxxxxxxxxxxxxxxxxxxx
// vSendTo points to sendto function in winsuck 2 ;)

byte( pointer(vSendTo)^ ) := $FF;

Ok, just tested it.

The statement above causes the application to crash.

Me wonders why and investigates...

Also tried:

byte( vSendTo^ ) := $FF;

Oh I see what the problem is...

I did set access rights for the "Stub"

But forget to set access/readwrite rights for the "winsock 2" part.

No problem.

There that should work quite nicely:

var
OldProtect : longword;

if VirtualProtect( vSendTo, 5, PAGE_EXECUTE_READWRITE, OldProtect ) then
begin
writeln('Virtual protect, set execute/read/write for winsock2 sendto
first 5 bytes succeeded.');
end else
begin
writeln('Virtual protect, set execute/read/write for winsock2 sendto
first 5 bytes failed.');
end;

Bye,
Skybuck.



.