Function at 0x402340
Capabilities:
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40c96e
mov eax, dword fs:[0]
push eax
sub esp, 0x240
mov eax, dword [0x412150]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
call section..text
push 5
xor ebx, ebx
push str.Port:
lea ecx, [ebp - 0x48]
mov esi, eax
mov dword [ebp - 0x34], 0xf
mov dword [ebp - 0x38], ebx
mov byte [ebp - 0x48], bl
call fcn.004020f0
mov dword [ebp - 4], ebx
push 0xa
lea eax, [ebp - 0x1c]
push eax
push edi
call fcn.0040c75d
push eax
lea ecx, [ebp - 0x48]
push ecx
lea edx, [ebp - 0x64]
push edx
call fcn.004022b0
add esp, 0x18
mov byte [ebp - 4], 1
cmp dword [eax + 0x14], 0x10
jb 0x4023c2
mov eax, dword [eax]
mov edx, dword [esi]
push 0x7d0
push str.InitSocket
push eax
mov eax, dword [edx]
mov ecx, esi
call eax
mov byte [ebp - 4], bl
mov esi, 0x10
cmp dword [ebp - 0x50], esi
jb 0x4023ee
mov ecx, dword [ebp - 0x64]
push ecx
call fcn.00403966
add esp, 4
mov dword [ebp - 0x50], 0xf
mov dword [ebp - 0x54], ebx
mov byte [ebp - 0x64], bl
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x34], esi
jb 0x402413
mov edx, dword [ebp - 0x48]
push edx
call fcn.00403966
add esp, 4
lea eax, [ebp - 0x248]
push eax
push 0x101
mov dword [ebp - 0x34], 0xf
mov dword [ebp - 0x38], ebx
mov byte [ebp - 0x48], bl
call dword [sym.imp.WSOCK32.dll_WSAStartup]
mov eax, dword [ebp - 0x248]
cmp al, 1
jne 0x4025d3
shr eax, 8
cmp al, 1
jne 0x4025d3
push ebx
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov esi, eax
cmp esi, ebx
jge 0x40247f
call section..text
mov edx, dword [eax]
push 0xfa0
push str.InitSocket
mov ecx, eax
mov eax, dword [edx]
push str.Cant_open_stream_socket____Exit_SOCK_ERROR_
call eax
push 2
call fcn.00404c33
xor eax, eax
mov ecx, 2
mov dword [ebp - 0x2c], eax
push ebx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov word [ebp - 0x2c], cx
call dword [sym.imp.WSOCK32.dll_htonl]
push edi
mov dword [ebp - 0x28], eax
call dword [sym.imp.WSOCK32.dll_htons]
push 0x10
lea edx, [ebp - 0x2c]
push edx
push esi
mov word [ebp - 0x2a], ax
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
jns 0x4025b5
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push ebx
push ebx
lea ecx, [ebp - 0x24c]
push ecx
push ebx
push eax
push ebx
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
call section..text
push str.Failure_when_binding_socket_to_port
lea ecx, [ebp - 0xb8]
mov esi, eax
call fcn.004021f0
mov dword [ebp - 4], 2
lea edx, [ebp - 0x1c]
push edx
push eax
lea eax, [ebp - 0x80]
push eax
call fcn.004022b0
mov byte [ebp - 4], 3
push 0x40d604
push eax
lea ecx, [ebp - 0x9c]
push ecx
call fcn.004022b0
mov bl, 4
mov byte [ebp - 4], bl
mov edx, dword [ebp - 0x24c]
push edx
push eax
lea eax, [ebp - 0x48]
push eax
call fcn.004022b0
mov byte [ebp - 4], 5
push str.._Exit_BIND_ERROR_
push eax
lea ecx, [ebp - 0x64]
push ecx
call fcn.004022b0
add esp, 0x30
mov byte [ebp - 4], 6
cmp dword [eax + 0x14], 0x10
jb 0x402557
mov eax, dword [eax]
mov edx, dword [esi]
push 0xfa0
push str.InitSocket
push eax
mov eax, dword [edx]
mov ecx, esi
call eax
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x64]
call fcn.00401dc0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x48]
call fcn.00401dc0
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x9c]
call fcn.00401dc0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x80]
call fcn.00401dc0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xb8]
call fcn.00401dc0
push 2
call fcn.00404c33
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00403e26
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WSOCK32.dll_WSACleanup]
call section..text
mov edx, dword [eax]
push 0xfa0
push str.InitSocket
mov ecx, eax
mov eax, dword [edx]
push str.Failed_to_find_Winsock_version_1.1_or_better____Exit_1_
call eax
push 1
call fcn.00404c33
int3