Function at 0x471a40
Capabilities:
Inspect section memory permissions

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
xor eax, eax
mov dword [ebp - 0x10], 0
push ebx
mov ebx, dword [ebp + 0xc]
test bl, 1
push esi
push edi
mov edi, ecx
mov ecx, 3
cmovne eax, ecx
test bl, 2
mov ecx, 1
cmovne eax, ecx
mov ecx, ebx
and ecx, 4
mov dword [ebp - 0x10], ecx
mov ecx, 4
cmovne eax, ecx
test bl, 8
mov ecx, 2
cmovne eax, ecx
mov dword [ebp + 0xc], eax
test bl, 0x10
je 0x471a99
mov dword [ebp + 0xc], 5
jmp 0x471aa1
test eax, eax
je 0x471ca4
xor edx, edx
mov esi, 0x40000000
test bl, 0x40
mov eax, 4
cmovne edx, esi
test bl, 0x80
cmovne edx, eax
test bl, 0x20
je 0x471ac4
or edx, 0x80000000
test ebx, 0x4000
je 0x471ad2
or edx, 0x100
test ebx, 0x40000
je 0x471ae0
or edx, 0x20000000
mov ecx, ebx
shr ecx, 8
not ecx
and ecx, 1
test ebx, 0x200
jne 0x471af5
or ecx, 2
test ebx, 0x8000
je 0x471aff
or ecx, eax
xor eax, eax
test ebx, 0x400
cmovne eax, esi
test ebx, 0x800
je 0x471b17
or eax, 0x100
test ebx, 0x1000
je 0x471b22
or eax, 2
test ebx, 0x2000
je 0x471b2f
or eax, 0x4000000
test ebx, 0x20000
je 0x471b3c
or eax, 0x2000000
mov esi, dword [ebp + 8]
cmp dword [esi + 0x14], 8
jb 0x471b47
mov esi, dword [esi]
push 0
push eax
push dword [ebp + 0xc]
push 0
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 8], esi
cmp dword [edi], esi
je 0x471c4e
call ecx
mov dword [ebp - 0xc], eax
mov eax, dword [edi]
mov dword [ebp - 4], eax
test eax, eax
je 0x471c1e
cmp eax, 0xffffffff
je 0x471c1e
call fcn.0046cb00
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 4]
mov ecx, dword [0x768f28]
mov dword [ebp + 8], eax
test ecx, ecx
jne 0x471bc7
call fcn.0046fd50
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x768f28], 0
jne 0x471bba
call fcn.0046f8e0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x768f28]
push dword [ebp + 0xc]
mov eax, dword [ecx]
push dword [ebp + 8]
push edi
push dword [ebp - 4]
call dword [eax + 8]
mov ecx, dword [0x768f28]
mov eax, dword [edi]
mov dword [ebp + 0xc], eax
test ecx, ecx
jne 0x471c0e
call fcn.0046fd50
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x768f28], 0
jne 0x471c01
call fcn.0046f8e0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x768f28]
mov eax, dword [ecx]
push dword [ebp + 0xc]
call dword [eax]
mov esi, dword [ebp - 8]
mov dword [edi], 0
test esi, esi
je 0x471c3f
cmp esi, 0xffffffff
je 0x471c3f
mov dword [edi], esi
call fcn.0046cb00
push eax
mov eax, dword [ebp + 4]
mov edx, edi
push eax
mov ecx, esi
call fcn.0046fc90
add esp, 8
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [edi]
test eax, eax
je 0x471c98
cmp eax, 0xffffffff
je 0x471c98
mov eax, ebx
mov dword [edi + 0x20], 0
shr eax, 0xa
and al, 1
cmp dword [ebp - 0x10], 0
mov byte [edi + 0x25], al
je 0x471c86
call ecx
cmp eax, 0xb7
setne al
mov byte [edi + 0x24], al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
test bl, 0xa
je 0x471ca4
mov byte [edi + 0x24], 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
call ecx
mov ecx, eax
call fcn.00471770
mov dword [edi + 0x20], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8