Function at 0x541c74
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.004052dc
xor eax, eax
push ebp
push 0x541f41
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.005414b8
lea ecx, [ebp - 0x20]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.00541194
mov eax, dword [ebp - 0x20]
mov edx, 0x541f5c
call fcn.00405238
jne 0x541cdd
xor ecx, ecx
mov dl, 2
mov eax, dword [ebp - 4]
call fcn.005414b8
jmp 0x541f23
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 0x541f09
lea eax, [ebp - 0x38]
xor ecx, ecx
mov edx, 0x10
call fcn.0040374c
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.004052ec
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.0040374c
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 0x541ede
xor edx, edx
push ebp
push 0x541ed7
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 0x541ec0
xor edx, edx
push ebp
push 0x541eb9
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.005414b8
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 0x541dfc
call sub.ws2_32.dll_WSAGetLastError_1
cmp eax, 0x2733
je 0x541dfc
cmp dword [ebp - 8], 0xffffffff
je 0x541ded
mov ecx, eax
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.005414b8
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_closesocket_1
mov dword [ebp - 8], 0xffffffff
call fcn.00404810
call fcn.00404810
jmp 0x541f23
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 0x541e4b
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 0x541e61
mov eax, dword [ebp - 0x64]
mov edx, eax
or edx, 0x10
cmp edx, eax
jne 0x541e43
cmp dword [ebp - 0x50], 0
jne 0x541e43
mov byte [ebp - 0xd], 1
jmp 0x541e61
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x14], eax
jmp 0x541e61
mov eax, ecx
cdq
cmp edx, 0
jne 0x541e61
cmp eax, 0x102
jne 0x541e61
mov dword [ebp - 0x14], 0x274c
cmp byte [ebp - 0xd], 0
je 0x541e75
xor ecx, ecx
mov dl, 4
mov eax, dword [ebp - 4]
call fcn.005414b8
jmp 0x541e82
mov ecx, dword [ebp - 0x14]
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.005414b8
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x541ec0
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 0x541ede
mov eax, dword [ebp - 0x28]
push eax
call sub.ws2_32.dll_WSACloseEvent
ret
cmp byte [ebp - 0xd], 0
je 0x541eea
cmp dword [ebp - 0x18], 0xffffffff
jne 0x541f23
mov ecx, dword [ebp - 0x14]
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.005414b8
mov eax, dword [ebp - 8]
push eax
call sub.ws2_32.dll_closesocket_1
cmp dword [ebp - 0x14], 0x274c
jmp 0x541f23
call sub.ws2_32.dll_WSAGetLastError_1
mov ecx, eax
mov dl, 5
mov eax, dword [ebp - 4]
call fcn.005414b8
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 0x541f48
lea eax, [ebp - 0x20]
call fcn.00404e10
lea eax, [ebp - 0xc]
call fcn.00404e10
ret