Function at 0x401540
Capabilities:
Create directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x413808
mov eax, dword fs:[0]
push eax
sub esp, 0x7c
mov eax, dword [0x41c004]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, ecx
mov dword [ebp - 0x50], eax
test eax, eax
je 0x40189d
cmp word [eax], 0
je 0x40189d
mov dword [ebp - 0x24], 0xffffffff
lea eax, [ebp - 0x24]
mov dword [ebp - 4], 0
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x40187a
lea eax, [ebp - 0x28]
mov dword [ebp - 0x28], 0
push eax
push 0
push 0
push 1
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40187a
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0
mov dword [ebp - 0x60], 0
push eax
lea ecx, [ebp - 0x68]
mov byte [ebp - 4], 1
call fcn.00401fd0
mov edi, dword [ebp - 0x68]
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x28]
push edi
push 1
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x40161b
lea ecx, [ebp - 0x68]
mov byte [ebp - 0x1d], al
call fcn.00402020
jmp 0x40187e
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
lea eax, [ebp - 0x2c]
mov byte [ebp - 4], 2
push eax
push 0
push 0
push 0x19
push dword [ebp - 0x24]
mov dword [ebp - 0x2c], 0
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x401678
push eax
lea ecx, [ebp - 0x3c]
call fcn.00401fd0
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x2c]
mov eax, dword [ebp - 0x3c]
push eax
push 0x19
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x4016ab
lea eax, [ebp - 0x30]
mov byte [ebp - 0x1c], 0
push eax
lea eax, [ebp - 0x1c]
mov word [ebp - 0x13], 0
push eax
push 0
xorps xmm0, xmm0
mov byte [ebp - 0x11], 0
push 0x16
movq qword [ebp - 0x1b], xmm0
mov dword [ebp - 0x30], 0xc
call dword [sym.imp.ADVAPI32.dll_CreateWellKnownSid]
test eax, eax
jne 0x4016b4
mov byte [ebp - 0x1d], 0
jmp 0x401868
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov esi, dword [ebp - 0x30]
mov ecx, eax
add esi, 0x1f
mov dword [ebp - 0x48], 0
add esi, ecx
mov dword [ebp - 0x44], 0
or esi, 3
mov dword [ebp - 0x40], 0
inc esi
push esi
lea ecx, [ebp - 0x48]
mov byte [ebp - 4], 3
call fcn.00401fd0
push 2
push esi
mov esi, dword [ebp - 0x48]
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x40185c
lea eax, [ebp - 0x1c]
push eax
push 0x10000000
push 2
push esi
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x40185c
push dword [edi]
push 0x10000000
push 2
push esi
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x40185c
xor edi, edi
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x58], edi
mov dword [ebp - 0x54], edi
mov byte [ebp - 4], 4
mov esi, dword [ebp - 0x3c]
cmp esi, dword [ebp - 0x38]
je 0x4017ba
push str.AddMandatoryAce
push str.advapi32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x4c], eax
test eax, eax
je 0x40184e
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
lea ecx, [ebp - 0x5c]
lea esi, [eax + 0xf]
or esi, 3
inc esi
push esi
call fcn.00401fd0
mov edi, dword [ebp - 0x5c]
push 2
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x40184e
mov eax, dword [ebp - 0x3c]
mov esi, dword [ebp - 0x4c]
mov ecx, esi
push dword [eax]
push 3
push 0
push 2
push edi
call dword [0x414168]
call esi
test eax, eax
je 0x40184e
push 1
lea eax, [ebp - 0x88]
mov byte [ebp - 0x88], 0
xorps xmm0, xmm0
mov word [ebp - 0x77], 0
push eax
movups xmmword [ebp - 0x87], xmm0
mov byte [ebp - 0x75], 0
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x40184e
push 0
push dword [ebp - 0x48]
lea eax, [ebp - 0x88]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x40184e
test edi, edi
je 0x40181a
push 0
push edi
push 1
lea eax, [ebp - 0x88]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorSacl]
test eax, eax
je 0x40184e
xorps xmm0, xmm0
mov dword [ebp - 0x74], 0xc
movq qword [ebp - 0x70], xmm0
lea eax, [ebp - 0x88]
mov dword [ebp - 0x70], eax
lea eax, [ebp - 0x74]
push eax
push dword [ebp - 0x50]
mov dword [ebp - 0x6c], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov byte [ebp - 0x1d], 1
test eax, eax
jne 0x401852
mov byte [ebp - 0x1d], 0
lea ecx, [ebp - 0x5c]
call fcn.00402020
jmp 0x401860
mov byte [ebp - 0x1d], 0
lea ecx, [ebp - 0x48]
call fcn.00402020
lea ecx, [ebp - 0x3c]
call fcn.00402020
lea ecx, [ebp - 0x68]
call fcn.00402020
jmp 0x40187e
mov byte [ebp - 0x1d], 0
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x401898
cmp eax, 0xffffffff
je 0x401898
push eax
mov dword [ebp - 0x24], 0xffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [ebp - 0x1d]
jmp 0x40189f
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004033cd
mov esp, ebp
pop ebp
ret