Function at 0x503520
Capabilities:
Get socket status

Disassembly:
sub esp, 0x334
mov eax, dword [0x6c45ac]
xor eax, esp
mov dword [esp + 0x330], eax
mov edx, dword [esp + 0x338]
mov dword [esp + 0x14], edx
push esi
test edx, edx
je 0x50355c
mov esi, dword [esp + 0x340]
xor eax, eax
test esi, esi
je 0x50355c
cmp dword [edx + eax*8], 0xffffffff
jne 0x5035aa
inc eax
cmp eax, esi
jb 0x503551
mov ecx, dword [esp + 0x344]
mov eax, ecx
mov edx, dword [esp + 0x348]
or eax, edx
je 0x503917
test edx, edx
jg 0x503903
jl 0x503586
test ecx, ecx
jae 0x5038f8
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop esi
mov ecx, dword [esp + 0x330]
xor ecx, esp
call fcn.00590be8
add esp, 0x334
ret
push ebx
push ebp
push edi
xor ebx, ebx
mov dword [esp + 0x10], 0xffffffff
xor ebp, ebp
mov dword [esp + 0x34], ebx
xor edi, edi
mov dword [esp + 0x138], ebp
xor eax, eax
mov dword [esp + 0x23c], edi
mov dword [esp + 0x14], eax
xor ecx, ecx
mov word [edx + eax*8 + 6], cx
mov ecx, dword [edx + eax*8]
cmp ecx, 0xffffffff
je 0x5036bd
jae 0x5036fb
movzx edx, word [edx + eax*8 + 4]
test dl, 7
je 0x5036b9
cmp ecx, dword [esp + 0x10]
mov eax, ecx
cmovbe eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
test dl, 1
je 0x503635
xor eax, eax
test ebx, ebx
je 0x50361f
cmp dword [esp + eax*4 + 0x38], ecx
je 0x50361f
inc eax
cmp eax, ebx
jb 0x503614
cmp eax, ebx
jne 0x503635
cmp ebx, 0x40
jae 0x503635
mov dword [esp + eax*4 + 0x38], ecx
mov ebx, dword [esp + 0x34]
inc ebx
mov dword [esp + 0x34], ebx
test dl, 4
je 0x50366d
xor eax, eax
test ebp, ebp
je 0x50364e
cmp dword [esp + eax*4 + 0x13c], ecx
je 0x50364e
inc eax
cmp eax, ebp
jb 0x503640
cmp eax, ebp
jne 0x50366d
cmp ebp, 0x40
jae 0x50366d
mov dword [esp + eax*4 + 0x13c], ecx
mov ebp, dword [esp + 0x138]
inc ebp
mov dword [esp + 0x138], ebp
test dl, 2
je 0x5036b5
xor eax, eax
test edi, edi
je 0x50368e
nop dword [eax + eax]
cmp dword [esp + eax*4 + 0x240], ecx
je 0x50368e
inc eax
cmp eax, edi
jb 0x503680
cmp eax, edi
jne 0x5036ad
cmp edi, 0x40
jae 0x5036ad
mov dword [esp + eax*4 + 0x240], ecx
mov edi, dword [esp + 0x23c]
inc edi
mov dword [esp + 0x23c], edi
mov eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x24]
inc eax
mov dword [esp + 0x14], eax
cmp eax, esi
jb 0x5035d3
test ebx, ebx
jne 0x503765
test ebp, ebp
jne 0x503765
test edi, edi
jne 0x503765
mov ecx, dword [esp + 0x350]
mov eax, ecx
mov edx, dword [esp + 0x354]
or eax, edx
jne 0x503722
jmp 0x503866
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop edi
pop ebp
pop ebx
pop esi
mov ecx, dword [esp + 0x330]
xor ecx, esp
call fcn.00590be8
add esp, 0x334
ret
test edx, edx
jg 0x50374a
jl 0x50372c
test ecx, ecx
jae 0x50373f
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
jmp 0x503866
test edx, edx
jl 0x503757
jg 0x50374a
cmp ecx, 0xffffffff
jb 0x503757
mov ecx, 0xfffffffe
mov dword [esp + 0x20], 0
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
jmp 0x503866
mov ecx, dword [esp + 0x354]
lea eax, [esp + 0x14]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x350]
test ecx, ecx
jg 0x5037a4
jl 0x503785
test eax, eax
jae 0x503792
mov dword [esp + 0x1c], 0
jmp 0x50382e
test ecx, ecx
jl 0x50381e
jg 0x5037a4
test eax, eax
je 0x50381e
push 0
push 0x3e8
push ecx
push eax
call fcn.00591830
push 0
push 0x3e8
mov esi, edx
mov dword [esp + 0x1c], eax
push esi
push eax
call fcn.00591d70
mov ecx, dword [esp + 0x350]
sub ecx, eax
mov eax, dword [esp + 0x354]
push 0
push 0x3e8
sbb eax, edx
push eax
push ecx
call fcn.00591d70
mov ecx, eax
test esi, esi
jl 0x503810
jg 0x5037f9
mov eax, dword [esp + 0x14]
cmp eax, 0x7fffffff
jbe 0x503814
mov eax, accept
mov dword [esp + 0x30], 0
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
jmp 0x50382e
mov eax, dword [esp + 0x14]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
jmp 0x50382e
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0
push dword [esp + 0x1c]
xor eax, eax
lea edx, [esp + 0x240]
test edi, edi
lea ecx, [esp + 0x13c]
cmove edx, eax
test ebp, ebp
push edx
cmove ecx, eax
xor esi, esi
test ebx, ebx
lea eax, [esp + 0x3c]
push ecx
cmove eax, esi
push eax
mov eax, dword [esp + 0x20]
inc eax
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x503709
mov esi, dword [esp + 0x24]
xor edi, edi
mov ebx, dword [esp + 0x34c]
add esi, 6
nop
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x5038e9
lea ecx, [esp + 0x34]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x5038a6
test byte [esi - 2], 1
je 0x5038a6
or word [esi], 1
lea eax, [esp + 0x138]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x5038c4
test byte [esi - 2], 4
je 0x5038c4
or word [esi], 4
lea eax, [esp + 0x23c]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x5038e2
test byte [esi - 2], 2
je 0x5038e2
or word [esi], 2
cmp word [esi], 0
je 0x5038e9
inc edi
add esi, 8
sub ebx, 1
jne 0x503880
mov eax, edi
jmp 0x503709
test edx, edx
jl 0x503910
jg 0x503903
cmp ecx, 0xffffffff
jb 0x503910
mov ecx, 0xfffffffe
mov dword [esp + 0x1c], 0
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x334]
xor eax, eax
pop esi
xor ecx, esp
call fcn.00590be8
add esp, 0x334
ret