Function at 0x40fbeb
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 0x40ff45
cmp dword [esi + 8], ebx
je 0x40ff45
mov edi, dword [ebp + 0xc]
push edi
call fcn.0040fbc5
test eax, eax
pop ecx
je 0x40fc49
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 0x40ff3e
push eax
call sub.WSOCK32.dll_htons
mov dword [ebp - 0xc], eax
jmp 0x40fc64
push 0x41946c
push edi
call sub.WSOCK32.dll_getservbyname
cmp eax, ebx
je 0x40ff24
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 0x40fc88
lea eax, [ebp - 0x14]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], eax
jmp 0x40fd28
push dword [ebp + 8]
call sub.WSOCK32.dll_gethostbyname
mov edi, eax
cmp edi, ebx
jne 0x40fccd
cmp byte [0x42434c], bl
je 0x40fcc3
mov al, byte [0x423710]
push dword [ebp + 8]
mov byte [ebp + 0xf], al
push str.superDebug:_Cannot_resolve_hostname___s__to_ip_address._n
mov byte [0x423710], bl
call fcn.00401292
mov al, byte [ebp + 0xf]
pop ecx
pop ecx
mov byte [0x423710], al
mov eax, 0xfa7
jmp 0x40ff4a
cmp byte [0x42434c], 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 0x40fd28
mov al, byte [0x423710]
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 [0x423710], 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 [0x423710], al
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp eax, ebx
mov dword [ebp + 0xc], ebx
je 0x40feba
cmp byte [0x42434c], bl
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
je 0x40fd7c
mov al, byte [0x423710]
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 [0x423710], bl
call fcn.00401292
mov al, byte [ebp + 0xb]
add esp, 0x14
mov byte [0x423710], al
push ebx
push 1
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi], eax
je 0x40fea6
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.0040deb4
mov edi, eax
cmp edi, ebx
je 0x40fe1e
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 0x40feba
cmp byte [0x42434c], bl
je 0x40fe0e
mov al, byte [0x423710]
mov byte [ebp + 0xb], al
lea eax, [edi - 1]
push eax
mov byte [0x423710], 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 [0x423710], al
dec edi
je 0x40fe28
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40fdc0
cmp dword [ebp + 0xc], 0xffffffff
jne 0x40feba
cmp byte [0x42434c], bl
je 0x40fe58
mov al, byte [0x423710]
mov byte [ebp + 0xb], al
mov byte [0x423710], 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 [0x423710], al
add dword [ebp - 4], 4
mov eax, dword [ebp - 4]
mov eax, dword [eax]
cmp eax, ebx
jne 0x40fd38
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, eax
sub ecx, 0x2733
je 0x40feba
sub ecx, 0x19
je 0x40fe9c
dec ecx
je 0x40feb0
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.0040fb5c
add esp, 0x10
mov eax, 0xfaf
jmp 0x40ff4a
mov eax, 0xfa8
jmp 0x40ff4a
mov eax, 0xfb1
jmp 0x40ff4a
mov eax, dword [0x425290]
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 [0x41cbdc]
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 0x40ff20
mov dword [esi + 0x20], eax
xor eax, eax
jmp 0x40ff4a
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2afc
je 0x40ff3e
cmp eax, 0x2afb
je 0x40ff3e
add eax, 0xffffec78
jmp 0x40ff4a
mov eax, 0xfae
jmp 0x40ff4a
mov eax, 0xfa1
pop edi
pop esi
pop ebx
leave
ret 8