Function at 0x402240
Capabilities:
Connect socket
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x23c
mov eax, dword [0x44b024]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x220], 0xffffffff
mov dword [ebp - 0x21c], 0xffffffff
mov dword [ebp - 0x224], 0
mov dword [ebp - 0x230], 0
xor eax, eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov word [ebp - 8], ax
cmp dword [ebp + 0xc], 0
jl 0x402296
cmp dword [ebp + 0xc], 0x10000
jl 0x4022a0
mov eax, 4
jmp 0x402646
mov ecx, dword [ebp + 0xc]
push ecx
push 0x438ac8
lea edx, [ebp - 0x10]
push edx
call fcn.00402040
add esp, 0xc
cmp dword [ebp + 0x10], 0
jge 0x4022c2
mov dword [ebp + 0x10], 0
lea eax, [ebp - 0x10]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.004027b0
add esp, 8
mov dword [ebp - 0x230], eax
cmp dword [ebp - 0x230], 0
jne 0x4022eb
mov eax, 3
jmp 0x402646
mov edx, dword [ebp - 0x230]
mov dword [ebp - 0x224], edx
jmp 0x402308
mov eax, dword [ebp - 0x224]
mov ecx, dword [eax + 0x1c]
mov dword [ebp - 0x224], ecx
cmp dword [ebp - 0x224], 0
je 0x402618
mov edx, dword [ebp - 0x224]
cmp dword [edx + 4], 2
je 0x40232f
mov eax, dword [ebp - 0x224]
cmp dword [eax + 4], 0x17
je 0x40232f
jmp 0x4022f9
mov ecx, dword [ebp - 0x224]
mov edx, dword [ecx + 0xc]
push edx
mov eax, dword [ebp - 0x224]
mov ecx, dword [eax + 8]
push ecx
mov edx, dword [ebp - 0x224]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x220], eax
cmp dword [ebp - 0x220], 0xffffffff
jne 0x402364
jmp 0x4022f9
mov ecx, dword [ebp - 0x220]
push ecx
call fcn.00402830
add esp, 4
mov edx, dword [ebp - 0x224]
mov eax, dword [edx + 0x10]
push eax
mov ecx, dword [ebp - 0x224]
mov edx, dword [ecx + 0x18]
push edx
mov eax, dword [ebp - 0x220]
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jge 0x4023f5
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x21c], eax
cmp dword [ebp - 0x21c], 0x2748
jne 0x4023bf
mov dword [ebp - 0x21c], 0
jmp 0x402618
cmp dword [ebp - 0x21c], 0x2734
je 0x4023f5
cmp dword [ebp - 0x21c], 0x2733
je 0x4023f5
cmp dword [ebp - 0x21c], 0x2726
je 0x4023f5
mov ecx, dword [ebp - 0x220]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x4022f9
mov dword [ebp - 0x218], 0
mov dword [ebp - 0x114], 0
mov dword [ebp - 0x228], 0
jmp 0x402424
mov edx, dword [ebp - 0x228]
add edx, 1
mov dword [ebp - 0x228], edx
mov eax, dword [ebp - 0x228]
cmp eax, dword [ebp - 0x218]
jae 0x40244b
mov ecx, dword [ebp - 0x228]
mov edx, dword [ebp + ecx*4 - 0x214]
cmp edx, dword [ebp - 0x220]
jne 0x402449
jmp 0x40244b
jmp 0x402415
mov eax, dword [ebp - 0x228]
cmp eax, dword [ebp - 0x218]
jne 0x402484
cmp dword [ebp - 0x218], 0x40
jae 0x402484
mov ecx, dword [ebp - 0x228]
mov edx, dword [ebp - 0x220]
mov dword [ebp + ecx*4 - 0x214], edx
mov eax, dword [ebp - 0x218]
add eax, 1
mov dword [ebp - 0x218], eax
xor ecx, ecx
jne 0x402409
mov dword [ebp - 0x22c], 0
jmp 0x4024a3
mov edx, dword [ebp - 0x22c]
add edx, 1
mov dword [ebp - 0x22c], edx
mov eax, dword [ebp - 0x22c]
cmp eax, dword [ebp - 0x114]
jae 0x4024ca
mov ecx, dword [ebp - 0x22c]
mov edx, dword [ebp + ecx*4 - 0x110]
cmp edx, dword [ebp - 0x220]
jne 0x4024c8
jmp 0x4024ca
jmp 0x402494
mov eax, dword [ebp - 0x22c]
cmp eax, dword [ebp - 0x114]
jne 0x402503
cmp dword [ebp - 0x114], 0x40
jae 0x402503
mov ecx, dword [ebp - 0x22c]
mov edx, dword [ebp - 0x220]
mov dword [ebp + ecx*4 - 0x110], edx
mov eax, dword [ebp - 0x114]
add eax, 1
mov dword [ebp - 0x114], eax
xor ecx, ecx
jne 0x402488
cmp dword [ebp + 0x10], 0
jle 0x40252e
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x23c], edx
mov dword [ebp - 0x238], 0
lea eax, [ebp - 0x23c]
mov dword [ebp - 0x234], eax
jmp 0x402538
mov dword [ebp - 0x234], 0
mov ecx, dword [ebp - 0x234]
push ecx
lea edx, [ebp - 0x114]
push edx
lea eax, [ebp - 0x218]
push eax
push 0
push 0
call dword [sym.imp.WS2_32.dll_select]
mov dword [ebp - 0x21c], eax
cmp dword [ebp - 0x21c], 0
jge 0x402578
mov ecx, dword [ebp - 0x220]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x4022f9
cmp dword [ebp - 0x21c], 0
jne 0x40259a
mov dword [ebp - 0x21c], 5
mov edx, dword [ebp - 0x220]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x402618
mov eax, dword [ebp - 0x224]
mov ecx, dword [eax + 0x10]
push ecx
mov edx, dword [ebp - 0x224]
mov eax, dword [edx + 0x18]
push eax
mov ecx, dword [ebp - 0x220]
push ecx
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x21c], eax
cmp dword [ebp - 0x21c], 0
jne 0x4025cc
jmp 0x402618
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x21c], eax
lea edx, [ebp - 0x114]
push edx
mov eax, dword [ebp - 0x220]
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x402613
cmp dword [ebp - 0x21c], 0x2748
je 0x402607
cmp dword [ebp - 0x21c], 0x2726
jne 0x402613
mov dword [ebp - 0x21c], 0
jmp 0x402618
jmp 0x4022f9
mov ecx, dword [ebp - 0x220]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [ebp - 0x230]
push edx
call fcn.00402900
cmp dword [ebp - 0x21c], 0
jne 0x402641
mov eax, 1
jmp 0x402646
mov eax, 2
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004037f0
mov esp, ebp
pop ebp
ret