Function at 0x10040440
Capabilities:
Convert ip address from string
Initialize winsock library
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100dc667
mov eax, dword fs:[0]
push eax
sub esp, 0x118
mov eax, dword [0x1010f16c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0xf0], edi
lea esi, [edi + 0x70]
mov dword [ebp - 0xf8], 0
push esi
mov dword [ebp - 0x124], esi
call fcn.10079ba3
add esp, 4
test eax, eax
je 0x1004049e
push eax
call fcn.10079c5b
add esp, 4
mov dword [ebp - 4], 0
lea eax, [edi + 0x68]
cmp dword [eax], 0
mov dword [ebp - 0x108], eax
jne 0x10040b1c
cmp dword [edi + 0x20], 0x10
mov eax, dword [edi + 0x24]
mov dword [ebp - 0xfc], eax
lea eax, [edi + 0xc]
mov dword [ebp - 0xe8], eax
jb 0x100404d7
mov eax, dword [eax]
mov dword [ebp - 0xe8], eax
cmp byte [0x10115ce1], 0
mov al, byte [edi + 8]
mov byte [ebp - 0xdd], al
jne 0x10040516
push 0x10115f38
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
movzx ecx, byte [0x10115ce1]
test eax, eax
mov al, byte [ebp - 0xdd]
mov edx, 1
cmove ecx, edx
mov byte [0x10115ce1], cl
mov dword [ebp - 0x84], 0
xorps xmm0, xmm0
movq qword [ebp - 0x8c], xmm0
lea ecx, [ebp - 0x20]
mov dword [ebp - 0xec], ecx
mov dword [ebp - 0x100], 0x10
push 0
movups xmmword [ebp - 0x20], xmm0
push 1
movups xmmword [ebp - 0x9c], xmm0
test al, al
je 0x10040563
push 0x17
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
mov dword [ebp - 0x104], edi
jmp 0x10040573
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
mov dword [ebp - 0x104], eax
cmp edi, 0xffffffff
je 0x10040b5b
cmp byte [ebp - 0xdd], 0
push dword [ebp - 0xfc]
je 0x100405d1
mov eax, 0x17
mov word [ebp - 0x9c], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x9a], ax
lea eax, [ebp - 0x94]
push eax
push dword [ebp - 0xe8]
push 0x17
call dword [sym.imp.WS2_32.dll_inet_pton]
lea ecx, [ebp - 0x9c]
mov dword [ebp - 0x100], 0x1c
mov dword [ebp - 0xec], ecx
jmp 0x100405fd
mov eax, 2
mov word [ebp - 0x20], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x1e], ax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0xe8]
mov dword [ebp - 0x1c], 0
push 2
call dword [sym.imp.WS2_32.dll_inet_pton]
test eax, eax
mov dword [ebp - 0xe4], 1
setg al
test al, al
je 0x10040b54
push 4
lea eax, [ebp - 0xe4]
push eax
push 4
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x10040b54
push dword [ebp - 0x100]
push dword [ebp - 0xec]
push edi
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x10040b54
push 0x200
push edi
call dword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
je 0x10040b54
lea edx, [ebp - 0xdd]
mov byte [ebp - 0xdd], 1
lea ecx, [ebp - 0x18]
call fcn.10047fc0
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0xf0]
add ecx, 0x60
push eax
mov dword [ebp - 0xec], ecx
call fcn.10045a20
mov byte [ebp - 4], 0
or edi, 0xffffffff
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0xe4], ecx
test ecx, ecx
je 0x100406c7
mov eax, edi
lock xadd dword [ecx + 4], eax
jne 0x100406c7
mov eax, dword [ecx]
call dword [eax]
mov ecx, dword [ebp - 0xe4]
mov eax, edi
lock xadd dword [ecx + 8], eax
jne 0x100406c7
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 5
push 8
call fcn.10090929
mov edi, eax
mov dword [ebp - 0xfc], edi
mov byte [ebp - 4], 6
mov eax, dword [ebp - 0x104]
mov dword [edi], 0x100f6010
mov dword [edi + 4], eax
mov byte [ebp - 4], 7
mov dword [edi], 0x100f6014
mov byte [ebp - 4], 5
push 0x10
mov dword [ebp - 0xe4], edi
mov dword [ebp - 0xf8], 1
mov dword [ebp - 0x114], 0
mov dword [ebp - 0x110], 0
call fcn.10090929
add esp, 8
mov dword [ebp - 0xe8], eax
mov byte [ebp - 4], 8
lea ecx, [eax + 4]
mov dword [ecx], 1
mov dword [ebp - 0x100], ecx
lea ecx, [eax + 8]
mov dword [ecx], 1
mov dword [eax], 0x100f5f4c
mov dword [ebp - 0x10c], ecx
mov dword [eax + 0xc], edi
mov byte [ebp - 4], 5
mov dword [ebp - 0x114], edi
mov dword [ebp - 0x110], eax
mov dword [ebp - 0xe4], 0
mov byte [ebp - 4], 9
mov eax, 1
mov dword [ebp - 0xf8], eax
and eax, 0xfffffffe
mov dword [ebp - 0xf8], eax
mov byte [ebp - 4], 0xa
mov eax, dword [ebp - 0xec]
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov edi, dword [eax + 4]
mov dword [ebp - 0xec], edi
test edi, edi
je 0x100407be
lock inc dword [edi + 4]
mov edi, dword [eax + 4]
mov dword [ebp - 0xec], edi
mov eax, dword [eax]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0xe4], eax
mov dword [ebp - 0x14], edi
mov byte [ebp - 4], 0xb
mov dword [ebp - 0xa0], 0
mov byte [ebp - 4], 0xc
mov eax, dword [ebp - 0xf0]
mov edx, dword [eax + 0x4c]
test edx, edx
je 0x10040806
mov eax, dword [edx]
lea ecx, [ebp - 0xc4]
push ecx
mov ecx, edx
mov eax, dword [eax]
call eax
mov dword [ebp - 0xa0], eax
mov eax, dword [ebp - 0xf0]
mov byte [ebp - 4], 0xd
add eax, 0x50
push eax
lea ecx, [ebp - 0x120]
call fcn.10045ca0
mov byte [ebp - 4], 0xe
mov eax, edi
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x7c], 0
test eax, eax
je 0x10040835
lock inc dword [eax + 4]
mov eax, dword [ebp - 0xe4]
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x7c], edi
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x100]
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
lock inc dword [eax]
mov eax, dword [ebp - 0xfc]
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0xe8]
mov dword [ebp - 0x74], eax
mov byte [ebp - 4], 0x10
lea eax, [ebp - 0x70]
mov dword [ebp - 0xe4], eax
mov dword [ebp - 0x4c], 0
mov byte [ebp - 4], 0x11
mov ecx, dword [ebp - 0xa0]
test ecx, ecx
je 0x1004089d
mov eax, dword [ecx]
lea edx, [ebp - 0x70]
push edx
mov eax, dword [eax]
call eax
mov dword [ebp - 0x4c], eax
mov byte [ebp - 4], 0x12
mov eax, 0x66666667
mov ecx, dword [ebp - 0x11c]
sub ecx, dword [ebp - 0x120]
imul ecx
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x48], 0
sar edx, 4
mov eax, edx
mov dword [ebp - 0x44], 0
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0x40], 0
push eax
call fcn.10046c00
test al, al
je 0x100408fa
push dword [ebp - 0x48]
lea ecx, [ebp - 0x48]
push dword [ebp - 0x11c]
push dword [ebp - 0x120]
call fcn.100498c0
mov dword [ebp - 0x44], eax
mov byte [ebp - 4], 0x15
push 0x14
call fcn.10090929
add esp, 4
mov dword [ebp - 0xfc], eax
mov byte [ebp - 4], 0x16
lea edx, [ebp - 0x80]
mov dword [eax + 4], 1
lea ecx, [ebp - 0xe4]
mov dword [eax + 8], 1
mov dword [eax], method.Concurrency::details::stl_critical_section_win7.virtual_16
add eax, 0xc
mov dword [ebp - 0x104], eax
call fcn.10050050
mov edi, eax
mov byte [ebp - 4], 0x17
lea ecx, [ebp - 0x34]
call fcn.1002b090
mov byte [ebp - 4], 0x18
mov ecx, dword [edi]
mov dword [ebp - 0x34], 0x100f5afc
mov dword [edi], 0
mov dword [ebp - 0x24], ecx
mov byte [ebp - 4], 0x1a
lea ecx, [ebp - 0x34]
push dword [ebp - 0x104]
call fcn.1002b2c0
mov byte [ebp - 4], 0x1b
mov edi, dword [ebp - 0x24]
test edi, edi
je 0x100409a4
mov dword [ebp - 0xf0], edi
mov byte [ebp - 4], 0x1b
mov dword [ebp - 0xf0], edi
mov byte [ebp - 4], 0x1b
mov ecx, edi
call fcn.10041530
push 0x48
push edi
call fcn.1009091b
add esp, 8
mov byte [ebp - 4], 0x17
lea ecx, [ebp - 0x34]
call fcn.1002b1f0
mov byte [ebp - 4], 0x16
mov edi, dword [ebp - 0xe4]
test edi, edi
je 0x100409e4
mov dword [ebp - 0xf0], edi
mov byte [ebp - 4], 0x16
mov dword [ebp - 0xf0], edi
mov byte [ebp - 4], 0x16
mov ecx, edi
call fcn.10041530
push 0x48
push edi
call fcn.1009091b
add esp, 8
mov byte [ebp - 4], 0x15
mov edi, dword [ebp - 0xf8]
mov eax, dword [ebp - 0x104]
or edi, 2
mov ecx, dword [ebp - 0x108]
mov dword [ebp - 0xf8], edi
mov dword [ebp - 0xf4], 0
mov dword [ebp - 0xf4], eax
mov eax, dword [ebp - 0xfc]
mov dword [ebp - 0xf0], 0
mov dword [ebp - 0xf0], eax
lea eax, [ebp - 0xf4]
push eax
call fcn.10045a20
and edi, 0xfffffffd
mov dword [ebp - 0xf8], edi
mov byte [ebp - 4], 0x14
mov ecx, dword [ebp - 0xf0]
test ecx, ecx
je 0x10040a70
or edi, 0xffffffff
mov eax, edi
lock xadd dword [ecx + 4], eax
jne 0x10040a70
mov eax, dword [ecx]
call dword [eax]
mov ecx, dword [ebp - 0xf0]
mov eax, edi
lock xadd dword [ecx + 8], eax
jne 0x10040a70
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0xe
lea ecx, [ebp - 0x80]
call fcn.10041530
mov byte [ebp - 4], 0xd
lea ecx, [ebp - 0x120]
call fcn.10046810
mov byte [ebp - 4], 0xb
mov ecx, dword [ebp - 0xa0]
test ecx, ecx
je 0x10040ab6
mov eax, dword [ecx]
mov edx, dword [eax + 0x10]
lea eax, [ebp - 0xc4]
cmp ecx, eax
setne al
push eax
call edx
mov dword [ebp - 0xa0], 0
mov byte [ebp - 4], 0xa
mov edi, dword [ebp - 0xec]
test edi, edi
je 0x10040ae5
or eax, 0xffffffff
lock xadd dword [edi + 4], eax
jne 0x10040ae5
mov eax, dword [edi]
mov ecx, edi
call dword [eax]
or eax, 0xffffffff
lock xadd dword [edi + 8], eax
jne 0x10040ae5
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 4]
mov byte [ebp - 4], 0
or edi, 0xffffffff
mov ecx, dword [ebp - 0x100]
mov eax, edi
lock xadd dword [ecx], eax
jne 0x10040b1c
mov ecx, dword [ebp - 0xe8]
mov eax, dword [ecx]
call dword [eax]
mov eax, dword [ebp - 0x10c]
lock xadd dword [eax], edi
dec edi
jne 0x10040b1c
mov ecx, dword [ebp - 0xe8]
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
push esi
call fcn.10079bc8
add esp, 4
test eax, eax
je 0x10040b39
push eax
call fcn.10079c5b
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.100908e7
mov esp, ebp
pop ebp
ret
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
lea ecx, [ebp - 0x38]
call fcn.100514c0
mov esi, eax
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xdc]
push str.listen_error_of:
call fcn.10005920
mov byte [ebp - 4], 2
mov edx, eax
push esi
lea ecx, [ebp - 0x98]
call fcn.10048c80
add esp, 4
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x18]
push eax
call fcn.10038040
push 0x1010c660
lea eax, [ebp - 0x18]
push eax
call fcn.100a824e
int3