Function at 0x404bc9
Capabilities:
Connect socket
Get socket status
Resolve dns
Resolve function by parsing pe exports
Set socket configuration

Disassembly:
sub esp, 0x28c
push ebx
push edi
xor edi, edi
mov ebx, edi
cmp dword [esp + 0x298], ebx
je 0x404f85
mov ecx, dword [esp + 0x2a0]
push esi
mov esi, ecx
and esi, 0x10000000
mov dword [esp + 0x10], esi
je 0x404c05
and ecx, 0xefffffff
mov dword [esp + 0x2a4], ecx
mov eax, esi
neg eax
push 2
sbb eax, eax
and eax, 0x15
pop edx
add eax, edx
test ecx, ecx
jne 0x404c1f
inc ecx
mov dword [esp + 0x2a4], ecx
push ebp
push edi
push ecx
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x404f83
push dword [esp + 0x2a0]
call fcn.0041a9a0
mov dword [esp + 0x18], eax
push 0x17
pop edx
test esi, esi
je 0x404cbb
cmp dword [0x4d818c], ebx
je 0x404f6f
lea ecx, [esp + 0x58]
push ecx
push eax
push edx
call fcn.00404182
add esp, 0xc
test eax, eax
jg 0x404cb2
lea eax, [esp + 0x20]
push eax
push edi
push edi
push dword [esp + 0x24]
call dword [0x4d8178]
test eax, eax
jne 0x404f6f
mov eax, dword [esp + 0x20]
lea edi, [esp + 0x58]
push eax
mov dword [esp + 0x20], 1
mov esi, dword [eax + 0x18]
add esi, 8
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call dword [0x4d817c]
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x1c]
jmp 0x404ce6
mov edi, dword [esp + 0x1c]
xor eax, eax
inc eax
jmp 0x404ce6
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov edi, eax
cmp edi, 0xffffffff
jne 0x404cde
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x404cde
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov edi, dword [eax]
xor eax, eax
cmp edi, 0xffffffff
setne al
test eax, eax
je 0x404f6f
xor ecx, ecx
cmp dword [esp + 0x2b4], ebx
jne 0x404d09
mov eax, dword [esp + 0x2b0]
test eax, eax
je 0x404d5a
cmp word [eax], cx
je 0x404d5a
push 0x1c
push ecx
lea eax, [esp + 0x80]
push eax
call fcn.00401510
push 0x10
lea eax, [esp + 0x78]
push 0
push eax
call fcn.00401510
add esp, 0x18
lea eax, [esp + 0x78]
push dword [esp + 0x2b4]
push dword [esp + 0x2b4]
push eax
lea eax, [esp + 0x74]
push eax
xor eax, eax
test esi, esi
push ebp
setne al
push eax
call fcn.00419134
test eax, eax
je 0x404f6f
xor ecx, ecx
test esi, esi
je 0x404d9c
push 0x1c
push ecx
lea eax, [esp + 0x44]
push eax
call fcn.00401510
add esp, 0xc
push 0x17
pop eax
mov word [esp + 0x3c], ax
movzx eax, word [esp + 0x2a4]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x3e], ax
lea esi, [esp + 0x58]
lea edi, [esp + 0x44]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x14]
jmp 0x404dcc
push 0x10
push ecx
lea eax, [esp + 0x2c]
push eax
call fcn.00401510
add esp, 0xc
push 2
pop eax
mov word [esp + 0x24], ax
movzx eax, word [esp + 0x2a4]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x26], ax
mov dword [esp + 0x28], edi
xor edi, edi
inc edi
cmp dword [esp + 0x2a8], edi
jne 0x404f10
cmp dword [esp + 0x2ac], ebx
jle 0x404ecc
lea eax, [esp + 0x10]
mov dword [esp + 0x10], edi
mov edi, dword [sym.imp.WS2_32.dll_ioctlsocket]
push eax
push 0x8004667e
push ebp
call edi
test eax, eax
jne 0x404f6f
test esi, esi
je 0x404e14
push 0x1c
lea eax, [esp + 0x40]
jmp 0x404e1a
push 0x10
lea eax, [esp + 0x28]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x404f6f
mov ecx, dword [esp + 0x2ac]
xor eax, eax
inc eax
mov dword [esp + 0x98], ebp
mov dword [esp + 0x94], eax
xor edx, edx
mov dword [esp + 0x198], eax
mov esi, 0x3e8
mov eax, ecx
mov dword [esp + 0x19c], ebp
div esi
mov dword [esp + 0x34], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [esp + 0x38], eax
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x19c]
push eax
lea eax, [esp + 0x9c]
push eax
push 0
lea eax, [ebp + 1]
push eax
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 1
jne 0x404ead
lea eax, [esp + 0x94]
push eax
push ebp
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404ead
xor ebx, ebx
inc ebx
and dword [esp + 0x10], 0
lea eax, [esp + 0x10]
push eax
push 0x8004667e
push ebp
call edi
test ebx, ebx
je 0x404f6f
xor edi, edi
inc edi
jmp 0x404eef
test esi, esi
je 0x404ed8
push 0x1c
lea eax, [esp + 0x40]
jmp 0x404ede
push 0x10
lea eax, [esp + 0x28]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x404f6f
push 0x10
push 0
push dword [0x4d7b78]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x404f6f
and dword [ebx + 0xc], 0
mov dword [ebx], edi
mov dword [ebx + 8], ebp
jmp 0x404f6f
lea eax, [esp + 0x10]
mov dword [esp + 0x10], edi
push eax
push 0x8004667e
push ebp
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
jne 0x404f6f
push 0x38
push eax
push dword [0x4d7b78]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x404f6f
lea edi, [ebx + 4]
push 2
pop eax
mov dword [ebx], eax
test esi, esi
je 0x404f55
push 7
pop ecx
lea esi, [esp + 0x3c]
rep movsd dword es:[edi], dword [esi]
jmp 0x404f5d
lea esi, [esp + 0x24]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
cmp dword [esp + 0x14], 0
mov dword [ebx + 0x28], ebp
setne al
and dword [ebx + 0x24], 0
mov byte [ebx + 0x20], al
push dword [esp + 0x18]
call fcn.00415e30
test ebx, ebx
jne 0x404f83
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
pop ebp
pop esi
pop edi
mov eax, ebx
pop ebx
add esp, 0x28c
ret 0x18