Function at 0x10069bb
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, 0x33c
mov eax, dword [0x100e65c]
push ebx
push esi
push 0x200
xor ebx, ebx
mov dword [ebp - 0x31c], ecx
lea ecx, [ebp - 0x314]
push ecx
push ebx
push ebx
push ebx
push 0xfc
push dword [0x100c1ac]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push eax
push ebx
mov dword [ebp - 0x33c], eax
mov dword [ebp - 0x320], ebx
mov dword [ebp - 0x330], ebx
mov dword [ebp - 0x32c], ebx
mov dword [ebp - 0x328], ebx
call fcn.01009aec
mov esi, eax
cmp esi, ebx
jge 0x1006a3f
test byte [0x100e2d8], 2
je 0x1006a37
push 0xcf
push 2
call fcn.01009110
pop ecx
pop ecx
push 0xfffffffffffffffd
pop eax
jmp 0x1006eb7
push edi
xor eax, eax
lea edi, [ebp - 0x114]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
mov ax, word [0x100e24c]
mov word [ebp - 0x114], 2
push eax
call sub.WSOCK32.dll_htons
mov word [ebp - 0x112], ax
mov eax, dword [0x100f57c]
mov ecx, dword [eax + 8]
cmp ecx, ebx
je 0x1006a7a
mov eax, dword [ecx]
jmp 0x1006a84
mov eax, dword [eax + 0x14]
mov eax, dword [eax]
mov eax, dword [eax + 8]
mov eax, dword [eax]
mov eax, dword [eax]
push ebx
push 1
push 2
mov dword [ebp - 0x110], eax
call sub.WSOCK32.dll_socket
or edi, 0xffffffff
cmp eax, edi
mov dword [0x100df2c], eax
jne 0x1006ab3
push 0x1001fb0
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
jmp 0x1006eb3
push 0x10
lea ecx, [ebp - 0x114]
push ecx
push eax
call sub.WSOCK32.dll_connect
cmp eax, edi
jne 0x1006b00
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 0x274d
jne 0x1006ad8
push 0xfffffffffffffffb
jmp 0x1006ae6
push 0x1001fa4
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
push 0xfffffffffffffffd
pop esi
push dword [0x100df2c]
call sub.WSOCK32.dll_closesocket
or dword [0x100df2c], 0xffffffff
mov eax, esi
jmp 0x1006eb6
push esi
call sub.WSOCK32.dll_htons
push ebx
push 2
mov dword [ebp - 0x324], eax
lea eax, [ebp - 0x324]
push eax
push dword [0x100df2c]
call sub.WSOCK32.dll_send
cmp eax, edi
je 0x1006e96
push ebx
push esi
lea eax, [ebp - 0x314]
push eax
push dword [0x100df2c]
call sub.WSOCK32.dll_send
cmp eax, edi
je 0x1006e96
mov eax, dword [0x100f57c]
cmp dword [eax + 8], ebx
jne 0x1006b54
mov eax, dword [eax + 0x14]
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, 0x1001f9c
add eax, 0x20
push esi
push eax
call edi
add esp, 0xc
cmp dword [ebp - 0x31c], ebx
jne 0x1006b8b
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
mov dword [0x10373c4], eax
jmp 0x1006d52
lea eax, [ebp - 0x104]
push eax
push dword [ebp - 0x31c]
call fcn.0100714e
cmp eax, ebx
mov dword [0x10373c4], eax
jne 0x1006bbe
lea eax, [ebp - 0x104]
push eax
push 0xc
push 2
call fcn.01009110
add esp, 0xc
jmp 0x1006ae4
push dword [ebp - 0x31c]
push 0x1001218
push eax
call edi
mov eax, dword [0x100f57c]
add esp, 0xc
cmp dword [eax + 8], ebx
jne 0x1006bde
mov eax, dword [eax + 0x14]
mov eax, dword [eax]
mov eax, dword [eax]
push eax
push esi
push dword [0x10373c4]
call edi
add esp, 0xc
jmp 0x1006d52
lea esi, [ebp - 0x334]
mov dword [ebp - 0x318], 2
push ebx
push dword [ebp - 0x318]
push esi
push dword [0x100df2c]
call sub.WSOCK32.dll_recv
mov edi, eax
cmp edi, ebx
je 0x1006c2b
sub dword [ebp - 0x318], edi
add esi, edi
cmp dword [ebp - 0x318], ebx
jg 0x1006c02
cmp edi, 0xffffffff
je 0x1006d72
push dword [ebp - 0x334]
call sub.WSOCK32.dll_htons
cmp ax, bx
mov dword [ebp - 0x324], eax
je 0x1006d94
movzx ecx, ax
mov eax, dword [0x100f588]
cmp ecx, eax
jle 0x1006c84
cmp eax, ebx
je 0x1006c6b
push dword [0x100f584]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
movzx eax, word [ebp - 0x324]
push eax
mov dword [0x100f588], eax
call dword [sym.imp.msvcrt.dll_malloc]
pop ecx
mov dword [0x100f584], eax
mov eax, dword [0x100f584]
movzx esi, word [ebp - 0x324]
mov dword [ebp - 0x318], eax
jmp 0x1006cb9
push ebx
push esi
push dword [ebp - 0x318]
push dword [0x100df2c]
call sub.WSOCK32.dll_recv
mov edi, eax
cmp edi, ebx
jle 0x1006cbd
add dword [ebp - 0x318], edi
sub esi, edi
cmp esi, ebx
jg 0x1006c98
cmp edi, 0xffffffff
je 0x1006d7e
lea eax, [ebp - 0x32c]
push eax
lea eax, [ebp - 0x320]
push eax
push dword [ebp - 0x33c]
push dword [ebp + 8]
push dword [ebp - 0x318]
push dword [0x100f584]
push dword [0x10373c4]
call fcn.01005f88
cmp eax, ebx
mov dword [ebp - 0x338], eax
jne 0x1006d8a
cmp dword [ebp - 0x31c], ebx
je 0x1006d49
mov eax, dword [ebp - 0x320]
mov ecx, eax
sub ecx, dword [ebp - 0x330]
cmp ecx, 0x32
jle 0x1006d49
mov dword [ebp - 0x330], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push 0x1001f98
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 - 0x32c], 2
jge 0x1006d94
cmp dword [0x100f580], ebx
je 0x1006bf2
push 0x1001938
mov dword [0x100f580], ebx
call dword [sym.imp.msvcrt.dll_printf]
pop ecx
jmp 0x1006d94
mov dword [ebp - 0x328], 1
jmp 0x1006d94
mov dword [ebp - 0x328], 2
jmp 0x1006d94
mov dword [ebp - 0x328], 3
cmp dword [ebp - 0x31c], ebx
je 0x1006dd3
cmp dword [ebp - 0x320], 1
mov eax, 0x10011ef
mov ecx, 0x1001f94
jne 0x1006db1
mov ecx, eax
cmp dword [ebp - 0x320], 0x32
jl 0x1006dbf
mov eax, 0x1001938
push ecx
push dword [ebp - 0x320]
push eax
push 0x21
push 1
call fcn.01009110
add esp, 0x14
push dword [0x100df2c]
call sub.WSOCK32.dll_closesocket
or dword [0x100df2c], 0xffffffff
cmp dword [ebp - 0x31c], ebx
je 0x1006e04
mov eax, dword [0x10373c4]
cmp eax, ebx
je 0x1006e04
push eax
call dword [sym.imp.msvcrt.dll_fclose]
pop ecx
mov dword [0x10373c4], ebx
mov eax, dword [ebp - 0x328]
sub eax, ebx
je 0x1006e92
dec eax
je 0x1006eb3
dec eax
je 0x1006e2e
dec eax
jne 0x1006eb3
mov eax, dword [ebp - 0x338]
jmp 0x1006eb6
mov esi, dword [0x100f584]
push 0xd2
push 2
call fcn.01009110
xor eax, eax
mov ax, word [esi + 0xa]
pop ecx
pop ecx
push eax
call sub.WSOCK32.dll_ntohs
movzx eax, ax
push eax
xor eax, eax
mov ax, word [esi + 8]
push eax
call sub.WSOCK32.dll_ntohs
movzx eax, ax
push eax
xor eax, eax
mov ax, word [esi + 6]
push eax
call sub.WSOCK32.dll_ntohs
movzx eax, ax
push eax
xor eax, eax
mov al, byte [esi + 3]
and eax, 0xf
push dword [eax*4 + 0x100e290]
push 0xd3
push 2
call fcn.01009110
add esp, 0x18
jmp 0x1006eb3
xor eax, eax
jmp 0x1006eb6
push 0x1001f88
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
push dword [0x100df2c]
call sub.WSOCK32.dll_closesocket
mov dword [0x100df2c], edi
push 0xfffffffffffffffd
pop eax
pop edi
mov ecx, dword [ebp - 4]
pop esi
pop ebx
call fcn.01009d42
leave
ret 8