Function at 0x10005160
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x33c
mov eax, dword [0x10033008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, edx
mov dword [ebp - 0x14], 0
mov eax, 0x10624dd3
mov dword [ebp - 0x10], 0
imul ebx
push esi
sar edx, 6
mov esi, ecx
mov eax, edx
mov dword [ebp - 0x334], esi
shr eax, 0x1f
mov ecx, ebx
add eax, edx
mov edx, dword [esi]
mov dword [ebp - 0xc], eax
imul eax, eax, 0x3e8
push edi
xor edi, edi
mov dword [ebp - 0x228], edi
mov dword [ebp - 0x330], edi
sub ecx, eax
mov dword [ebp - 0x120], edi
imul eax, ecx, 0x3e8
xor ecx, ecx
test ebx, ebx
mov dword [ebp - 8], eax
lea eax, [ebp - 0xc]
cmovs eax, ecx
mov dword [ebp - 0x338], eax
test edx, edx
je 0x10005324
nop dword [eax]
nop word [eax + eax]
and dword [edx + 0x8c], 0xfffcffff
mov ecx, dword [edx + 0x8c]
test ecx, 0x2008
jne 0x1000530e
mov esi, dword [edx + 0x30]
cmp esi, 0xffffffff
je 0x1000530e
mov eax, ecx
shr eax, 0xe
not al
test al, 1
jne 0x1000523a
test cl, 0x20
jne 0x1000523a
cmp dword [edx + 0x50], 0
jbe 0x1000530e
test cl, cl
js 0x1000530e
mov ecx, dword [ebp - 0x120]
xor eax, eax
test ecx, ecx
je 0x10005254
cmp dword [ebp + eax*4 - 0x11c], esi
je 0x10005254
inc eax
cmp eax, ecx
jb 0x10005246
cmp eax, ecx
jne 0x1000526a
cmp ecx, 0x40
jae 0x1000526a
mov dword [ebp + eax*4 - 0x11c], esi
inc dword [ebp - 0x120]
mov eax, dword [edx + 0x8c]
shr eax, 0xe
not al
test al, 1
je 0x100052b7
mov eax, dword [ebp - 0x228]
xor ecx, ecx
test eax, eax
je 0x1000529e
mov esi, dword [edx + 0x30]
nop dword [eax + eax]
cmp dword [ebp + ecx*4 - 0x224], esi
je 0x1000529e
inc ecx
cmp ecx, eax
jb 0x10005290
cmp ecx, eax
jne 0x100052b7
cmp eax, 0x40
jae 0x100052b7
mov eax, dword [edx + 0x30]
mov dword [ebp + ecx*4 - 0x224], eax
inc dword [ebp - 0x228]
mov eax, dword [edx + 0x8c]
test al, 0x20
jne 0x100052cb
cmp dword [edx + 0x50], 0
jbe 0x10005307
test al, al
js 0x10005307
mov ecx, dword [ebp - 0x330]
xor eax, eax
test ecx, ecx
je 0x100052ee
mov esi, dword [edx + 0x30]
nop word [eax + eax]
cmp dword [ebp + eax*4 - 0x32c], esi
je 0x100052ee
inc eax
cmp eax, ecx
jb 0x100052e0
cmp eax, ecx
jne 0x10005307
cmp ecx, 0x40
jae 0x10005307
mov ecx, dword [edx + 0x30]
mov dword [ebp + eax*4 - 0x32c], ecx
inc dword [ebp - 0x330]
cmp dword [edx + 0x30], edi
cmova edi, dword [edx + 0x30]
mov edx, dword [edx]
test edx, edx
jne 0x100051f0
mov esi, dword [ebp - 0x334]
mov eax, dword [ebp - 0x338]
push eax
lea eax, [ebp - 0x120]
push eax
lea eax, [ebp - 0x330]
push eax
lea eax, [ebp - 0x228]
push eax
lea eax, [edi + 1]
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jns 0x10005371
test edi, edi
jne 0x10005353
push ebx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x330], 0
mov dword [ebp - 0x120], 0
mov esi, dword [esi]
test esi, esi
je 0x10005415
mov edi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x100053a7
lea ecx, [ebp - 0x120]
push ecx
push eax
call edi
test eax, eax
je 0x100053a7
push str.socket_error
push esi
call fcn.10001af0
add esp, 8
jmp 0x1000540b
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x100053c4
lea ecx, [ebp - 0x228]
push ecx
push eax
call edi
test eax, eax
je 0x100053c4
mov ecx, 0x10000
jmp 0x100053c6
xor ecx, ecx
mov eax, dword [esi + 0x8c]
and eax, 0xfffeffff
or eax, ecx
mov dword [esi + 0x8c], eax
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x100053f6
lea ecx, [ebp - 0x330]
push ecx
push eax
call edi
test eax, eax
je 0x100053f6
mov ecx, 0x20000
jmp 0x100053f8
xor ecx, ecx
mov eax, dword [esi + 0x8c]
and eax, 0xfffdffff
or eax, ecx
mov dword [esi + 0x8c], eax
mov esi, dword [esi]
test esi, esi
jne 0x10005381
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100127b8
mov esp, ebp
pop ebp
ret