Function at 0x545918
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff9c
push ebx
xor ebx, ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0xc]
call fcn.00405328
xor eax, eax
push ebp
push 0x545be5
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0xd], 0
xor ecx, ecx
mov dl, 1
mov eax, dword [ebp - 4]
call fcn.0054515c
lea ecx, [ebp - 0x20]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.00544e38
mov eax, dword [ebp - 0x20]
mov edx, 0x545c00
call fcn.00405284
jne 0x545981
xor ecx, ecx
mov dl, 2
mov eax, dword [ebp - 4]
call fcn.0054515c
jmp 0x545bc7
xor eax, eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
push 0x8004667e
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_ioctlsocket_1
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
je 0x545bad
lea eax, [ebp - 0x38]
xor ecx, ecx
mov edx, 0x10
call fcn.00403774
mov word [ebp - 0x38], 2
mov ax, word [ebp + 8]
push eax
call sub.ws2_32.dll_htons_1
mov word [ebp - 0x36], ax
mov eax, dword [ebp - 0x20]
call fcn.00405338
push eax
call sub.ws2_32.dll_inet_addr_1
mov dword [ebp - 0x34], eax
xor eax, eax
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x64]
xor ecx, ecx
mov edx, 0x2c
call fcn.00403774
call sub.ws2_32.dll_WSACreateEvent
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x44]
mov dword [ebp - 0x24], eax
mov ebx, dword [ebp - 0x28]
test ebx, ebx
je 0x545b82
xor edx, edx
push ebp
push 0x545b7b
push dword fs:[edx]
mov dword fs:[edx], esp
push 0x30
push ebx
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_WSAEventSelect
test eax, eax
jne 0x545b64
xor edx, edx
push ebp
push 0x545b5d
push dword fs:[edx]
mov dword fs:[edx], esp
xor eax, eax
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x34]
mov dl, 3
mov eax, dword [ebp - 4]
call fcn.0054515c
push 0x10
lea eax, [ebp - 0x38]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_connect_1
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x545aa0
call sub.ws2_32.dll_WSAGetLastError_1
cmp eax, 0x2733
je 0x545aa0
cmp dword [ebp - 8], 0xffffffff
je 0x545a91
mov ecx, eax
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.0054515c
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_closesocket_1
mov dword [ebp - 8], 0xffffffff
call fcn.0040485c
call fcn.0040485c
jmp 0x545bc7
push 0
push 0xea60
push 0
lea eax, [ebp - 0x28]
push eax
push 2
call sub.ws2_32.dll_WSAWaitForMultipleEvents
mov ecx, eax
test ecx, ecx
jne 0x545aef
lea eax, [ebp - 0x64]
push eax
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_WSAEnumNetworkEvents
test eax, eax
jne 0x545b05
mov eax, dword [ebp - 0x64]
mov edx, eax
or edx, 0x10
cmp edx, eax
jne 0x545ae7
cmp dword [ebp - 0x50], 0
jne 0x545ae7
mov byte [ebp - 0xd], 1
jmp 0x545b05
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x14], eax
jmp 0x545b05
mov eax, ecx
cdq
cmp edx, 0
jne 0x545b05
cmp eax, 0x102
jne 0x545b05
mov dword [ebp - 0x14], 0x274c
cmp byte [ebp - 0xd], 0
je 0x545b19
xor ecx, ecx
mov dl, 4
mov eax, dword [ebp - 4]
call fcn.0054515c
jmp 0x545b26
mov ecx, dword [ebp - 0x14]
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.0054515c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x545b64
push 0
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_WSAEventSelect
xor eax, eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
push 0x8004667e
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_ioctlsocket_1
mov dword [ebp - 0x18], eax
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x545b82
mov eax, dword [ebp - 0x28]
push eax
call sub.ws2_32.dll_WSACloseEvent
ret
cmp byte [ebp - 0xd], 0
je 0x545b8e
cmp dword [ebp - 0x18], 0xffffffff
jne 0x545bc7
mov ecx, dword [ebp - 0x14]
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.0054515c
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_closesocket_1
cmp dword [ebp - 0x14], 0x274c
jmp 0x545bc7
call sub.ws2_32.dll_WSAGetLastError_1
mov ecx, eax
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.0054515c
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_closesocket_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x545bec
lea eax, [ebp - 0x20]
call fcn.00404e5c
lea eax, [ebp - 0xc]
call fcn.00404e5c
ret