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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x42ed01
mov eax, dword fs:[0]
push eax
sub esp, 0x204
mov eax, dword [0x43a660]
xor eax, esp
mov dword [esp + 0x1fc], eax
push ebx
push esi
mov eax, dword [0x43a660]
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 0x405880
sub eax, esi
je 0x405a77
mov eax, edx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x405894
sub eax, edx
inc eax
cmp eax, 0x800
ja 0x405a77
mov ecx, edi
call fcn.004054b0
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 0x4058c8
sub eax, edx
push eax
push esi
lea ecx, [esp + 0x34]
call fcn.00401700
or eax, 0xffffffff
mov dword [esp + 0x218], ebx
cmp dword [edi + 0x2c], eax
je 0x405906
cmp dword [esp + 0x40], 0x10
jb 0x4058ff
mov eax, dword [esp + 0x2c]
push eax
call fcn.00419012
add esp, 4
mov al, 1
jmp 0x405a79
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 0x40592a
push str.WSAStartup_error
call fcn.004196b2
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 0x405a6e
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.0040b050
mov esi, dword [esp + 0x20]
cmp esi, ebx
jl 0x405a65
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x405a65
push eax
lea ecx, [esp + 0x5c]
call fcn.004012d0
lea eax, [esp + 0x58]
mov byte [esp + 0x218], 2
call fcn.00406490
test al, al
jne 0x405a5c
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 0x4059e6
lea eax, [esp + 0x58]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, ebx
je 0x405a55
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.0041ad40
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 0x405a3d
lea ecx, [esp + 0x58]
call fcn.00401310
lea esi, [esp + 0xc]
call fcn.0040b0c0
lea ecx, [esp + 0x2c]
call fcn.00401310
mov al, 1
jmp 0x405a79
jge 0x405a49
call fcn.00419970
cmp dword [eax], 0x70
jne 0x405a55
mov esi, dword [edi + 0x2c]
call fcn.00405180
test eax, eax
jg 0x405a1e
mov esi, edi
call fcn.00405b00
lea ecx, [esp + 0x58]
call fcn.00401310
lea esi, [esp + 0xc]
call fcn.0040b0c0
lea ecx, [esp + 0x2c]
call fcn.00401310
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.0041891c
mov esp, ebp
pop ebp
ret