Function at 0x1005127
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Resolve dns
Set socket configuration

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xb0
mov eax, dword [0x1008390]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 8
pop ecx
mov dword [ebp - 4], eax
xor eax, eax
lea edi, [ebp - 0xb0]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x88]
push eax
xor edx, edx
lea eax, [ebp - 0xb0]
push eax
xor ebx, ebx
push edx
inc ebx
push esi
mov dword [ebp - 0x88], edx
mov dword [ebp - 0xac], edx
mov dword [ebp - 0xb0], 2
mov dword [ebp - 0xa8], ebx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x100519c
push esi
push 0x2757
push ebx
call fcn.010064fd
add esp, 0xc
jmp 0x1005375
mov eax, dword [ebp - 0x88]
mov ecx, dword [eax + 0x14]
test ecx, ecx
mov dword [ebp - 0x8c], eax
je 0x10051b1
mov esi, ecx
mov edx, 0x1009fa0
mov cl, byte [esi]
inc esi
mov byte [edx], cl
inc edx
test cl, cl
jne 0x10051b6
push 0
push ebx
mov dword [ebp - 0x90], ebx
push dword [eax + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x10052a7
push 0x20
pop ecx
xor eax, eax
lea edi, [ebp - 0x84]
rep stosd dword es:[edi], eax
mov eax, dword [ebp - 0x88]
mov cx, word [eax + 4]
mov word [ebp - 0x84], cx
push dword [eax + 0x10]
lea eax, [ebp - 0x84]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
or edi, 0xffffffff
cmp eax, edi
je 0x10052b8
push 4
lea eax, [ebp - 0x90]
push eax
push 8
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, edi
jne 0x1005243
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x275b
call fcn.01006573
mov eax, dword [ebp - 0x88]
mov eax, dword [eax + 0x18]
mov cx, word [ebp + 0xc]
mov word [eax + 2], cx
mov eax, dword [ebp - 0x88]
push dword [eax + 0x10]
push dword [eax + 0x18]
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, edi
jne 0x10052e7
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x88]
mov eax, dword [eax + 0x1c]
test eax, eax
mov esi, edi
mov dword [ebp - 0x88], eax
je 0x100534c
push 0
push ebx
mov dword [ebp - 0x90], ebx
push dword [eax + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, edi
jne 0x10051dd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x2758
jmp 0x1005358
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 0x2742
jne 0x10052d9
push 0x2759
push 2
call fcn.010064fd
pop ecx
pop ecx
jmp 0x100535d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x275a
jmp 0x1005358
push 0x1009600
push 0x1009500
push esi
mov dword [0x1009600], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
cmp eax, edi
jne 0x1005314
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x275d
jmp 0x1005358
cmp dword [0x100a3b0], 0
mov dword [0x10094e0], esi
mov dword [0x1009480], esi
je 0x100533c
push 0x1009fa0
push 0x2734
push ebx
call fcn.010064fd
add esp, 0xc
push ebx
push 0
call fcn.01004ea6
mov eax, dword [ebp - 0x8c]
jmp 0x1005377
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x275c
call fcn.01006573
push dword [ebp - 0x8c]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
cmp esi, 0xffffffff
je 0x1005375
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.01006192
leave
ret 8