Function at 0x100412bd
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 0x10041675
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 0x10041673
push dword [esp + 0x2a4]
call fcn.10158bf0
mov dword [esp + 0x18], eax
test esi, esi
je 0x100413ae
cmp dword [0x101e1178], ebx
je 0x1004165f
lea ecx, [esp + 0x5c]
push ecx
push eax
push 0x17
call fcn.100411ef
add esp, 0xc
test eax, eax
jg 0x100413a5
lea eax, [esp + 0x20]
push eax
push edi
push edi
push dword [esp + 0x24]
call dword [0x101e1164]
test eax, eax
jne 0x1004165f
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 [0x101e1168]
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x1c]
jmp 0x100413d9
mov edi, dword [esp + 0x1c]
xor eax, eax
inc eax
jmp 0x100413d9
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov edi, eax
cmp edi, 0xffffffff
jne 0x100413d1
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x100413d1
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 0x1004165f
xor ecx, ecx
cmp dword [esp + 0x2b8], ebx
jne 0x100413fc
mov eax, dword [esp + 0x2b4]
test eax, eax
je 0x1004144d
cmp word [eax], cx
je 0x1004144d
push 0x1c
push ecx
lea eax, [esp + 0x84]
push eax
call fcn.10024f30
push 0x10
lea eax, [esp + 0x7c]
push 0
push eax
call fcn.10024f30
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.10041be7
test eax, eax
je 0x1004165f
xor ecx, ecx
test esi, esi
je 0x1004148f
push 0x1c
push ecx
lea eax, [esp + 0x48]
push eax
call fcn.10024f30
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 0x100414bf
push 0x10
push ecx
lea eax, [esp + 0x30]
push eax
call fcn.10024f30
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 0x10041600
cmp dword [esp + 0x2b0], ebx
jle 0x100415bc
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 0x1004165f
test esi, esi
je 0x10041504
push 0x1c
lea eax, [esp + 0x44]
jmp 0x1004150a
push 0x10
lea eax, [esp + 0x2c]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x1004165f
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 0x1004159d
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 0x1004165f
xor edi, edi
inc edi
jmp 0x100415df
test esi, esi
je 0x100415c8
push 0x1c
lea eax, [esp + 0x44]
jmp 0x100415ce
push 0x10
lea eax, [esp + 0x2c]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x1004165f
push 0x10
push 0
push dword [0x101df4f0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x1004165f
and dword [ebx + 0xc], 0
mov dword [ebx], edi
mov dword [ebx + 8], ebp
jmp 0x1004165f
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 0x1004165f
push 0x38
push eax
push dword [0x101df4f0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x1004165f
lea edi, [ebx + 4]
push 2
pop eax
mov dword [ebx], eax
test esi, esi
je 0x10041645
push 7
pop ecx
lea esi, [esp + 0x40]
rep movsd dword es:[edi], dword [esi]
jmp 0x1004164d
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.10158be0
test ebx, ebx
jne 0x10041673
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