Delphi - un aporte 3

 
Vista:

un aporte 3

Publicado por ErGrone (3 intervenciones) el 13/05/2003 22:21:59
Function ConectSocket(ipdest:dword;fami:U_short;sport:word;jande:dword):integer;
var
sockaddr:TSockAddrIn;
out:integer;
begin

asm
push sport
call htons
mov word ptr [sockaddr.sin_port],ax
mov ax, fami
mov word ptr [sockaddr.sin_family],ax
mov eax, ipdest
mov dword ptr [sockaddr.sin_addr], eax
mov edx, jande
lea eax, sockaddr
push 10h //Size
push eax
push edx

call connect
mov out, eax
end;

result:=out;
end;

llamada
asm

push destino // ; (sin transformacion a string)
push 2
push 80
push jand
call ConectSocket;
end;
end;

--------------
thread

Function Thr1:integer;
var
a:integer;
begin
//Thread de prueba
end;

ThrId1:Dword;

....
asm
//Crear Thread de prueba
xor eax, eax
push offset thrId1
push eax
push eax
push Offset Thr1
push eax
push eax
call CreateThread

end;

bueno, a alguien le ha de servir.

salu!.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder