Function at 0x100012a1
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, 0x314
mov eax, dword [ebp + 8]
xor edx, edx
push ebx
push esi
cmp eax, edx
push edi
mov esi, ecx
jge 0x100012bb
mov eax, dword [esi + 0x14]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0xc]
cmp eax, edx
jge 0x100012c8
mov eax, dword [esi + 0x10]
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 0x10]
cmp eax, edx
je 0x100012d4
mov dword [eax], edx
mov eax, dword [ebp + 0x14]
cmp eax, edx
je 0x100012dd
mov dword [eax], edx
mov eax, dword [esi + 0x140]
push 2
pop ebx
push 3
cmp eax, ebx
pop edi
je 0x1000154d
cmp eax, edi
je 0x1000149f
jle 0x100015cb
cmp eax, 5
jg 0x100015cb
mov ecx, dword [esi + 0x24]
cmp ecx, edx
jle 0x100013b7
cmp dword [ebp + 8], edx
jle 0x100013b7
mov edx, dword [esi + 0x20]
mov eax, dword [esi + 0x14]
sub eax, edx
cmp eax, ecx
jle 0x1000132a
mov eax, ecx
cmp eax, dword [ebp + 8]
jle 0x10001332
mov eax, dword [ebp + 8]
test eax, eax
jle 0x1000136a
push 0
push eax
mov eax, dword [esi + 0xc]
add eax, edx
push eax
push dword [esi]
call sub.WS2_32.dll_send
mov edi, eax
cmp edi, 0xffffffff
jne 0x10001352
call sub.WS2_32.dll_WSAGetLastError
mov ebx, dword [ebp + 0x10]
test edi, edi
jle 0x1000136d
sub dword [ebp + 8], edi
test ebx, ebx
je 0x10001362
add dword [ebx], edi
add dword [esi + 0x20], edi
sub dword [esi + 0x24], edi
jmp 0x1000136d
mov ebx, dword [ebp + 0x10]
mov eax, dword [esi + 0x14]
cmp dword [esi + 0x20], eax
jl 0x100013b7
mov ecx, dword [esi + 0x24]
and dword [esi + 0x20], 0
test ecx, ecx
jle 0x100013b7
cmp eax, ecx
jle 0x10001386
mov eax, ecx
cmp eax, dword [ebp + 8]
jle 0x1000138e
mov eax, dword [ebp + 8]
push 0
push eax
push dword [esi + 0xc]
push dword [esi]
call sub.WS2_32.dll_send
mov edi, eax
cmp edi, 0xffffffff
jne 0x100013a7
call sub.WS2_32.dll_WSAGetLastError
test edi, edi
jle 0x100013b7
test ebx, ebx
je 0x100013b1
add dword [ebx], edi
add dword [esi + 0x20], edi
sub dword [esi + 0x24], edi
mov edi, dword [esi + 0x1c]
mov ecx, dword [esi + 0x10]
cmp edi, ecx
jge 0x10001479
mov edx, dword [esi + 0x18]
mov eax, ecx
sub eax, edx
sub ecx, edi
cmp eax, ecx
jle 0x100013d4
mov eax, ecx
cmp eax, dword [ebp + 0xc]
jle 0x100013dc
mov eax, dword [ebp + 0xc]
test eax, eax
jle 0x10001424
push 0
push eax
mov eax, dword [esi + 8]
add eax, edx
push eax
push dword [esi]
call sub.WS2_32.dll_recv
mov edi, eax
test edi, edi
je 0x10001490
jge 0x1000140c
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x10001490
test edi, edi
jle 0x10001424
mov ebx, dword [ebp + 0x14]
sub dword [ebp + 0xc], edi
test ebx, ebx
je 0x1000141c
add dword [ebx], edi
add dword [esi + 0x18], edi
add dword [esi + 0x1c], edi
jmp 0x10001427
mov ebx, dword [ebp + 0x14]
mov eax, dword [esi + 0x10]
cmp dword [esi + 0x18], eax
jl 0x10001479
mov ecx, dword [esi + 0x1c]
and dword [esi + 0x18], 0
cmp ecx, eax
jge 0x10001479
sub eax, ecx
cmp eax, dword [ebp + 0xc]
jle 0x10001444
mov eax, dword [ebp + 0xc]
test eax, eax
jle 0x10001479
push 0
push eax
push dword [esi + 8]
push dword [esi]
call sub.WS2_32.dll_recv
mov edi, eax
test edi, edi
je 0x10001490
jge 0x10001469
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x10001490
test edi, edi
jle 0x10001479
test ebx, ebx
je 0x10001473
add dword [ebx], edi
add dword [esi + 0x18], edi
add dword [esi + 0x1c], edi
cmp dword [esi + 0x140], 5
jne 0x100015cb
cmp dword [esi + 0x24], 1
jge 0x100015cb
mov dword [esi + 0x140], 6
jmp 0x100015cb
mov eax, dword [esi]
xor ecx, ecx
mov dword [ebp - 0x310], eax
mov dword [ebp - 0x20c], eax
mov dword [ebp - 0x108], eax
push 8
lea eax, [ebp - 8]
inc ecx
push edx
push eax
mov dword [ebp - 0x314], ecx
mov dword [ebp - 0x210], ecx
mov dword [ebp - 0x10c], ecx
call fcn.100031f7
add esp, 0xc
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x10c]
push eax
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x314]
push eax
mov eax, dword [esi]
inc eax
push eax
call sub.WS2_32.dll_select
cmp eax, 0xffffffff
jne 0x10001514
mov dword [esi + 0x144], str.connecting_to_host__calling_select___
and dword [esi + 0x140], 0
jmp 0x100015cb
lea eax, [ebp - 0x210]
push eax
push dword [esi]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x10001535
mov dword [esi + 0x140], 4
jmp 0x100015cb
lea eax, [ebp - 0x10c]
push eax
push dword [esi]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x100015cb
jmp 0x10001597
lea eax, [esi + 0x2c]
cmp dword [eax], 0xffffffff
jne 0x1000157a
mov ecx, dword [esi + 0x138]
cmp ecx, edx
je 0x1000156d
push eax
lea eax, [esi + 0x38]
push eax
call fcn.10001043
xor edx, edx
jmp 0x10001570
or eax, 0xffffffff
cmp eax, edx
jne 0x100015a6
mov dword [esi + 0x140], edi
lea eax, [esi + 0x28]
push 0x10
push eax
push dword [esi]
call sub.WS2_32.dll_connect
test eax, eax
je 0x10001526
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x100015c5
mov dword [esi + 0x144], str.connecting_to_host
jmp 0x10001508
cmp eax, 1
jne 0x100015b3
mov dword [esi + 0x140], ebx
jmp 0x100015cb
mov dword [esi + 0x144], str.resolving_hostname
mov dword [esi + 0x140], edx
jmp 0x100015cb
mov dword [esi + 0x140], edi
pop edi
pop esi
pop ebx
leave
ret 0x10