Function at 0x40d66f
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x418
mov eax, dword [ebp + 8]
push ebx
and dword [ebp - 4], 0
push esi
mov esi, dword [ebp + 0x14]
mov ebx, dword [eax]
push edi
push 2
mov ax, word [esi + 6]
pop edi
push eax
mov dword [ebp + 8], ebx
mov word [ebp - 0x18], di
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x16], ax
mov eax, dword [esi + 2]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x18]
push 0x10
push eax
push ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40d6c2
mov eax, 0xfffffc18
jmp 0x40d91c
mov eax, dword [ebp - 4]
mov byte [ebp + eax - 0x418], 5
inc eax
mov byte [ebp + eax - 0x418], 2
and byte [ebp + eax - 0x417], 0
inc eax
inc eax
mov byte [ebp + eax - 0x418], 2
inc eax
mov dword [ebp - 4], eax
push eax
lea eax, [ebp - 0x418]
push eax
push ebx
call fcn.0040c6c2
add esp, 0xc
test eax, eax
jne 0x40d70b
mov eax, 0xfffffc19
jmp 0x40d91c
push 0x400
lea eax, [ebp - 0x418]
push 0
push eax
call sub.MSVCRT.dll_memset
lea eax, [ebp - 4]
push 0
push eax
lea eax, [ebp - 0x418]
push eax
push ebx
mov dword [ebp - 4], edi
call fcn.0040c6e8
add esp, 0x1c
test eax, eax
je 0x40d917
cmp byte [ebp - 0x418], 5
jne 0x40d917
cmp byte [ebp - 0x417], 2
je 0x40d767
cmp byte [ebp - 0x417], 0
jne 0x40d917
jmp 0x40d85a
lea eax, [esi + 8]
push eax
mov dword [ebp - 8], eax
call sub.MSVCRT.dll_strlen
mov ebx, eax
mov esi, 0xff
cmp ebx, esi
pop ecx
mov byte [ebp - 0x418], 1
jle 0x40d788
mov ebx, esi
push ebx
lea eax, [ebp - 0x416]
push dword [ebp - 8]
mov dword [ebp - 4], edi
mov edi, dword [sym.imp.MSVCRT.dll_strncpy]
mov byte [ebp - 0x417], bl
push eax
call edi
mov eax, dword [ebp + 0x14]
add dword [ebp - 4], ebx
add eax, 0x108
push eax
mov dword [ebp + 0x14], eax
call sub.MSVCRT.dll_strlen
mov ebx, eax
add esp, 0x10
cmp ebx, esi
jle 0x40d7c3
mov ebx, esi
mov eax, dword [ebp - 4]
push ebx
push dword [ebp + 0x14]
mov byte [ebp + eax - 0x418], bl
inc eax
mov dword [ebp - 4], eax
lea eax, [ebp + eax - 0x418]
push eax
call edi
add dword [ebp - 4], ebx
push dword [ebp - 4]
lea eax, [ebp - 0x418]
push eax
push dword [ebp + 8]
call fcn.0040c6c2
add esp, 0x18
test eax, eax
jne 0x40d805
mov eax, 0xfffffc1b
jmp 0x40d91c
push 0x400
lea eax, [ebp - 0x418]
push 0
push eax
call sub.MSVCRT.dll_memset
lea eax, [ebp - 4]
push 0
push eax
lea eax, [ebp - 0x418]
push eax
mov dword [ebp - 4], 2
push dword [ebp + 8]
call fcn.0040c6e8
add esp, 0x1c
test eax, eax
je 0x40d84d
cmp byte [ebp - 0x418], 1
jne 0x40d84d
cmp byte [ebp - 0x417], 0
je 0x40d857
mov eax, 0xfffffc1c
jmp 0x40d91c
push 2
pop edi
mov esi, dword [ebp + 0xc]
push 4
and byte [ebp - 0x416], 0
pop ebx
lea eax, [esi + 4]
push ebx
push eax
lea eax, [ebp - 0x414]
push eax
mov byte [ebp - 0x418], 5
mov byte [ebp - 0x417], 1
mov byte [ebp - 0x415], 1
mov dword [ebp - 4], ebx
call sub.MSVCRT.dll_memcpy
add dword [ebp - 4], ebx
mov eax, dword [ebp - 4]
add esi, 2
push edi
lea eax, [ebp + eax - 0x418]
push esi
push eax
call sub.MSVCRT.dll_memcpy
add dword [ebp - 4], edi
push dword [ebp - 4]
lea eax, [ebp - 0x418]
push eax
push dword [ebp + 8]
call fcn.0040c6c2
add esp, 0x24
test eax, eax
jne 0x40d8cb
mov eax, 0xfffffc1d
jmp 0x40d91c
mov esi, 0x400
lea eax, [ebp - 0x418]
push esi
push 0
push eax
call sub.MSVCRT.dll_memset
lea eax, [ebp - 4]
push 0
push eax
lea eax, [ebp - 0x418]
push eax
mov dword [ebp - 4], esi
push dword [ebp + 8]
call fcn.0040c6e8
add esp, 0x1c
cmp byte [ebp - 0x418], 5
jne 0x40d910
cmp byte [ebp - 0x417], 0
jne 0x40d910
xor eax, eax
jmp 0x40d91c
mov eax, 0xfffffc1e
jmp 0x40d91c
mov eax, 0xfffffc1a
pop edi
pop esi
pop ebx
leave
ret