Function at 0x40e401
Capabilities:
Connect socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x80
push ebx
push esi
xor ebx, ebx
mov esi, ecx
cmp dword [esi + 4], ebx
push edi
mov dword [ebp - 8], ebx
mov dword [ebp - 0x18], 1
je 0x40e75b
cmp dword [esi + 8], ebx
je 0x40e75b
mov edi, dword [ebp + 0xc]
push edi
call fcn.0040e3db
test eax, eax
pop ecx
je 0x40e45f
push 0xa
lea eax, [ebp + 0xc]
push eax
push edi
call dword [sym.imp.MSVCRT.dll_strtol]
add esp, 0xc
cmp dword [ebp + 0xc], edi
je 0x40e754
push eax
call sub.WSOCK32.dll_htons
mov dword [ebp - 0xc], eax
jmp 0x40e47a
push 0x417ac4
push edi
call sub.WSOCK32.dll_getservbyname
cmp eax, ebx
je 0x40e73a
mov ax, word [eax + 8]
mov word [ebp - 0xc], ax
push dword [ebp + 8]
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
je 0x40e49e
lea eax, [ebp - 0x14]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], eax
jmp 0x40e53e
push dword [ebp + 8]
call sub.WSOCK32.dll_gethostbyname
mov edi, eax
cmp edi, ebx
jne 0x40e4e3
cmp byte [0x421ba0], bl
je 0x40e4d9
mov al, byte [0x421278]
push dword [ebp + 8]
mov byte [ebp + 0xf], al
push str.superDebug:_Cannot_resolve_hostname___s__to_ip_address._n
mov byte [0x421278], bl
call fcn.00401292
mov al, byte [ebp + 0xf]
pop ecx
pop ecx
mov byte [0x421278], al
mov eax, 0xfa7
jmp 0x40e760
cmp byte [0x421ba0], bl
mov eax, dword [edi + 0xc]
mov dword [ebp - 4], eax
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
je 0x40e53e
mov al, byte [0x421278]
mov byte [ebp + 0xf], al
movzx eax, byte [ebp - 0x29]
push eax
movzx eax, byte [ebp - 0x2a]
push eax
movzx eax, byte [ebp - 0x2b]
push eax
movzx eax, byte [ebp - 0x2c]
push eax
push dword [ebp + 8]
mov byte [0x421278], bl
push str.superDebug:_Hostname___s__resolved_to_ip_address__u._u._u._u_n
call fcn.00401292
push dword [edi]
push str.superDebug:_Official_hostname_is__s_n
call fcn.00401292
mov al, byte [ebp + 0xf]
add esp, 0x20
mov byte [0x421278], al
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp eax, ebx
mov dword [ebp + 0xc], ebx
je 0x40e6d0
cmp byte [0x421ba0], bl
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
je 0x40e592
mov al, byte [0x421278]
mov byte [ebp + 0xb], al
movzx eax, byte [ebp - 0x29]
push eax
movzx eax, byte [ebp - 0x2a]
push eax
movzx eax, byte [ebp - 0x2b]
push eax
movzx eax, byte [ebp - 0x2c]
push eax
push str.superDebug:_Attempting_to_connect_to_ip_address__u._u._u._u_n
mov byte [0x421278], bl
call fcn.00401292
mov al, byte [ebp + 0xb]
add esp, 0x14
mov byte [0x421278], al
push ebx
push 1
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi], eax
je 0x40e6bc
mov cx, word [ebp - 0xc]
push 4
mov word [ebp - 0x2e], cx
lea ecx, [ebp - 8]
push ecx
push 0xffffff7f
push 0xffff
push eax
mov word [ebp - 0x30], 2
call sub.WSOCK32.dll_setsockopt
call fcn.0040cd1d
mov edi, eax
cmp edi, ebx
je 0x40e634
push 0x10
lea eax, [ebp - 0x30]
push eax
push dword [esi]
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x40e6d0
cmp byte [0x421ba0], bl
je 0x40e624
mov al, byte [0x421278]
mov byte [ebp + 0xb], al
lea eax, [edi - 1]
push eax
mov byte [0x421278], bl
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.superDebug:_::connect___returned_error__d__retry_count_remaining_is__u_n
call fcn.00401292
mov al, byte [ebp + 0xb]
add esp, 0xc
mov byte [0x421278], al
dec edi
je 0x40e63e
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40e5d6
cmp dword [ebp + 0xc], 0xffffffff
jne 0x40e6d0
cmp byte [0x421ba0], bl
je 0x40e66e
mov al, byte [0x421278]
mov byte [ebp + 0xb], al
mov byte [0x421278], bl
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.superDebug:_Connection_returned_error__d_n
call fcn.00401292
mov al, byte [ebp + 0xb]
pop ecx
pop ecx
mov byte [0x421278], al
add dword [ebp - 4], 4
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp eax, ebx
jne 0x40e54e
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, eax
sub ecx, 0x2733
je 0x40e6d0
sub ecx, 0x19
je 0x40e6b2
dec ecx
je 0x40e6c6
push eax
lea eax, [ebp - 0x80]
push str.unexpected_error__d_from_winsock
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x80]
push eax
call fcn.0040e372
add esp, 0x10
mov eax, 0xfaf
jmp 0x40e760
mov eax, 0xfa8
jmp 0x40e760
mov eax, 0xfb1
jmp 0x40e760
mov eax, dword [0x422ae4]
mov dword [esi + 0x24], eax
lea eax, [ebp - 0x18]
push eax
push 0x8004667e
push dword [esi]
call sub.WSOCK32.dll_ioctlsocket
mov eax, dword [esi]
mov dword [esi + 0x28], ebx
mov dword [esi + 0x2c], eax
inc dword [esi + 0x28]
mov eax, dword [0x41a948]
mov dword [esi + 0x12c], eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x10]
push eax
push 0x1001
push 0xffff
push dword [esi]
mov edi, 0xfaf0
mov dword [esi + 0x130], ebx
mov dword [ebp - 0x10], edi
mov dword [ebp - 8], 4
call sub.WSOCK32.dll_getsockopt
mov eax, dword [ebp - 0x10]
cmp eax, edi
jae 0x40e736
mov dword [esi + 0x20], eax
xor eax, eax
jmp 0x40e760
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2afc
je 0x40e754
cmp eax, 0x2afb
je 0x40e754
add eax, 0xffffec78
jmp 0x40e760
mov eax, 0xfae
jmp 0x40e760
mov eax, 0xfa1
pop edi
pop esi
pop ebx
leave
ret 8