Function at 0x402c40
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x334
mov eax, dword [0x425040]
xor eax, esp
mov dword [esp + 0x330], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
lea eax, [esp + 0x10]
push edi
mov edi, dword [ebp + 8]
mov ebx, ecx
push eax
push 0x8004667e
push edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x20], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [esi + 0x10]
push dword [esi + 0x18]
push edi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x402de5
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x402cc6
mov eax, dword [ebx + 4]
mov dword [eax], 2
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x330]
xor ecx, esp
call fcn.0041b7a8
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebx + 0xc]
lea esi, [esp + 0x20]
mov dword [esp + 0x24], edi
mov ecx, 0x41
mov dword [esp + 0x20], 1
lea edi, [esp + 0x128]
rep movsd dword es:[edi], dword [esi]
mov ebx, dword [eax]
lea esi, [esp + 0x20]
mov eax, dword [eax + 4]
lea edi, [esp + 0x230]
mov dword [esp + 0x1c], eax
mov ecx, 0x41
mov eax, dword [esp + 0xc]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [eax + 8]
mov edx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 8]
inc eax
mov dword [esp + 0x1c], ebx
mov ebx, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov edi, eax
mov dword [esp + 0x18], edx
nop word [eax + eax]
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x234]
push eax
lea eax, [esp + 0x130]
push eax
lea eax, [esp + 0x2c]
push eax
push edi
call dword [sym.imp.WS2_32.dll_select]
mov esi, eax
test esi, esi
jns 0x402d60
call ebx
cmp dword [eax], 4
je 0x402d30
test esi, esi
mov edi, dword [ebp + 8]
jne 0x402d6c
mov ecx, 0xd
jmp 0x402dd0
test esi, esi
jle 0x402dcb
mov esi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
lea eax, [esp + 0x20]
push eax
push edi
call esi
test eax, eax
jne 0x402d91
lea eax, [esp + 0x128]
push eax
push edi
call esi
test eax, eax
je 0x402dcb
lea eax, [esp + 0x10]
mov dword [esp + 0x14], 0
push eax
lea eax, [esp + 0x18]
mov dword [esp + 0x14], 4
push eax
push 0x1007
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
js 0x402dcb
cmp dword [esp + 0x14], 0
jne 0x402dcb
xor ecx, ecx
jmp 0x402dd0
mov ecx, 2
mov ebx, dword [esp + 0xc]
mov eax, dword [ebx + 4]
mov dword [eax], ecx
mov eax, dword [ebx + 4]
cmp dword [eax], 0
jne 0x402cad
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov eax, dword [ebx + 0x14]
push 0
push 0x3e8
push dword [eax + 4]
push dword [eax]
call fcn.0041c6e0
mov ecx, dword [ebx + 0x10]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
imul ecx, dword [ecx], 0x3e8
add eax, ecx
mov dword [esp + 0x14], eax
lea eax, [esp + 0x14]
push eax
push 0x1006
push 0xffff
push edi
call esi
mov eax, dword [ebx + 0x1c]
push 0
push 0x3e8
push dword [eax + 4]
push dword [eax]
call fcn.0041c6e0
mov ecx, dword [ebx + 0x18]
push 4
imul ecx, dword [ecx], 0x3e8
add eax, ecx
mov dword [esp + 0x14], eax
lea eax, [esp + 0x14]
push eax
push 0x1005
push 0xffff
push edi
call esi
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x33c]
pop edi
pop esi
pop ebx
mov dword [eax], 0
xor ecx, esp
mov al, 1
call fcn.0041b7a8
mov esp, ebp
pop ebp
ret 8