Function at 0x404670
Capabilities:
Connect socket
Initialize winsock library
Resolve dns

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x42b501
mov eax, dword fs:[0]
push eax
sub esp, 0x204
mov eax, dword [0x436650]
xor eax, esp
mov dword [esp + 0x1fc], eax
push ebx
push esi
mov eax, dword [0x436650]
xor eax, esp
push eax
lea eax, [esp + 0x210]
mov dword fs:[0], eax
mov edx, dword [edi + 0x24]
mov eax, edx
lea esi, [eax + 1]
xor ebx, ebx
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4046c0
sub eax, esi
je 0x4048b7
mov eax, edx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4046d4
sub eax, edx
inc eax
cmp eax, 0x800
ja 0x4048b7
mov ecx, edi
call fcn.004042f0
mov esi, dword [edi + 0x34]
mov eax, esi
mov dword [esp + 0x40], 0xf
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x2c], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x404708
sub eax, edx
push eax
push esi
lea ecx, [esp + 0x34]
call fcn.00403140
or eax, 0xffffffff
mov dword [esp + 0x218], ebx
cmp dword [edi + 0x2c], eax
je 0x404746
cmp dword [esp + 0x40], 0x10
jb 0x40473f
mov eax, dword [esp + 0x2c]
push eax
call fcn.0041643b
add esp, 4
mov al, 1
jmp 0x4048b9
lea ecx, [esp + 0x74]
push ecx
push 0x101
mov dword [edi + 0x2c], eax
call dword [sym.imp.WS2_32.dll_WSAStartup]
cmp eax, ebx
je 0x40476a
push str.WSAStartup_error
call fcn.00416b85
add esp, 4
push ebx
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [edi + 0x2c], eax
cmp eax, ebx
jl 0x4048ae
mov dword [esp + 0x24], ebx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], 0x50
mov dword [esp + 0x10], ebx
mov byte [esp + 0x218], 1
mov eax, dword [edi + 0x24]
lea ecx, [esp + 0xc]
call fcn.004080a0
mov esi, dword [esp + 0x20]
cmp esi, ebx
jl 0x4048a5
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x4048a5
push eax
lea ecx, [esp + 0x5c]
call fcn.00403050
lea eax, [esp + 0x58]
mov byte [esp + 0x218], 2
call fcn.00405500
test al, al
jne 0x40489c
xor eax, eax
mov edx, 2
mov dword [esp + 0x48], eax
push esi
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov word [esp + 0x4c], dx
call dword [sym.imp.WS2_32.dll_htons]
cmp dword [esp + 0x6c], 0x10
mov word [esp + 0x4a], ax
mov eax, dword [esp + 0x58]
jae 0x404826
lea eax, [esp + 0x58]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, ebx
je 0x404895
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
push ecx
push eax
lea ecx, [esp + 0x54]
push ecx
call fcn.00417fc0
mov eax, dword [edi + 0x2c]
add esp, 0xc
push 0x10
lea edx, [esp + 0x4c]
push edx
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, ebx
jne 0x40487d
lea ecx, [esp + 0x58]
call fcn.00403090
lea esi, [esp + 0xc]
call fcn.00408110
lea ecx, [esp + 0x2c]
call fcn.00403090
mov al, 1
jmp 0x4048b9
jge 0x404889
call fcn.00416e71
cmp dword [eax], 0x70
jne 0x404895
mov esi, dword [edi + 0x2c]
call fcn.00403fc0
test eax, eax
jg 0x40485e
mov esi, edi
call fcn.00404940
lea ecx, [esp + 0x58]
call fcn.00403090
lea esi, [esp + 0xc]
call fcn.00408110
lea ecx, [esp + 0x2c]
call fcn.00403090
xor al, al
mov ecx, dword [esp + 0x210]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [esp + 0x1fc]
xor ecx, esp
call fcn.0041637f
mov esp, ebp
pop ebp
ret