Function at 0x40d520
Capabilities:
Inspect section memory permissions

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
xor eax, eax
xor ecx, ecx
push ebx
cpuid
mov esi, ebx
xor edi, edi
pop ebx
nop
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
mov dword [ebx + 4], esi
mov dword [ebx + 8], ecx
mov dword [ebx + 0xc], edx
mov eax, dword [ebp - 0x18]
mov dword [ebp - 4], eax
cmp eax, 1
jb 0x40d80a
mov eax, 1
xor ecx, ecx
push ebx
cpuid
mov esi, ebx
pop ebx
nop
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
mov dword [ebx + 4], esi
mov dword [ebx + 8], ecx
mov dword [ebx + 0xc], edx
mov eax, dword [ebp - 0xc]
and eax, 0x6000000
cmp eax, 0x6000000
jne 0x40d7b5
mov ebx, dword [ebp - 0x10]
mov ecx, ebx
shr ecx, 0x19
and ecx, 1
or ecx, 0x4000000
mov edi, ecx
or edi, 2
test bl, 2
cmove edi, ecx
test bl, 1
je 0x40d7b5
or edi, 4
test ebx, 0x200
je 0x40d7b5
or edi, 8
test ebx, 0x80000
je 0x40d7b5
or edi, 0x10
test ebx, 0x100000
je 0x40d7b5
mov ecx, ebx
mov eax, ebx
and ecx, 0x400000
or ecx, 0x2000
shr ecx, 8
or ecx, edi
mov edi, ecx
or edi, 0x40
test ebx, 0x800000
cmove edi, ecx
and eax, 0x18000000
mov esi, edi
cmp eax, 0x18000000
jne 0x40d7b5
call dword [sym.imp.KERNEL32.dll_GetEnabledXStateFeatures]
and eax, 4
xor edx, edx
or eax, edx
je 0x40d7b5
xor ecx, ecx
xgetbv
and eax, 6
cmp eax, 6
jne 0x40d7b5
or edi, 0x80
test ebx, 0x1000
je 0x40d643
mov edi, esi
or edi, 0x180
mov eax, dword [ebp - 4]
cmp eax, 7
jb 0x40d80a
mov eax, 7
xor ecx, ecx
push ebx
cpuid
mov esi, ebx
pop ebx
nop
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
mov dword [ebx + 4], esi
mov dword [ebx + 8], ecx
mov dword [ebx + 0xc], edx
mov ebx, dword [ebp - 0x14]
test bl, 0x20
je 0x40d7b5
or edi, 0x8000200
mov esi, edi
call dword [sym.imp.KERNEL32.dll_GetEnabledXStateFeatures]
and eax, 0xe0
xor edx, edx
or eax, edx
je 0x40d722
xor ecx, ecx
xgetbv
and eax, 0xe6
cmp eax, 0xe6
jne 0x40d722
test ebx, 0x10000
je 0x40d722
or edi, 0x10008000
test ebx, ebx
jns 0x40d6bf
mov edi, esi
or edi, 0x10018000
mov eax, ebx
shr eax, 0x1f
test ebx, 0x40000000
je 0x40d6dc
or edi, 0x20000
test al, al
je 0x40d6dc
or edi, 0x40000
test ebx, 0x10000000
je 0x40d6f4
or edi, 0x80000
test al, al
je 0x40d6f4
or edi, 0x100000
test ebx, 0x20000
je 0x40d70c
or edi, 0x200000
test al, al
je 0x40d70c
or edi, 0x400000
test byte [ebp - 0x10], 2
je 0x40d722
or edi, 0x800000
test al, al
je 0x40d722
or edi, 0x1000000
mov eax, 7
mov ecx, 1
push ebx
cpuid
mov esi, ebx
pop ebx
nop
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
mov dword [ebx + 4], esi
mov dword [ebx + 8], ecx
mov ecx, edi
or ecx, 0x2000
mov dword [ebx + 0xc], edx
test byte [ebp - 0x18], 0x10
cmove ecx, edi
test dword [ebp - 0xc], 0x80000
mov edi, ecx
mov dword [ebp - 8], edi
je 0x40d7b5
mov edi, ebx
mov eax, 0x24
xor ecx, ecx
push ebx
cpuid
mov esi, ebx
pop ebx
nop
mov dword [edi], eax
mov dword [edi + 4], esi
mov dword [edi + 8], ecx
mov ecx, dword [ebp - 8]
mov dword [edi + 0xc], edx
mov edi, ecx
mov edx, dword [ebp - 0x14]
cmp dl, 1
jb 0x40d7b5
test edx, 0x10000
je 0x40d794
or ecx, 0x20000000
mov edi, ecx
or edi, 0x40000000
test edx, 0x20000
cmove edi, ecx
test edx, 0x40000
je 0x40d7b5
or edi, 0x80000000
jmp 0x40d7bd
mov eax, dword [ebp - 4]
cmp eax, 7
jb 0x40d80a
mov eax, 7
xor ecx, ecx
push ebx
cpuid
mov esi, ebx
pop ebx
nop
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
mov dword [ebx + 4], esi
mov dword [ebx + 8], ecx
mov ecx, edi
or ecx, 0x400
mov dword [ebx + 0xc], edx
mov edx, dword [ebp - 0x14]
test dl, 8
cmove ecx, edi
mov edi, ecx
or edi, 0x800
test edx, 0x100
cmove edi, ecx
test dword [ebp - 0xc], 0x4000
je 0x40d80a
or edi, 0x2000000
mov eax, 0x80000000
xor ecx, ecx
push ebx
cpuid
mov esi, ebx
pop ebx
nop
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
mov dword [ebx + 4], esi
mov dword [ebx + 8], ecx
mov dword [ebx + 0xc], edx
cmp dword [ebp - 0x18], 0x80000001
jb 0x40d857
mov eax, 0x80000001
xor ecx, ecx
push ebx
cpuid
mov esi, ebx
pop ebx
nop
lea ebx, [ebp - 0x18]
mov dword [ebx], eax
mov dword [ebx + 4], esi
mov dword [ebx + 8], ecx
mov dword [ebx + 0xc], edx
test byte [ebp - 0x10], 0x20
je 0x40d857
or edi, 0x1000
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret