Function at 0x40c510
Capabilities:
Check os version

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x140
mov eax, dword [0x46a180]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, ecx
push ebx
push esi
mov esi, dword [ebp + 8]
lea ebx, [eax + 0x24]
mov dword [ebp - 0x134], eax
mov eax, dword [ebx]
mov dword [ebp - 0x12c], esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
je 0x40c54f
push eax
call edi
mov dword [ebx], 0
mov ebx, dword [ebp - 0x134]
add ebx, 0x28
mov eax, dword [ebx]
test eax, eax
je 0x40c567
push eax
call edi
mov dword [ebx], 0
mov eax, dword [ebp + 0xc]
push 1
push eax
mov dword [ebp - 0x138], 0
mov dword [ebp - 0x140], 0
mov dword [ebp - 0x13c], 0
mov dword [esi], 0xc
mov dword [esi + 8], 0
mov dword [esi + 4], eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x40c7e4
push pe_nt_image_headers32
lea eax, [ebp - 0x11c]
push 0
push eax
call fcn.00432ee0
add esp, 0xc
mov dword [ebp - 0x120], 0x11c
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
jne 0x40c5f9
lea eax, [ebp - 0x120]
mov dword [ebp - 0x120], 0x114
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x40c75f
cmp dword [ebp - 0x11c], 6
jb 0x40c75f
cmp dword [ebp - 0x118], 2
jb 0x40c75f
test ebx, ebx
je 0x40c75f
lea eax, [ebp - 0x124]
mov dword [ebx], 0
push eax
push str.S_1_1_0
mov dword [ebp - 0x130], 0
xor esi, esi
mov dword [ebp - 0x124], 0
mov dword [ebp - 0x128], 0
call sub.ADVAPI32.dll_ConvertStringSidToSidW
test eax, eax
je 0x40c72f
mov eax, dword [ebp - 0x124]
test eax, eax
je 0x40c72f
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x40c72f
lea eax, [ebp - 0x128]
push eax
push str.S_1_15_2_1
call sub.ADVAPI32.dll_ConvertStringSidToSidW
test eax, eax
je 0x40c72f
mov eax, dword [ebp - 0x128]
test eax, eax
je 0x40c72f
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x40c72f
push dword [ebp - 0x128]
mov edi, dword [sym.imp.ADVAPI32.dll_GetLengthSid]
call edi
push dword [ebp - 0x124]
mov esi, eax
call edi
lea edi, [eax + 0x18]
add edi, esi
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x40c729
push 2
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x40c729
push dword [ebp - 0x124]
mov edi, dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
push 0x10000000
push 2
push esi
call edi
test eax, eax
je 0x40c729
push dword [ebp - 0x128]
push 0x10000000
push 2
push esi
call edi
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
je 0x40c72f
mov dword [ebx], esi
mov dword [ebp - 0x130], 1
jmp 0x40c72f
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x124]
test eax, eax
je 0x40c73c
push eax
call edi
mov eax, dword [ebp - 0x128]
test eax, eax
je 0x40c749
push eax
call edi
cmp dword [ebp - 0x130], 0
jne 0x40c759
test esi, esi
je 0x40c759
push esi
call edi
mov esi, dword [ebp - 0x12c]
push 0
push dword [ebx]
push 1
push dword [esi + 4]
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x40c7e4
mov edi, dword [ebp - 0x134]
push 0
add edi, 0x24
push edi
push 1
push str.S:_ML__NW___LW_
call sub.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW
test eax, eax
jne 0x40c7a6
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004312d2
mov esp, ebp
pop ebp
ret 8
lea eax, [ebp - 0x13c]
push eax
lea eax, [ebp - 0x138]
push eax
lea eax, [ebp - 0x140]
push eax
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorSacl]
test eax, eax
je 0x40c7e4
push 0
push dword [ebp - 0x138]
push 1
push dword [esi + 4]
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorSacl]
test eax, eax
mov ecx, 1
cmovne eax, ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004312d2
mov esp, ebp
pop ebp
ret 8