Function at 0x40d640
Capabilities:
Link many functions at runtime

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x4f9748
push 0x4a2330
mov eax, dword fs:[0]
push eax
sub esp, 8
push ebx
sub esp, 0x178
mov eax, dword [0x50e008]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x24], eax
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov eax, dword [ebx + 8]
mov dword [ebp - 0x184], eax
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x190], eax
mov dword [ebp - 0x158], 0
xor esi, esi
mov dword [ebp - 0x18c], esi
mov dword [ebp - 0x154], esi
xor eax, eax
mov dword [ebp - 0x180], eax
mov dword [ebp - 0x188], eax
mov dword [ebp - 0x2c], eax
mov word [ebp - 0x28], 0x100
mov eax, dword [ecx]
mov edi, dword [eax + 0x28]
mov dword [ebp - 0x194], edi
test edi, edi
jne 0x40d6e3
xor eax, eax
jmp 0x40d970
mov dword [ebp - 4], esi
push str.InitializeSecurityDescriptor
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40d91a
push 1
push dword [ebp - 0x184]
call eax
test eax, eax
je 0x40d91a
push str.AllocateAndInitializeSid
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40d91a
lea ecx, [ebp - 0x158]
push ecx
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 1
lea ecx, [ebp - 0x2c]
push ecx
call eax
test eax, eax
je 0x40d91a
push str.GetLengthSid
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40d91a
push dword [ebp - 0x158]
call eax
add eax, 0x10
mov dword [ebp - 0x17c], eax
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
mov dword [ebp - 0x18c], esi
test esi, esi
je 0x40d91a
push str.InitializeAcl
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40d91a
push 2
push dword [ebp - 0x17c]
push esi
call eax
test eax, eax
je 0x40d91a
push str.AddAccessAllowedAce
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40d91a
push dword [ebp - 0x158]
push 0x10000000
push 2
push esi
call eax
test eax, eax
je 0x40d91a
push str.SetSecurityDescriptorDacl
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
mov dword [ebp - 0x17c], ecx
test ecx, ecx
je 0x40d91a
cmp byte [ebx + 0xc], 0
je 0x40d89e
lea ecx, [ebp - 0x150]
call fcn.00414e20
cmp dword [ebp - 0x14c], 6
ja 0x40d824
jne 0x40d898
cmp dword [ebp - 0x148], 2
jb 0x40d898
xorps xmm0, xmm0
movups xmmword [ebp - 0x178], xmm0
movups xmmword [ebp - 0x168], xmm0
mov dword [ebp - 0x178], 0x10000000
mov dword [ebp - 0x174], 2
mov dword [ebp - 0x170], 0
mov dword [ebp - 0x164], 1
mov dword [ebp - 0x160], 5
mov dword [ebp - 0x15c], str.ALL_APPLICATION_PACKAGES
push str.SetEntriesInAclW
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40d898
lea ecx, [ebp - 0x154]
push ecx
push esi
lea ecx, [ebp - 0x178]
push ecx
push 1
call eax
test eax, eax
jne 0x40d8e1
mov ecx, dword [ebp - 0x17c]
mov eax, dword [ebp - 0x154]
test eax, eax
je 0x40d8eb
push 0
push eax
push 1
push dword [ebp - 0x184]
call ecx
test eax, eax
je 0x40d8d5
mov ecx, 1
mov dword [ebp - 0x180], ecx
mov dword [ebp - 0x188], ecx
cmp dword [ebp - 0x154], 0
je 0x40d8eb
jmp 0x40d91c
push dword [ebp - 0x154]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x154], 0
push 0
push esi
push 1
push dword [ebp - 0x184]
call dword [ebp - 0x17c]
mov ecx, dword [ebp - 0x180]
mov edx, 1
test eax, eax
cmovne ecx, edx
mov dword [ebp - 0x180], ecx
mov dword [ebp - 0x188], ecx
jmp 0x40d91c
xor ecx, ecx
mov dword [ebp - 4], 0xfffffffe
call fcn.0040d9ab
test ecx, ecx
jne 0x40d95c
test esi, esi
je 0x40d941
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor esi, esi
mov eax, dword [ebp - 0x154]
test eax, eax
je 0x40d95c
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x154], 0
mov ecx, dword [ebp - 0x190]
test ecx, ecx
je 0x40d96e
mov eax, dword [ebp - 0x154]
mov dword [ecx], eax
mov eax, esi
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x24]
xor ecx, ebp
call fcn.004a100a
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 0xc