Function at 0x40338c
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 0x4037f4
test ebp, ebp
jle 0x4037c4
call fcn.0041125c
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 0x403818
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 0x403826
mov ecx, dword [esp + 0x54]
test ecx, ecx
je 0x40384b
cmp dword [esp + 0x58], esi
je 0x403454
xor eax, eax
jmp 0x403446
cmp dword [esp + eax*4 + 0x58], esi
je 0x403454
inc eax
cmp eax, ecx
jne 0x403440
cmp eax, 0x3f
jbe 0x40384d
mov ecx, dword [esp + 0x25c]
test ecx, ecx
je 0x403879
lea ebx, [esp + 0x25c]
cmp dword [esp + 0x260], esi
je 0x4034a0
xor eax, eax
lea ebx, [esp + 0x25c]
jmp 0x403486
cmp dword [ebx + eax*4 + 4], esi
je 0x4034a0
inc eax
cmp eax, ecx
jne 0x403480
cmp eax, 0x3f
ja 0x4034a0
mov dword [esp + eax*4 + 0x260], esi
inc ecx
mov dword [esp + 0x25c], ecx
nop
cmp edx, esi
jb 0x403764
mov dword [esp + 0x158], 0
cmp dword [esp + 0x388], 0xffffffff
je 0x403834
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 0x40386c
cmp dword [esp + 0x260], ecx
je 0x403552
mov dword [esp + 0x38], 0
mov dword [esp + 0x2c], edx
xor eax, eax
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x388]
jmp 0x40351e
cmp dword [ebx + eax*4 + 4], edx
je 0x4037dc
inc eax
cmp eax, ecx
jne 0x403514
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], ecx
cmp eax, 0x3f
ja 0x403552
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 0x403758
mov ecx, 1
test ebp, ebp
js 0x40383e
lea eax, [esp + 0x4c]
mov dword [esp + 0x2c], eax
inc edx
mov dword [esp + 0x3c], esi
mov esi, edx
jmp 0x403619
lea edx, [esp + 0x158]
mov eax, dword [esp + 0x54]
test eax, eax
je 0x403679
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 0x403694
call sub.WS2_32.dll_WSAGetLastError
test eax, eax
je 0x4035e1
mov ecx, dword [0x65d010]
test ecx, ecx
jne 0x40385c
cmp eax, 0x2714
jne 0x40385c
test ebp, ebp
jle 0x403612
call fcn.0041125c
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.00411294
mov edi, ebp
sub edi, eax
test edi, edi
jle 0x4037cc
mov ecx, dword [esp + 0x158]
cmp ebp, 0
jle 0x403680
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 0x403580
xor edx, edx
mov eax, dword [esp + 0x54]
test eax, eax
jne 0x403593
xor eax, eax
jmp 0x403597
jne 0x403663
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 0
jmp 0x403663
mov esi, dword [esp + 0x3c]
cmp eax, 0
jl 0x40385c
je 0x4037cc
cmp dword [esp + 0x380], 0xffffffff
je 0x40376c
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 0x40376e
or edi, 4
cmp esi, 0xffffffff
jne 0x403773
nop
cmp dword [esp + 0x388], 0xffffffff
je 0x4037b5
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 0x40372e
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 0x40374d
or eax, 4
add esp, 0x36c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x388]
jmp 0x40355f
mov edx, esi
jmp 0x4034a8
xor edi, edi
cmp esi, 0xffffffff
je 0x4036fc
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 0x40378d
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 0x4036fc
or edi, 4
cmp dword [esp + 0x388], 0xffffffff
jne 0x40370a
mov eax, edi
add esp, 0x36c
pop ebx
pop esi
pop edi
pop ebp
ret
xor edi, edi
jmp 0x4033d9
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 0x40355f
jmp 0x403758
cmp esi, 0xffffffff
jne 0x4033c2
cmp dword [esp + 0x388], 0xffffffff
jne 0x4033c2
mov dword [esp], ebp
call fcn.00403350
jmp 0x40374d
mov edx, 0xffffffff
cmp esi, 0xffffffff
jne 0x40342a
lea ebx, [esp + 0x25c]
jmp 0x4034a8
xor ecx, ecx
test ebp, ebp
jns 0x40356c
mov dword [esp + 0x2c], 0
jmp 0x403574
xor eax, eax
mov dword [esp + eax*4 + 0x58], esi
inc ecx
mov dword [esp + 0x54], ecx
jmp 0x403454
mov eax, 0xffffffff
add esp, 0x36c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x38], 0
jmp 0x403534
xor eax, eax
lea ebx, [esp + 0x25c]
jmp 0x403490