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

Disassembly:
sub esp, 0x290
push ebx
push edi
xor edi, edi
mov ebx, edi
cmp dword [esp + 0x29c], ebx
je 0x499c1f
mov ecx, dword [esp + 0x2a4]
push ebp
push esi
mov esi, dword [esp + 0x2ac]
and ecx, 0xefffffff
push 0x17
pop eax
push 2
and esi, 0x10000000
pop edx
test esi, esi
mov dword [esp + 0x14], esi
push edi
cmove ecx, dword [esp + 0x2b0]
cmove eax, edx
xor edx, edx
inc edx
test ecx, ecx
cmove ecx, edx
push ecx
push eax
mov dword [esp + 0x30], ecx
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x499c1d
push dword [esp + 0x2a4]
call fcn.00537b00
mov dword [esp + 0x18], eax
test esi, esi
je 0x499958
cmp dword [0x5adce4], ebx
je 0x499c09
lea ecx, [esp + 0x5c]
push ecx
push eax
push 0x17
call fcn.004997e7
add esp, 0xc
test eax, eax
jg 0x49994f
lea eax, [esp + 0x20]
push eax
push edi
push edi
push dword [esp + 0x24]
call dword [0x5adcd0]
test eax, eax
jne 0x499c09
mov eax, dword [esp + 0x20]
lea edi, [esp + 0x5c]
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 [0x5adcd4]
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x1c]
jmp 0x499983
mov edi, dword [esp + 0x1c]
xor eax, eax
inc eax
jmp 0x499983
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov edi, eax
cmp edi, 0xffffffff
jne 0x49997b
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x49997b
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 0x499c09
xor ecx, ecx
cmp dword [esp + 0x2b8], ebx
jne 0x4999a6
mov eax, dword [esp + 0x2b4]
test eax, eax
je 0x4999f7
cmp word [eax], cx
je 0x4999f7
push 0x1c
push ecx
lea eax, [esp + 0x84]
push eax
call fcn.0045cb60
push 0x10
lea eax, [esp + 0x7c]
push 0
push eax
call fcn.0045cb60
add esp, 0x18
lea eax, [esp + 0x7c]
push dword [esp + 0x2b8]
push dword [esp + 0x2b8]
push eax
lea eax, [esp + 0x78]
push eax
xor eax, eax
test esi, esi
push ebp
setne al
push eax
call fcn.00499d1a
test eax, eax
je 0x499c09
xor ecx, ecx
test esi, esi
je 0x499a39
push 0x1c
push ecx
lea eax, [esp + 0x48]
push eax
call fcn.0045cb60
add esp, 0xc
push 0x17
pop eax
mov word [esp + 0x40], ax
movzx eax, word [esp + 0x2a8]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x42], ax
lea esi, [esp + 0x5c]
lea edi, [esp + 0x48]
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 0x499a69
push 0x10
push ecx
lea eax, [esp + 0x30]
push eax
call fcn.0045cb60
add esp, 0xc
push 2
pop eax
mov word [esp + 0x28], ax
movzx eax, word [esp + 0x2a8]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x2a], ax
mov dword [esp + 0x2c], edi
xor edi, edi
inc edi
cmp dword [esp + 0x24], edi
jne 0x499baa
cmp dword [esp + 0x2b0], ebx
jle 0x499b66
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 0x499c09
test esi, esi
je 0x499aae
push 0x1c
lea eax, [esp + 0x44]
jmp 0x499ab4
push 0x10
lea eax, [esp + 0x2c]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x499c09
mov ecx, dword [esp + 0x2b0]
xor eax, eax
inc eax
mov dword [esp + 0x9c], ebp
mov dword [esp + 0x98], eax
xor edx, edx
mov dword [esp + 0x19c], eax
mov esi, 0x3e8
mov eax, ecx
mov dword [esp + 0x1a0], ebp
div esi
mov dword [esp + 0x38], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x1a0]
push eax
lea eax, [esp + 0xa0]
push eax
push 0
lea eax, [ebp + 1]
push eax
call dword [sym.imp.WS2_32.dll_select]
xor esi, esi
inc esi
cmp eax, esi
jne 0x499b47
lea eax, [esp + 0x98]
push eax
push ebp
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
cmovne ebx, esi
and dword [esp + 0x10], 0
lea eax, [esp + 0x10]
push eax
push 0x8004667e
push ebp
call edi
test ebx, ebx
je 0x499c09
xor edi, edi
inc edi
jmp 0x499b89
test esi, esi
je 0x499b72
push 0x1c
lea eax, [esp + 0x44]
jmp 0x499b78
push 0x10
lea eax, [esp + 0x2c]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x499c09
push 0x10
push 0
push dword [0x5acc94]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x499c09
and dword [ebx + 0xc], 0
mov dword [ebx], edi
mov dword [ebx + 8], ebp
jmp 0x499c09
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 0x499c09
push 0x38
push eax
push dword [0x5acc94]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x499c09
lea edi, [ebx + 4]
push 2
pop eax
mov dword [ebx], eax
test esi, esi
je 0x499bef
push 7
pop ecx
lea esi, [esp + 0x40]
rep movsd dword es:[edi], dword [esi]
jmp 0x499bf7
lea esi, [esp + 0x28]
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.00537af0
test ebx, ebx
jne 0x499c1d
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
pop esi
pop ebp
pop edi
mov eax, ebx
pop ebx
add esp, 0x290
ret 0x18