Function at 0x401e44
Capabilities:
Get socket status

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x36c
mov esi, dword [esp + 0x384]
mov ebp, dword [esp + 0x38c]
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
cmp dword [esp + 0x380], 0xffffffff
je 0x4022ac
test ebp, ebp
jle 0x40227c
call fcn.0040fd14
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
mov edi, ebp
mov dword [esp + 0x25c], 0
mov dword [esp + 0x54], 0
cmp dword [esp + 0x380], 0xffffffff
je 0x4022d0
mov ecx, dword [esp + 0x380]
mov dword [esp + 0x58], ecx
mov dword [esp + 0x54], 1
mov dword [esp + 0x260], ecx
mov dword [esp + 0x25c], 1
mov edx, ecx
cmp esi, 0xffffffff
je 0x4022de
mov ecx, dword [esp + 0x54]
test ecx, ecx
je 0x402303
cmp dword [esp + 0x58], esi
je 0x401f0c
xor eax, eax
jmp 0x401efe
cmp dword [esp + eax*4 + 0x58], esi
je 0x401f0c
inc eax
cmp eax, ecx
jne 0x401ef8
cmp eax, 0x3f
jbe 0x402305
mov ecx, dword [esp + 0x25c]
test ecx, ecx
je 0x402331
lea ebx, [esp + 0x25c]
cmp dword [esp + 0x260], esi
je 0x401f58
xor eax, eax
lea ebx, [esp + 0x25c]
jmp 0x401f3e
cmp dword [ebx + eax*4 + 4], esi
je 0x401f58
inc eax
cmp eax, ecx
jne 0x401f38
cmp eax, 0x3f
ja 0x401f58
mov dword [esp + eax*4 + 0x260], esi
inc ecx
mov dword [esp + 0x25c], ecx
nop
cmp edx, esi
jb 0x40221c
mov dword [esp + 0x158], 0
cmp dword [esp + 0x388], 0xffffffff
je 0x4022ec
mov ecx, dword [esp + 0x388]
mov dword [esp + 0x15c], ecx
mov dword [esp + 0x158], 1
mov eax, dword [esp + 0x25c]
mov dword [esp + 0x3c], eax
test eax, eax
je 0x402324
cmp dword [esp + 0x260], ecx
je 0x40200a
mov dword [esp + 0x38], 0
mov dword [esp + 0x2c], edx
xor eax, eax
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x388]
jmp 0x401fd6
cmp dword [ebx + eax*4 + 4], edx
je 0x402294
inc eax
cmp eax, ecx
jne 0x401fcc
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], ecx
cmp eax, 0x3f
ja 0x40200a
mov eax, dword [esp + 0x388]
mov ecx, dword [esp + 0x38]
mov dword [esp + ecx*4 + 0x260], eax
mov ecx, dword [esp + 0x3c]
inc ecx
mov dword [esp + 0x25c], ecx
cmp edx, dword [esp + 0x388]
jb 0x402210
mov ecx, 1
test ebp, ebp
js 0x4022f6
lea eax, [esp + 0x4c]
mov dword [esp + 0x2c], eax
inc edx
mov dword [esp + 0x3c], esi
mov esi, edx
jmp 0x4020d1
lea edx, [esp + 0x158]
mov eax, dword [esp + 0x54]
test eax, eax
je 0x402131
lea eax, [esp + 0x54]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.WS2_32.dll_select
sub esp, 0x14
cmp eax, 0xffffffff
jne 0x40214c
call sub.WS2_32.dll_WSAGetLastError
test eax, eax
je 0x402099
mov ecx, dword [0x65c010]
test ecx, ecx
jne 0x402314
cmp eax, 0x2714
jne 0x402314
test ebp, ebp
jle 0x4020ca
call fcn.0040fd14
mov ecx, dword [esp + 0x30]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0xc], ecx
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040fd4c
mov edi, ebp
sub edi, eax
test edi, edi
jle 0x402284
mov ecx, dword [esp + 0x158]
cmp ebp, 0
jle 0x402138
mov eax, 0x10624dd3
imul edi
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
sar edx, 6
mov dword [esp + 0x38], edx
mov eax, edi
cdq
sub dword [esp + 0x38], edx
mov edx, dword [esp + 0x38]
mov dword [esp + 0x4c], edx
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
mov edx, edi
sub edx, eax
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
mov dword [esp + 0x50], eax
test ecx, ecx
jne 0x402038
xor edx, edx
mov eax, dword [esp + 0x54]
test eax, eax
jne 0x40204b
xor eax, eax
jmp 0x40204f
jne 0x40211b
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 0
jmp 0x40211b
mov esi, dword [esp + 0x3c]
cmp eax, 0
jl 0x402314
je 0x402284
cmp dword [esp + 0x380], 0xffffffff
je 0x402224
lea eax, [esp + 0x54]
mov dword [esp + 4], eax
mov ecx, dword [esp + 0x380]
mov dword [esp], ecx
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
setne al
movzx eax, al
mov edi, eax
mov dword [esp + 4], ebx
mov ecx, dword [esp + 0x380]
mov dword [esp], ecx
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x402226
or edi, 4
cmp esi, 0xffffffff
jne 0x40222b
nop
cmp dword [esp + 0x388], 0xffffffff
je 0x40226d
lea eax, [esp + 0x158]
mov dword [esp + 4], eax
mov ecx, dword [esp + 0x388]
mov dword [esp], ecx
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x4021e6
or edi, 2
mov dword [esp + 4], ebx
mov ecx, dword [esp + 0x388]
mov dword [esp], ecx
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
mov eax, edi
je 0x402205
or eax, 4
add esp, 0x36c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x388]
jmp 0x402017
mov edx, esi
jmp 0x401f60
xor edi, edi
cmp esi, 0xffffffff
je 0x4021b4
lea eax, [esp + 0x54]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x402245
or edi, 8
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x4021b4
or edi, 4
cmp dword [esp + 0x388], 0xffffffff
jne 0x4021c2
mov eax, edi
add esp, 0x36c
pop ebx
pop esi
pop edi
pop ebp
ret
xor edi, edi
jmp 0x401e91
xor eax, eax
add esp, 0x36c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x2c]
cmp edx, dword [esp + 0x388]
jae 0x402017
jmp 0x402210
cmp esi, 0xffffffff
jne 0x401e7a
cmp dword [esp + 0x388], 0xffffffff
jne 0x401e7a
mov dword [esp], ebp
call fcn.00401e08
jmp 0x402205
mov edx, 0xffffffff
cmp esi, 0xffffffff
jne 0x401ee2
lea ebx, [esp + 0x25c]
jmp 0x401f60
xor ecx, ecx
test ebp, ebp
jns 0x402024
mov dword [esp + 0x2c], 0
jmp 0x40202c
xor eax, eax
mov dword [esp + eax*4 + 0x58], esi
inc ecx
mov dword [esp + 0x54], ecx
jmp 0x401f0c
mov eax, 0xffffffff
add esp, 0x36c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x38], 0
jmp 0x401fec
xor eax, eax
lea ebx, [esp + 0x25c]
jmp 0x401f48