Function at 0x1007ef3
Capabilities:
Connect socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x338
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
cmp esi, edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x20], edi
jne 0x1007f19
push 0xfffffffffffffffb
pop eax
jmp 0x10083fd
test byte [0x1010253], 0x80
mov ebx, dword [ebp + 0xc]
je 0x1007f43
push dword [ebp + 0x10]
push 0x1002468
call dword [sym.imp.MSVCRT.dll_printf]
mov eax, dword [ebp + 0x10]
pop ecx
pop ecx
add eax, ebx
push 1
push eax
push ebx
call fcn.010051e4
mov ax, word [0x10101c4]
mov word [ebp - 0x34], 2
push eax
call sub.WSOCK32.dll_htons
test byte [0x1010250], 8
mov word [ebp - 0x32], ax
mov eax, dword [esi]
mov dword [ebp - 0x30], eax
jne 0x1007f73
cmp dword [ebp + 0x10], 0x200
mov dword [ebp - 8], edi
jle 0x1007f7a
mov dword [ebp - 8], 1
mov eax, dword [ebp + 0xc]
or ebx, 0xffffffff
cmp dword [0x101024c], edi
mov dword [ebp - 4], edi
mov ax, word [eax]
mov word [ebp - 0x24], ax
jle 0x10083c5
mov esi, dword [sym.imp.MSVCRT.dll_perror]
jmp 0x1007fa6
mov esi, dword [sym.imp.MSVCRT.dll_perror]
xor edi, edi
cmp dword [ebp - 8], edi
jne 0x10080ff
mov eax, dword [0x10101c0]
cmp eax, ebx
jne 0x1007fcf
push edi
push 2
push 2
call sub.WSOCK32.dll_socket
cmp eax, ebx
mov dword [0x10101c0], eax
je 0x1008300
cmp dword [ebp - 0xc], edi
jne 0x1007fef
lea ecx, [ebp - 0x34]
push 0x10
push ecx
push eax
call sub.WSOCK32.dll_connect
cmp eax, ebx
je 0x1008319
mov dword [ebp - 0xc], 1
push edi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [0x10101c0]
call sub.WSOCK32.dll_send
cmp eax, ebx
je 0x100832d
mov eax, dword [0x1010248]
cmp eax, edi
mov dword [ebp - 0x1c], eax
jg 0x100801c
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x18], edi
mov eax, dword [0x10101c0]
push 1
pop edi
lea ecx, [ebp - 0x1c]
xor esi, esi
push ecx
push esi
lea ecx, [ebp - 0x138]
push esi
push ecx
push eax
mov dword [ebp - 0x134], eax
mov dword [ebp - 0x138], edi
call sub.WSOCK32.dll_select
cmp eax, esi
jl 0x1008340
je 0x100835f
push esi
mov esi, dword [ebp + 0x14]
push dword [ebp + 0x18]
push esi
push dword [0x10101c0]
call sub.WSOCK32.dll_recv
mov edi, eax
test edi, edi
je 0x1008393
cmp edi, ebx
je 0x1008393
mov ax, word [ebp - 0x24]
mov dword [ebp - 0x10], 1
cmp ax, word [esi]
je 0x10080b2
test byte [0x1010253], 0x80
je 0x100801f
push 0x100244c
call dword [sym.imp.MSVCRT.dll_printf]
mov eax, esi
pop ecx
add edi, eax
push 1
push edi
push eax
call fcn.010051e4
jmp 0x100801f
mov al, byte [0x1010250]
test al, 0x20
jne 0x100844b
mov ecx, dword [ebp + 0x14]
test byte [ecx + 2], 2
je 0x100844b
test al, 2
je 0x10080dc
push 0x1002438
call dword [sym.imp.MSVCRT.dll_printf]
pop ecx
push dword [0x10101c0]
call sub.WSOCK32.dll_closesocket
mov esi, dword [sym.imp.MSVCRT.dll_perror]
or ebx, 0xffffffff
mov dword [0x10101c0], ebx
mov dword [ebp - 8], 1
xor edi, edi
mov eax, dword [0x101024c]
cmp dword [0x10101c0], ebx
mov dword [ebp - 0x14], edi
mov dword [ebp - 4], eax
jne 0x100816d
push edi
push 1
push 2
call sub.WSOCK32.dll_socket
cmp eax, ebx
mov dword [0x10101c0], eax
jne 0x1008141
call sub.WSOCK32.dll_WSAGetLastError
test byte [0x1010250], 2
je 0x10083b1
push 0x1002424
jmp 0x100833b
lea ecx, [ebp - 0x34]
push 0x10
push ecx
push eax
call sub.WSOCK32.dll_connect
cmp eax, ebx
jne 0x100816d
call sub.WSOCK32.dll_WSAGetLastError
test byte [0x1010250], 2
je 0x10082ea
push 0x1002414
jmp 0x10082e7
push dword [ebp + 0x10]
call sub.WSOCK32.dll_htons
mov dword [ebp + 8], eax
push edi
lea eax, [ebp + 8]
push 2
push eax
push dword [0x10101c0]
call sub.WSOCK32.dll_send
cmp eax, ebx
je 0x10082d4
push edi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [0x10101c0]
call sub.WSOCK32.dll_send
cmp eax, ebx
je 0x10082d4
mov edi, dword [ebp + 0x14]
mov dword [ebp + 8], 2
movzx eax, word [ebp + 8]
push 0
push eax
push edi
push dword [0x10101c0]
call sub.WSOCK32.dll_recv
mov esi, eax
test esi, esi
jle 0x10081db
sub dword [ebp + 8], esi
add edi, esi
cmp word [ebp + 8], 0
jne 0x10081b6
cmp esi, ebx
jne 0x100822b
call sub.WSOCK32.dll_WSAGetLastError
test byte [0x1010250], 2
mov esi, eax
je 0x10081fb
push 0x1002408
call dword [sym.imp.MSVCRT.dll_perror]
pop ecx
push dword [0x10101c0]
call sub.WSOCK32.dll_closesocket
cmp esi, 0x6f
mov dword [0x10101c0], ebx
jne 0x10083b1
cmp dword [ebp - 0x20], 0
jne 0x10083b1
mov dword [ebp - 0x20], 1
jmp 0x10083b1
mov ebx, dword [ebp + 0x14]
mov ax, word [ebx]
push eax
call sub.WSOCK32.dll_ntohs
movzx edi, ax
cmp edi, dword [ebp + 0x18]
jbe 0x100826d
test byte [0x1010250], 2
je 0x100825e
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push 0x10023f4
add eax, 0x40
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
pop ecx
pop ecx
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x14], 1
mov dword [ebp + 8], eax
jmp 0x1008270
mov dword [ebp + 8], edi
cmp word [ebp + 8], 0
je 0x1008297
movzx eax, word [ebp + 8]
push 0
push eax
push ebx
push dword [0x10101c0]
call sub.WSOCK32.dll_recv
mov esi, eax
test esi, esi
jle 0x1008297
add ebx, esi
sub dword [ebp + 8], esi
jmp 0x1008270
cmp esi, 0xffffffff
jne 0x1008404
call sub.WSOCK32.dll_WSAGetLastError
test byte [0x1010250], 2
je 0x10082ba
push 0x1002408
call dword [sym.imp.MSVCRT.dll_perror]
pop ecx
push dword [0x10101c0]
call sub.WSOCK32.dll_closesocket
or dword [0x10101c0], 0xffffffff
or ebx, 0xffffffff
jmp 0x10083b1
call sub.WSOCK32.dll_WSAGetLastError
test byte [0x1010250], 2
je 0x10082ea
push 0x10023e4
call esi
pop ecx
push dword [0x10101c0]
call sub.WSOCK32.dll_closesocket
mov dword [0x10101c0], ebx
jmp 0x10083b1
call sub.WSOCK32.dll_WSAGetLastError
test byte [0x1010250], 2
je 0x10083b1
push 0x10023d0
jmp 0x100833b
test byte [0x1010250], 2
je 0x10083b1
push 0x10023c8
jmp 0x100833b
test byte [0x1010250], 2
je 0x10083b1
push 0x10023c0
call esi
pop ecx
jmp 0x10083b1
test byte [0x1010250], 2
je 0x1008355
push 0x10023b8
call dword [sym.imp.MSVCRT.dll_perror]
pop ecx
call fcn.010084a3
mov dword [ebp - 0xc], esi
jmp 0x10083b1
mov esi, dword [sym.imp.MSVCRT.dll_printf]
push 0x10023a0
call esi
pop ecx
push dword [ebp - 0x1c]
push 0x1002380
call esi
test byte [0x1010250], 2
pop ecx
pop ecx
je 0x100838e
push dword [ebp - 0x1c]
push 0x100236c
call esi
pop ecx
pop ecx
mov dword [ebp - 0x10], edi
jmp 0x10083b1
test byte [0x1010250], 2
je 0x10083a8
push 0x1002360
call dword [sym.imp.MSVCRT.dll_perror]
pop ecx
call fcn.010084a3
and dword [ebp - 0xc], 0
inc dword [ebp - 4]
mov eax, dword [ebp - 4]
cmp eax, dword [0x101024c]
jl 0x1007f9e
xor edi, edi
mov eax, dword [0x10101c0]
cmp eax, ebx
je 0x10083da
push eax
call sub.WSOCK32.dll_closesocket
mov dword [0x10101c0], ebx
cmp dword [ebp - 8], edi
jne 0x10083eb
mov eax, dword [ebp - 0x10]
neg eax
sbb eax, eax
and eax, 4
jmp 0x10083fa
call sub.WSOCK32.dll_WSAGetLastError
sub eax, 0x72
neg eax
sbb eax, eax
and eax, 2
add eax, 0xfffffffb
pop edi
pop esi
pop ebx
leave
ret 0x18
cmp dword [ebp - 0x14], 0
je 0x100844b
mov eax, dword [ebp + 0x14]
mov ecx, edi
or byte [eax + 2], 2
sub ecx, dword [ebp + 0x18]
test cx, cx
mov dword [ebp + 8], ecx
je 0x100844b
mov eax, 0x200
cmp cx, ax
ja 0x100842b
movzx eax, cx
push 0
push eax
lea eax, [ebp - 0x338]
push eax
push dword [0x10101c0]
call sub.WSOCK32.dll_recv
test eax, eax
jle 0x100844b
mov ecx, dword [ebp + 8]
sub ecx, eax
jmp 0x1008416
mov eax, dword [0x1010250]
test al, 2
je 0x1008485
test eax, 0x80000000
je 0x100846a
push edi
push 0x1002338
call dword [sym.imp.MSVCRT.dll_printf]
pop ecx
jmp 0x1008475
push 0x100231c
call dword [sym.imp.MSVCRT.dll_printf]
mov eax, dword [ebp + 0x14]
pop ecx
push 1
lea ecx, [edi + eax]
push ecx
push eax
call fcn.010051e4
push dword [0x10101c0]
call sub.WSOCK32.dll_closesocket
mov eax, dword [ebp + 0x1c]
or dword [0x10101c0], 0xffffffff
mov dword [eax], edi
xor eax, eax
jmp 0x10083fd