Function at 0x40cabb
Capabilities:
Initialize winsock library
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x68c
push ebx
push esi
mov esi, dword [ebp + 8]
and esi, 2
push edi
mov dword [esp + 0x14], esi
jne 0x40cae0
xor ebx, ebx
mov dword [0x435b48], ebx
jmp 0x40cae2
xor ebx, ebx
call fcn.0040c735
mov edi, eax
mov dword [0x435b60], edi
cmp edi, ebx
je 0x40cc76
cmp esi, ebx
jne 0x40cb14
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [0x435b5c], eax
cmp eax, ebx
je 0x40cc76
jmp 0x40cbc1
push 0x408518
call fcn.0040c66f
push 0x408528
mov dword [esp + 0x1c], eax
call fcn.0040c66f
mov dword [esp + 0x1c], eax
mov eax, dword [0x435b5c]
mov ecx, dword [eax + 0x3c]
mov dword [esp + 0x10], eax
lea ecx, [ecx + eax + 0x80]
cmp dword [esp + 0x1c], ebx
je 0x40cbc1
cmp dword [esp + 0x18], ebx
je 0x40cbc1
mov edi, dword [ecx]
cmp edi, ebx
jbe 0x40cbc1
cmp dword [ecx + 4], 0x14
jbe 0x40cbc1
add edi, eax
cmp dword [edi], ebx
je 0x40cbc1
mov eax, dword [edi + 0xc]
add eax, dword [esp + 0x10]
push eax
call dword [esp + 0x20]
mov dword [esp + 0x20], eax
cmp eax, ebx
je 0x40cc76
mov esi, dword [edi]
mov ebx, dword [edi + 0x10]
add esi, dword [esp + 0x10]
add ebx, dword [esp + 0x10]
jmp 0x40cbb2
jns 0x40cb91
and eax, 0xffff
jmp 0x40cb99
mov ecx, dword [esp + 0x10]
lea eax, [eax + ecx + 2]
push eax
push dword [esp + 0x24]
call dword [esp + 0x20]
test eax, eax
je 0x40cc76
mov dword [ebx], eax
add esi, 4
add ebx, 4
mov eax, dword [esi]
test eax, eax
jne 0x40cb88
add edi, 0x14
xor ebx, ebx
cmp dword [edi], ebx
jne 0x40cb61
lea esi, [esp + 0x24]
mov eax, 0x136
call fcn.0040aee3
mov eax, esi
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [0x435b64], eax
cmp eax, ebx
je 0x40cc76
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x408538
push eax
call esi
push 0x408548
push dword [0x435b64]
mov dword [0x435b68], eax
call esi
push 0x40855c
push dword [0x435b64]
mov dword [0x435b6c], eax
call esi
push 0x408578
push dword [0x435b64]
mov dword [0x435b70], eax
call esi
push 0x40858c
push dword [0x435b64]
mov dword [0x435b74], eax
call esi
push 0x408598
push dword [0x435b64]
mov dword [0x435b78], eax
call esi
mov dword [0x435b7c], eax
cmp dword [0x435b68], ebx
jne 0x40cc62
cmp dword [0x435b6c], ebx
je 0x40cc76
cmp dword [0x435b70], ebx
je 0x40cc76
cmp dword [0x435b78], ebx
je 0x40cc76
cmp eax, ebx
jne 0x40cc7d
xor al, al
jmp 0x40ce46
push ebx
push 0x80000
push ebx
call dword [sym.imp.KERNEL32.dll_HeapCreate]
mov dword [0x437240], eax
cmp eax, ebx
jne 0x40cca7
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [0x437240], eax
mov byte [0x4359f3], 0
jmp 0x40ccae
mov byte [0x4359f3], 1
push 0x4379b4
mov dword [0x436064], ebx
mov byte [0x4359f2], 0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea eax, [esp + 0x38]
push eax
push 0x202
mov dword [0x43794c], ebx
call dword [sym.imp.WS2_32.dll_WSAStartup]
call fcn.0040ca51
test eax, eax
jne 0x40cc76
mov edi, dword [ebp + 8]
mov eax, edi
call fcn.0040c76f
test al, al
je 0x40cc76
cmp dword [esp + 0x14], ebx
jne 0x40cd1c
push ebx
push ebx
push 1
push 0x435b80
call dword [sym.imp.KERNEL32.dll_CreateEventW]
or dword [0x435f58], 0xffffffff
mov dword [0x435f54], eax
cmp eax, ebx
je 0x40cc76
push 0x435b58
push 0xffffffffffffffff
call fcn.0042daa7
mov dword [0x435b4c], eax
cmp eax, ebx
je 0x40cc76
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov dword [0x435b50], eax
push eax
mov eax, dword [0x435b4c]
push dword [eax]
call fcn.0042c7d3
push edi
mov dword [0x435b54], eax
call fcn.0040c7ee
test al, al
je 0x40cc76
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x435db8], eax
mov dword [0x435dbc], ebx
cmp dword [esp + 0x14], ebx
jne 0x40cdd5
mov esi, dword [0x435b5c]
mov eax, esi
call fcn.0043163b
cmp eax, ebx
je 0x40cc76
mov eax, dword [eax + 0xc]
add eax, esi
je 0x40cc76
sub eax, esi
mov dword [0x435f50], eax
cmp dword [esp + 0x14], ebx
jne 0x40cdd5
lea eax, [esp + 0x1c8]
call fcn.0040d321
push ebx
lea eax, [esp + 0x298]
push eax
push dword [0x435b54]
mov ecx, 0x435f00
push 0x435dc0
mov eax, 0x84939312
call fcn.00430ef2
push edi
call fcn.0040c850
test al, al
je 0x40cc76
xor eax, eax
mov dword [0x437250], ebx
mov word [0x436068], ax
mov word [0x4378b0], ax
mov word [0x435990], ax
mov word [0x437ab0], ax
mov word [0x437a48], ax
mov word [0x4379e0], ax
mov word [0x437950], ax
mov word [0x437258], ax
mov dword [eax + 0x435010], ebx
mov dword [eax + 0x43500c], ebx
mov dword [eax + 0x435004], ebx
mov dword [eax + 0x435008], ebx
add eax, 0x14
cmp eax, 0x28
jb 0x40ce1b
push edi
call fcn.0040c907
test al, al
setne al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4