Function at 0x100959b
Capabilities:
Connect socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x328
mov eax, dword [0x1014d78]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push edi
push 0x200
xor ebx, ebx
mov dword [ebp - 0x308], ecx
lea ecx, [ebp - 0x304]
push ecx
push ebx
push ebx
push ebx
push 0xfc
push dword [0x101018c]
mov dword [ebp - 0x324], eax
push eax
push ebx
mov dword [ebp - 0x30c], ebx
mov dword [ebp - 0x31c], ebx
mov dword [ebp - 0x318], ebx
mov dword [ebp - 0x314], ebx
call fcn.0100c7d2
mov edi, eax
cmp edi, ebx
jge 0x1009621
test byte [0x1011970], 2
je 0x1009619
push 0xcd
push 2
call fcn.0100bd21
pop ecx
pop ecx
push 0xfffffffffffffffd
pop eax
jmp 0x10096c3
mov eax, dword [0x1016654]
push esi
cmp dword [eax + 8], ebx
jne 0x1009631
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov esi, dword [eax + 8]
add esi, 0x20
movzx eax, word [esi]
mov ecx, 0x3500
cmp ax, 2
jne 0x100964b
mov edx, ecx
mov word [esi + 2], dx
cmp ax, 0x17
jne 0x1009655
mov word [esi + 2], cx
push ebx
movzx eax, ax
push 1
push eax
call dword [sym.imp.WSOCK32.dll_socket]
mov dword [0x10115a0], eax
cmp eax, 0xffffffff
jne 0x100967d
push 0x100212c
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
jmp 0x1009a43
push dword [esi + 0x20]
push esi
push eax
call dword [sym.imp.WSOCK32.dll_connect]
cmp eax, 0xffffffff
jne 0x10096d3
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
cmp eax, 0x274d
jne 0x100969e
push 0xfffffffffffffffb
jmp 0x10096ac
push 0x1002120
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
push 0xfffffffffffffffd
pop esi
push dword [0x10115a0]
call dword [sym.imp.WSOCK32.dll_closesocket]
or dword [0x10115a0], 0xffffffff
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.0100cc5f
leave
ret 8
push edi
call dword [sym.imp.WSOCK32.dll_htons]
mov esi, dword [sym.imp.WSOCK32.dll_send]
movzx eax, ax
push ebx
mov dword [ebp - 0x310], eax
push 2
lea eax, [ebp - 0x310]
push eax
push dword [0x10115a0]
call esi
cmp eax, 0xffffffff
je 0x1009a52
push ebx
push edi
lea eax, [ebp - 0x304]
push eax
push dword [0x10115a0]
call esi
cmp eax, 0xffffffff
je 0x1009a52
mov eax, dword [0x1016654]
cmp dword [eax + 8], ebx
jne 0x100972d
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov edi, dword [sym.imp.msvcrt.dll_fprintf]
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov esi, 0x1002118
add eax, 0x20
push esi
push eax
call edi
add esp, 0xc
cmp dword [ebp - 0x308], ebx
jne 0x1009761
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
mov dword [0x101ad00], eax
jmp 0x10097c3
lea eax, [ebp - 0x104]
push eax
push dword [ebp - 0x308]
call fcn.01009dac
mov dword [0x101ad00], eax
cmp eax, ebx
jne 0x1009794
lea eax, [ebp - 0x104]
push eax
push 0xc
push 2
call fcn.0100bd21
add esp, 0xc
jmp 0x10096aa
push dword [ebp - 0x308]
push 0x1001228
push eax
call edi
mov eax, dword [0x1016654]
add esp, 0xc
cmp dword [eax + 8], ebx
jne 0x10097b4
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
push eax
push esi
push dword [0x101ad00]
call edi
add esp, 0xc
cmp dword [0x101665c], ebx
jne 0x1009924
push 2
lea esi, [ebp - 0x328]
pop ebx
push 0
push ebx
push esi
push dword [0x10115a0]
call dword [sym.imp.WSOCK32.dll_recv]
mov edi, eax
test edi, edi
je 0x10097f6
sub ebx, edi
add esi, edi
test ebx, ebx
jg 0x10097d8
cmp edi, 0xffffffff
je 0x1009950
cmp edi, 2
jb 0x1009950
push dword [ebp - 0x328]
call dword [sym.imp.WSOCK32.dll_htons]
movzx eax, ax
mov dword [ebp - 0x310], eax
test ax, ax
je 0x100995a
movzx ecx, ax
mov eax, dword [0x101668c]
cmp ecx, eax
jle 0x100985c
test eax, eax
je 0x1009843
push dword [0x1016688]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
movzx eax, word [ebp - 0x310]
push eax
mov dword [0x101668c], eax
call dword [sym.imp.msvcrt.dll_malloc]
pop ecx
mov dword [0x1016688], eax
movzx esi, word [ebp - 0x310]
mov ebx, dword [0x1016688]
jmp 0x1009885
push 0
push esi
push ebx
push dword [0x10115a0]
call dword [sym.imp.WSOCK32.dll_recv]
mov edi, eax
test edi, edi
jle 0x1009889
add ebx, edi
sub esi, edi
test esi, esi
jg 0x100986b
cmp edi, 0xffffffff
je 0x1009938
lea eax, [ebp - 0x318]
push eax
lea eax, [ebp - 0x30c]
push eax
push dword [ebp - 0x324]
push dword [ebp + 8]
push ebx
push dword [0x1016688]
push dword [0x101ad00]
call fcn.010088ed
mov dword [ebp - 0x320], eax
test eax, eax
jne 0x1009944
cmp dword [ebp - 0x308], eax
je 0x100990c
mov eax, dword [ebp - 0x30c]
mov ecx, eax
sub ecx, dword [ebp - 0x31c]
cmp ecx, 0x32
jle 0x100990c
mov dword [ebp - 0x31c], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push 0x1002114
push eax
call dword [sym.imp.msvcrt.dll_fprintf]
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call dword [sym.imp.msvcrt.dll_fflush]
add esp, 0xc
cmp dword [ebp - 0x318], 2
jge 0x100995a
cmp dword [0x101665c], 0
je 0x10097cf
xor ebx, ebx
push 0x1001a78
mov dword [0x101665c], ebx
call dword [sym.imp.msvcrt.dll_printf]
pop ecx
jmp 0x100995c
mov dword [ebp - 0x314], 2
jmp 0x100995a
mov dword [ebp - 0x314], 3
jmp 0x100995a
mov dword [ebp - 0x314], 1
xor ebx, ebx
cmp dword [ebp - 0x308], ebx
je 0x100999b
cmp dword [ebp - 0x30c], 1
mov eax, 0x1001253
mov ecx, 0x1002110
jne 0x1009979
mov ecx, eax
cmp dword [ebp - 0x30c], 0x32
jl 0x1009987
mov eax, 0x1001a78
push ecx
push dword [ebp - 0x30c]
push eax
push 0x21
push 1
call fcn.0100bd21
add esp, 0x14
push dword [0x10115a0]
call dword [sym.imp.WSOCK32.dll_closesocket]
or dword [0x10115a0], 0xffffffff
cmp dword [ebp - 0x308], ebx
je 0x10099cd
mov eax, dword [0x101ad00]
cmp eax, ebx
je 0x10099cd
push eax
call dword [sym.imp.msvcrt.dll_fclose]
pop ecx
mov dword [0x101ad00], ebx
mov eax, dword [ebp - 0x314]
sub eax, ebx
je 0x1009a4b
dec eax
je 0x1009a43
dec eax
je 0x10099eb
dec eax
jne 0x1009a43
mov eax, dword [ebp - 0x320]
jmp 0x10096c2
mov esi, dword [0x1016688]
push 0xd0
push 2
call fcn.0100bd21
movzx eax, word [esi + 0xa]
mov edi, dword [sym.imp.WSOCK32.dll_ntohs]
pop ecx
pop ecx
push eax
call edi
movzx eax, ax
push eax
movzx eax, word [esi + 8]
push eax
call edi
movzx eax, ax
push eax
movzx eax, word [esi + 6]
push eax
call edi
movzx eax, ax
push eax
movzx eax, byte [esi + 3]
and eax, 0xf
push dword [eax*4 + 0x1011928]
push 0xd1
push 2
call fcn.0100bd21
add esp, 0x18
push 0xfffffffffffffffd
pop eax
jmp 0x10096c2
xor eax, eax
jmp 0x10096c2
push 0x1002104
jmp 0x10096a3