Function at 0x407570
Capabilities:
Get socket status

Disassembly:
sub esp, 0x32c
mov eax, dword [0x45f060]
xor eax, esp
mov dword [esp + 0x328], eax
push ebx
push ebp
mov ebp, dword [esp + 0x348]
xor eax, eax
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
push edi
test ebp, ebp
jl 0x4075c2
jg 0x4075b9
mov edi, dword [esp + 0x348]
cmp edi, 0x7fffffff
jb 0x4075c9
mov edi, accept
xor ebp, ebp
jmp 0x4075c9
mov edi, dword [esp + 0x348]
mov eax, dword [esp + 0x33c]
mov ebx, dword [esp + 0x340]
cmp eax, 0xffffffff
jne 0x407636
cmp ebx, 0xffffffff
jne 0x407636
cmp dword [esp + 0x344], ebx
jne 0x407636
test edi, edi
je 0x40761c
jns 0x407615
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
pop edi
pop ebp
or eax, ebx
pop ebx
mov ecx, dword [esp + 0x328]
xor ecx, esp
call fcn.0042faff
add esp, 0x32c
ret
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x328]
xor ecx, esp
call fcn.0042faff
add esp, 0x32c
ret
test ebp, ebp
jl 0x407658
jg 0x407640
test edi, edi
je 0x407658
mov dword [esp + 0xc], edi
call fcn.00404c50
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x33c]
mov dword [esp + 0x14], edx
push esi
xor ecx, ecx
xor esi, esi
or edx, 0xffffffff
mov dword [esp + 0x234], ecx
mov dword [esp + 0x2c], esi
cmp eax, 0xffffffff
je 0x40768f
mov esi, 1
mov dword [esp + 0x30], eax
mov ecx, esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x238], eax
mov edx, eax
mov dword [esp + 0x234], ecx
cmp ebx, 0xffffffff
je 0x4076f9
xor eax, eax
test esi, esi
je 0x4076ab
nop word [eax + eax]
cmp dword [esp + eax*4 + 0x30], ebx
je 0x4076ab
inc eax
cmp eax, esi
jb 0x4076a0
cmp eax, esi
jne 0x4076c1
cmp esi, 0x40
jae 0x4076c1
mov dword [esp + eax*4 + 0x30], ebx
mov esi, dword [esp + 0x2c]
inc esi
mov dword [esp + 0x2c], esi
xor eax, eax
test ecx, ecx
je 0x4076d5
cmp dword [esp + eax*4 + 0x238], ebx
je 0x4076d5
inc eax
cmp eax, ecx
jb 0x4076c7
cmp eax, ecx
jne 0x4076f4
cmp ecx, 0x40
jae 0x4076f4
mov dword [esp + eax*4 + 0x238], ebx
mov ecx, dword [esp + 0x234]
inc ecx
mov dword [esp + 0x234], ecx
cmp ebx, edx
cmova edx, ebx
mov eax, dword [esp + 0x348]
mov dword [esp + 0x130], 0
cmp eax, 0xffffffff
je 0x407772
mov dword [esp + 0x134], eax
xor eax, eax
mov dword [esp + 0x130], 1
test ecx, ecx
je 0x407745
mov ebx, dword [esp + 0x348]
nop
cmp dword [esp + eax*4 + 0x238], ebx
je 0x40773e
inc eax
cmp eax, ecx
jb 0x407730
mov ebx, dword [esp + 0x344]
cmp eax, ecx
jne 0x407763
cmp ecx, 0x40
jae 0x407763
mov ecx, dword [esp + 0x348]
mov dword [esp + eax*4 + 0x238], ecx
inc dword [esp + 0x234]
cmp dword [esp + 0x348], edx
cmova edx, dword [esp + 0x348]
test ebp, ebp
jg 0x407786
jl 0x40777c
test edi, edi
jae 0x407786
mov dword [esp + 0x14], 0
jmp 0x40778e
lea eax, [esp + 0x20]
mov dword [esp + 0x14], eax
lea eax, [edx + 1]
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x10]
nop dword [eax]
test ebp, ebp
jl 0x4077d3
jg 0x4077aa
test edi, edi
je 0x4077d3
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x20], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [esp + 0x24], eax
jmp 0x4077e1
mov eax, edi
or eax, ebp
jne 0x4077e1
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
push dword [esp + 0x14]
xor ecx, ecx
lea eax, [esp + 0x238]
cmp dword [esp + 0x134], ecx
push eax
lea eax, [esp + 0x138]
cmove eax, ecx
test esi, esi
push eax
lea eax, [esp + 0x38]
cmove eax, ecx
push eax
push dword [esp + 0x38]
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x407875
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x407834
cmp dword [0x4600a0], 0
jne 0x407879
cmp eax, 0x2714
jne 0x407879
test ebp, ebp
jl 0x407840
jg 0x407849
test edi, edi
jne 0x407849
nop
mov esi, dword [esp + 0x2c]
jmp 0x407795
push dword [esp + 0x18]
push dword [esp + 0x20]
call fcn.00404c50
push edx
push eax
call fcn.00404bb0
mov ecx, edi
add esp, 0x10
sub ecx, eax
mov dword [esp + 0x10], ecx
test ecx, ecx
jle 0x407883
mov esi, dword [esp + 0x2c]
jmp 0x4077a0
test eax, eax
jns 0x407881
or eax, 0xffffffff
jmp 0x407926
jne 0x40788a
xor eax, eax
jmp 0x407926
mov edi, dword [esp + 0x340]
xor esi, esi
cmp edi, 0xffffffff
je 0x4078c2
lea eax, [esp + 0x2c]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
mov ecx, 1
lea eax, [esp + 0x234]
push eax
push edi
cmovne esi, ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4078c2
or esi, 4
cmp ebx, 0xffffffff
je 0x4078ee
lea eax, [esp + 0x2c]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4078d9
or esi, 8
lea eax, [esp + 0x234]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4078ee
or esi, 4
mov ebx, dword [esp + 0x348]
cmp ebx, 0xffffffff
je 0x407924
lea eax, [esp + 0x130]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40790f
or esi, 2
lea eax, [esp + 0x234]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x407924
or esi, 4
mov eax, esi
mov ecx, dword [esp + 0x338]
pop esi
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.0042faff
add esp, 0x32c
ret