Function at 0x401000
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x48], 0x14
push str.ADVAPI32
mov dword [ebp - 4], 0
mov dword [ebp - 0x58], edi
mov word [ebp - 0x54], 0x500
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov ebx, eax
test ebx, ebx
jne 0x401048
push str.ADVAPI32
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
je 0x4012d7
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.AllocateAndInitializeSid
push ebx
call esi
push str.FreeSid
push ebx
mov dword [ebp - 0x10], eax
call esi
push str.GetLengthSid
push ebx
mov dword [ebp - 0x34], eax
call esi
push str.ImpersonateSelf
push ebx
mov dword [ebp - 0x44], eax
call esi
push str.RevertToSelf
push ebx
mov dword [ebp - 0x3c], eax
call esi
push str.OpenProcessToken
push ebx
mov dword [ebp - 0xc], eax
call esi
push str.OpenThreadToken
push ebx
mov dword [ebp - 8], eax
call esi
push str.InitializeSecurityDescriptor
push ebx
mov dword [ebp - 0x40], eax
call esi
push str.InitializeAcl
push ebx
mov dword [ebp - 0x14], eax
call esi
push str.AddAccessAllowedAce
push ebx
mov dword [ebp - 0x18], eax
call esi
push str.SetSecurityDescriptorDacl
push ebx
mov dword [ebp - 0x1c], eax
call esi
push str.SetSecurityDescriptorOwner
push ebx
mov dword [ebp - 0x20], eax
call esi
push str.SetSecurityDescriptorGroup
push ebx
mov dword [ebp - 0x28], eax
call esi
push str.IsValidSecurityDescriptor
push ebx
mov dword [ebp - 0x24], eax
call esi
push str.AccessCheck
push ebx
mov dword [ebp - 0x2c], eax
call esi
mov ecx, eax
mov dword [ebp - 0x4c], ecx
cmp dword [ebp - 0x10], edi
je 0x4012d7
cmp dword [ebp - 0x34], edi
je 0x4012d7
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x4012d7
cmp dword [ebp - 0xc], edi
je 0x4012d7
cmp dword [ebp - 8], edi
je 0x4012d7
mov esi, dword [ebp - 0x40]
test esi, esi
je 0x4012d7
cmp dword [ebp - 0x14], edi
je 0x4012d7
cmp dword [ebp - 0x18], edi
je 0x4012d7
cmp dword [ebp - 0x1c], edi
je 0x4012d7
cmp dword [ebp - 0x20], edi
je 0x4012d7
cmp dword [ebp - 0x28], edi
je 0x4012d7
cmp dword [ebp - 0x24], edi
je 0x4012d7
cmp dword [ebp - 0x2c], edi
je 0x4012d7
test ecx, ecx
je 0x4012d7
push 2
mov dword [ebp - 0x38], edi
call eax
lea eax, [ebp - 0x30]
push eax
push 0
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
jne 0x4011c1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3f0
jne 0x4012af
lea eax, [ebp - 0x30]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [ebp - 8]
test eax, eax
je 0x4012af
lea eax, [ebp - 4]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0x220
push 0x20
push 2
lea eax, [ebp - 0x58]
push eax
call dword [ebp - 0x10]
test eax, eax
je 0x4012af
push 0x14
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
test edi, edi
je 0x4012af
push 1
push edi
call dword [ebp - 0x14]
test eax, eax
je 0x4012af
push dword [ebp - 4]
call dword [ebp - 0x44]
lea esi, [eax + 0x10]
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 8], eax
test eax, eax
je 0x4012aa
push 2
push esi
push eax
call dword [ebp - 0x18]
mov esi, dword [ebp - 8]
test eax, eax
je 0x4012b1
push dword [ebp - 4]
push 3
push 2
push esi
call dword [ebp - 0x1c]
test eax, eax
je 0x4012b1
push 0
push esi
push 1
push edi
call dword [ebp - 0x20]
test eax, eax
je 0x4012b1
push 0
push dword [ebp - 4]
push edi
call dword [ebp - 0x24]
push 0
push dword [ebp - 4]
push edi
call dword [ebp - 0x28]
push edi
call dword [ebp - 0x2c]
test eax, eax
je 0x4012b1
lea eax, [ebp - 0x38]
mov dword [ebp - 0x68], 1
push eax
lea eax, [ebp - 0x50]
mov dword [ebp - 0x64], 2
push eax
lea eax, [ebp - 0x48]
mov dword [ebp - 0x60], 0
push eax
lea eax, [ebp - 0x7c]
mov dword [ebp - 0x5c], 3
push eax
lea eax, [ebp - 0x68]
push eax
push 1
push dword [ebp - 0x30]
push edi
call dword [ebp - 0x4c]
call dword [ebp - 0xc]
jmp 0x4012b8
mov esi, dword [ebp - 8]
jmp 0x4012b1
xor esi, esi
call dword [ebp - 0xc]
test esi, esi
je 0x4012bb
push esi
call ebx
test edi, edi
je 0x4012c2
push edi
call ebx
mov eax, dword [ebp - 4]
test eax, eax
je 0x4012cd
push eax
call dword [ebp - 0x34]
mov eax, dword [ebp - 0x38]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret