Function at 0x10012140
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x324
mov eax, dword [0x100b3400]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
mov eax, 0x10624dd3
imul ebx
mov ecx, ebx
mov dword [ebp - 0x31c], ebx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0xc], eax
imul eax, eax, 0x3e8
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
mov dword [ebp - 0x320], esi
sub ecx, eax
mov dword [ebp - 0x214], edi
mov edx, dword [esi]
imul eax, ecx, 0x3e8
xor ecx, ecx
test ebx, ebx
mov dword [ebp - 0x318], edi
mov dword [ebp - 0x110], edi
mov dword [ebp - 8], eax
lea eax, [ebp - 0xc]
cmovs eax, ecx
mov dword [ebp - 0x324], eax
test edx, edx
je 0x100122fd
nop dword [eax]
mov ecx, dword [edx + 0x8c]
and ecx, 0xfffcffff
mov dword [edx + 0x8c], ecx
test ecx, 0x2008
jne 0x100122e1
mov esi, dword [edx + 0x30]
cmp esi, 0xffffffff
je 0x100122e1
mov eax, ecx
shr eax, 0xe
not al
test al, 1
jne 0x1001220c
test cl, 0x20
jne 0x1001220c
cmp dword [edx + 0x50], 0
jbe 0x100122e1
test cl, cl
js 0x100122e1
mov ecx, dword [ebp - 0x110]
xor eax, eax
test ecx, ecx
je 0x1001222e
nop dword [eax + eax]
cmp dword [ebp + eax*4 - 0x10c], esi
je 0x1001222e
inc eax
cmp eax, ecx
jb 0x10012220
cmp eax, ecx
jne 0x10012244
cmp ecx, 0x40
jae 0x10012244
mov dword [ebp + eax*4 - 0x10c], esi
inc dword [ebp - 0x110]
mov ecx, dword [edx + 0x8c]
mov eax, ecx
shr eax, 0xe
mov ebx, ecx
not al
test al, 1
je 0x10012295
mov eax, dword [ebp - 0x214]
xor ecx, ecx
test eax, eax
je 0x10012274
mov esi, dword [edx + 0x30]
cmp dword [ebp + ecx*4 - 0x210], esi
je 0x10012274
inc ecx
cmp ecx, eax
jb 0x10012266
cmp ecx, eax
jne 0x1001228d
cmp eax, 0x40
jae 0x1001228d
mov eax, dword [edx + 0x30]
mov dword [ebp + ecx*4 - 0x210], eax
inc dword [ebp - 0x214]
mov ecx, dword [edx + 0x8c]
mov ebx, ecx
test bl, 0x20
jne 0x100122a4
cmp dword [edx + 0x50], 0
jbe 0x100122da
test cl, cl
js 0x100122da
mov ecx, dword [ebp - 0x318]
xor eax, eax
test ecx, ecx
je 0x100122c1
mov esi, dword [edx + 0x30]
cmp dword [ebp + eax*4 - 0x314], esi
je 0x100122c1
inc eax
cmp eax, ecx
jb 0x100122b3
cmp eax, ecx
jne 0x100122da
cmp ecx, 0x40
jae 0x100122da
mov ecx, dword [edx + 0x30]
mov dword [ebp + eax*4 - 0x314], ecx
inc dword [ebp - 0x318]
cmp dword [edx + 0x30], edi
cmova edi, dword [edx + 0x30]
mov edx, dword [edx]
test edx, edx
jne 0x100121c0
mov ebx, dword [ebp - 0x31c]
mov esi, dword [ebp - 0x320]
mov eax, dword [ebp - 0x324]
push eax
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x318]
push eax
lea eax, [ebp - 0x214]
push eax
lea eax, [edi + 1]
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jns 0x1001234a
test edi, edi
jne 0x1001232c
push ebx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [ebp - 0x214], 0
mov dword [ebp - 0x318], 0
mov dword [ebp - 0x110], 0
mov esi, dword [esi]
test esi, esi
je 0x100123f1
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x1001237d
lea ecx, [ebp - 0x110]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x1001237d
push str.socket_error
push esi
call fcn.10012bd0
add esp, 8
jmp 0x100123e7
mov eax, dword [esi + 0x30]
cmp eax, 0xffffffff
je 0x1001239d
lea ecx, [ebp - 0x214]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x1001239d
mov ecx, 0x10000
jmp 0x1001239f
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 0x100123d2
lea ecx, [ebp - 0x318]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x100123d2
mov ecx, 0x20000
jmp 0x100123d4
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 0x10012354
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1003bac5
mov esp, ebp
pop ebp
ret