Function at 0x402950
Capabilities:
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4bafeb
mov eax, dword fs:[0]
push eax
sub esp, 0x1d0
mov eax, dword [0x4fc060]
xor eax, esp
mov dword [esp + 0x1c8], eax
push ebx
push esi
push edi
mov eax, dword [0x4fc060]
xor eax, esp
push eax
lea eax, [esp + 0x1e0]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0x28]
mov dword [esp + 0x38], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp + 0x40], eax
xor edi, edi
lea eax, [esp + 0x44]
mov dword [esp + 0x3c], ecx
mov ecx, dword [ebp + 0x20]
mov dword [esp + 0x18], edx
mov edx, dword [ebp + 0x24]
push eax
push 2
mov dword [esp + 0x34], ecx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x30], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x38], edi
call dword [sym.imp.WS2_32.dll_WSAStartup]
cmp eax, edi
jne 0x402be2
mov edi, dword [ebp + 0x18]
cmp edi, 1
jne 0x402a20
call fcn.004105a0
call fcn.004105b0
call fcn.004139e0
push eax
call fcn.00412440
add esp, 4
push eax
mov dword [0x5058f0], eax
call fcn.004129a0
add esp, 4
mov dword [0x5058f4], eax
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [ebp + 0x10]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x1c]
push eax
push edi
push ecx
push ebx
mov ebx, esi
lea edx, [esp + 0x3c]
lea ecx, [esp + 0x34]
call fcn.00402c20
mov edi, eax
add esp, 0x18
test edi, edi
je 0x402b9e
mov edx, dword [ebp + 0x18]
mov ebx, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
push esi
push edx
push ebx
call fcn.00402e20
mov edi, eax
add esp, 0xc
test edi, edi
je 0x402b9e
mov eax, dword [ebp + 0x18]
mov ecx, dword [esp + 0x40]
push esi
push eax
push ebx
call fcn.00403120
mov edi, eax
add esp, 0xc
test edi, edi
je 0x402b9e
mov ecx, dword [ebp + 0x18]
push ecx
push ebx
call fcn.00403420
mov edi, eax
add esp, 8
test edi, edi
je 0x402b9e
mov ebx, dword [esp + 0x30]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x28]
push edx
mov edx, dword [esp + 0x24]
push ebx
push eax
mov eax, dword [ebp + 0x14]
push ecx
mov ecx, dword [ebp + 0x18]
push edx
mov edx, dword [esp + 0x28]
push eax
push ecx
push edx
mov edx, dword [ebp + 0x10]
mov ecx, esi
call fcn.00403600
mov edi, eax
add esp, 0x20
test edi, edi
je 0x402b9e
lea eax, [esp + 0x18]
push eax
mov ecx, 0x4f70ba
call fcn.00404a50
mov dword [esp + 0x1e8], 0
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
push ebx
push ecx
push edx
push eax
push str._d._d._d._d
lea edi, [esp + 0x2c]
call fcn.00405830
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x40]
add esp, 0x14
push ecx
mov ecx, dword [esp + 0x2c]
push edx
push eax
push ecx
push ecx
mov eax, edi
mov ebx, esp
mov dword [esp + 0x40], esp
call fcn.004049e0
mov edx, dword [ebp + 0x18]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x50]
push edx
push eax
mov edx, esi
call fcn.00403950
mov edi, eax
mov dword [esp + 0x204], 0xffffffff
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
add esp, 0x1c
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402b82
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test edi, edi
je 0x402b9e
cmp dword [esi], 2
je 0x402b9e
mov ecx, dword [ebp + 0x18]
mov edx, dword [esp + 0x14]
push ecx
push edx
call fcn.004042e0
add esp, 8
mov edi, eax
cmp dword [ebp + 0x18], 1
jne 0x402bd5
mov eax, dword [0x5058f4]
push eax
call fcn.004123d0
mov ecx, dword [0x5058f4]
add esp, 4
push ecx
call fcn.00412160
mov edx, dword [0x5058f0]
add esp, 4
push edx
call fcn.00411410
add esp, 4
call fcn.00405fe0
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x402be8
mov dword [esi], 1
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, edi
mov ecx, dword [esp + 0x1e0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1c8]
xor ecx, esp
call fcn.00439f9b
mov esp, ebp
pop ebp
ret