Function at 0x407b08
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, 0x338
mov eax, dword [0x40e2a4]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor esi, esi
mov dword [ebp - 0x31c], eax
push 0x100
lea eax, [ebp - 0x10c]
mov dword [ebp - 0x338], ecx
mov ebx, edx
mov dword [ebp - 0x314], esi
push esi
push eax
mov dword [ebp - 0x334], ebx
mov dword [ebp - 0x324], esi
mov dword [ebp - 0x32c], esi
mov dword [ebp - 0x328], esi
call sub.msvcrt.dll_memset
add esp, 0xc
mov dword [ebp - 0x320], esi
lea eax, [ebp - 0x30c]
mov edx, 0xfc
mov ecx, ebx
push dword [0x40e3bc]
push 0x200
push eax
call fcn.0040ab3a
mov ebx, eax
test ebx, ebx
jns 0x407bac
test byte [0x40e3c8], 2
je 0x408019
push 0xcd
push 2
call fcn.0040b547
pop ecx
jmp 0x407c00
mov eax, dword [0x411bf0]
mov edi, dword [eax + 8]
test edi, edi
jne 0x407bc0
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov edi, dword [eax + 8]
add edi, 0x20
mov ecx, 0x3500
push 2
pop edx
movzx eax, word [edi]
cmp ax, dx
jne 0x407bd7
mov word [edi + 2], cx
cmp eax, 0x17
jne 0x407be0
mov word [edi + 2], cx
push 0
push 1
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [0x40e2b0], eax
cmp eax, 0xffffffff
jne 0x407c06
push 0x403184
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
jmp 0x408019
push dword [edi + 0x20]
push edi
push eax
call dword [sym.imp.WS2_32.dll_connect]
or edi, 0xffffffff
cmp eax, edi
jne 0x407c3d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x274d
jne 0x407c2c
push 0xfffffffffffffffb
jmp 0x407cf6
push 0x403190
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
jmp 0x407cf4
push ebx
call dword [sym.imp.WS2_32.dll_htons]
push 0
mov word [ebp - 0x310], ax
lea eax, [ebp - 0x310]
push 2
push eax
push dword [0x40e2b0]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, edi
je 0x407ffb
push 0
push ebx
lea eax, [ebp - 0x30c]
push eax
push dword [0x40e2b0]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, edi
je 0x407ffb
mov ecx, dword [0x411bf0]
cmp dword [ecx + 8], esi
jne 0x407c98
mov eax, dword [ecx + 0xc]
mov ecx, dword [eax]
push dword [ecx]
push 0x4031a8
push 1
call fcn.0040cd89
pop ecx
push eax
call dword [sym.imp.msvcrt.dll_fprintf]
mov ebx, dword [ebp - 0x31c]
add esp, 0xc
test ebx, ebx
jne 0x407cca
push 1
call fcn.0040cd89
pop ecx
mov dword [0x4122e0], eax
jmp 0x407d46
push ecx
lea edx, [ebp - 0x10c]
mov ecx, ebx
call fcn.0040b81c
mov dword [0x4122e0], eax
test eax, eax
jne 0x407d10
lea eax, [ebp - 0x10c]
push eax
push 0xc
push 2
call fcn.0040b547
add esp, 0xc
push 0xfffffffffffffffd
pop esi
push dword [0x40e2b0]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [0x40e2b0], edi
mov eax, esi
jmp 0x40801c
push ebx
push 0x4031b0
push eax
call dword [sym.imp.msvcrt.dll_fprintf]
mov ecx, dword [0x411bf0]
add esp, 0xc
cmp dword [ecx + 8], esi
jne 0x407d30
mov eax, dword [ecx + 0xc]
mov ecx, dword [eax]
push dword [ecx]
push 0x4031a8
push dword [0x4122e0]
call dword [sym.imp.msvcrt.dll_fprintf]
add esp, 0xc
mov ebx, 0x4028a4
cmp dword [0x411bf4], esi
jne 0x407ed7
push 2
lea esi, [ebp - 0x330]
pop ebx
push 0
push ebx
push esi
push dword [0x40e2b0]
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test edi, edi
je 0x407d7e
sub ebx, edi
add esi, edi
test ebx, ebx
jg 0x407d60
mov esi, dword [ebp - 0x320]
cmp edi, 0xffffffff
je 0x407f8f
cmp edi, 2
jb 0x407f8f
push dword [ebp - 0x330]
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x310], ax
test ax, ax
je 0x407eeb
mov ecx, dword [0x411bec]
movzx ebx, ax
cmp ebx, ecx
jle 0x407def
test ecx, ecx
je 0x407dd7
push dword [0x411be8]
call dword [sym.imp.msvcrt.dll_free]
mov ax, word [ebp - 0x310]
pop ecx
movzx ebx, ax
push ebx
mov dword [0x411bec], ebx
call dword [sym.imp.msvcrt.dll_malloc]
pop ecx
mov dword [0x411be8], eax
jmp 0x407df4
mov eax, dword [0x411be8]
mov ecx, eax
mov dword [ebp - 0x318], ecx
test ebx, ebx
je 0x407e37
mov esi, eax
push 0
push ebx
push esi
push dword [0x40e2b0]
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test edi, edi
jle 0x407e20
sub ebx, edi
add esi, edi
test ebx, ebx
jg 0x407e02
mov eax, dword [0x411be8]
mov dword [ebp - 0x318], esi
mov esi, dword [ebp - 0x320]
mov ecx, dword [ebp - 0x318]
cmp edi, 0xffffffff
je 0x407f88
lea edx, [ebp - 0x328]
push edx
lea edx, [ebp - 0x314]
push edx
push dword [ebp - 0x334]
mov edx, eax
push dword [ebp - 0x338]
push ecx
mov ecx, dword [0x4122e0]
call fcn.0040802d
mov dword [ebp - 0x32c], eax
test eax, eax
jne 0x407ee8
cmp dword [ebp - 0x31c], eax
je 0x407ebc
mov ecx, dword [ebp - 0x314]
sub ecx, dword [ebp - 0x324]
cmp ecx, 0x32
jle 0x407ebc
mov eax, dword [ebp - 0x314]
push 0x4031b8
push 1
mov dword [ebp - 0x324], eax
call fcn.0040cd89
pop ecx
push eax
call dword [sym.imp.msvcrt.dll_fprintf]
push 1
call fcn.0040cd89
push eax
call dword [sym.imp.msvcrt.dll_fflush]
add esp, 0x10
cmp dword [ebp - 0x328], 2
jge 0x407eeb
cmp dword [0x411bf4], 0
je 0x407d57
mov ebx, 0x4028a4
and dword [0x411bf4], 0
push ebx
call dword [sym.imp.msvcrt.dll_printf]
pop ecx
jmp 0x407ef0
push 3
pop esi
mov ebx, 0x4028a4
mov edi, dword [ebp - 0x31c]
test edi, edi
je 0x407f2e
cmp dword [ebp - 0x314], 1
mov ecx, 0x4026d4
mov eax, 0x4031bc
jne 0x407f0f
mov eax, ecx
cmp dword [ebp - 0x314], 0x32
jge 0x407f1a
mov ebx, ecx
push eax
push dword [ebp - 0x314]
push ebx
push 0x21
push 1
call fcn.0040b547
add esp, 0x14
push dword [0x40e2b0]
call dword [sym.imp.WS2_32.dll_closesocket]
or dword [0x40e2b0], 0xffffffff
test edi, edi
je 0x407f5d
mov eax, dword [0x4122e0]
test eax, eax
je 0x407f5d
push eax
call dword [sym.imp.msvcrt.dll_fclose]
and dword [0x4122e0], 0
pop ecx
sub esi, 0
je 0x407ff7
sub esi, 1
je 0x408019
sub esi, 1
je 0x407f97
sub esi, 1
jne 0x408019
mov eax, dword [ebp - 0x32c]
jmp 0x40801c
push 2
jmp 0x407eea
xor esi, esi
inc esi
jmp 0x407eeb
mov esi, dword [0x411be8]
push 0xd0
push 2
call fcn.0040b547
movzx eax, word [esi + 0xa]
pop ecx
pop ecx
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
movzx eax, word [esi + 8]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
movzx eax, word [esi + 6]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
movzx eax, byte [esi + 3]
and eax, 0xf
push dword [eax*4 + 0x401050]
push 0xd1
push 2
call fcn.0040b547
add esp, 0x18
jmp 0x408019
xor eax, eax
jmp 0x40801c
push 0x40319c
call dword [sym.imp.msvcrt.dll_perror]
pop ecx
push dword [0x40e2b0]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [0x40e2b0], edi
push 0xfffffffffffffffd
pop eax
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040c870
leave
ret 4