Function at 0x401788
Capabilities:
Create directory

Disassembly:
push 0x80
mov eax, 0x41600d
call fcn.00415d28
mov eax, ecx
mov dword [ebp - 0x50], eax
test eax, eax
je 0x401a2a
xor ebx, ebx
cmp word [eax], bx
je 0x401a2a
lea eax, [ebp - 0x48]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x401a2a
mov esi, dword [ebp - 0x48]
mov dword [ebp - 0x54], esi
lea eax, [ebp - 0x20]
mov dword [ebp - 4], ebx
push eax
push ebx
push ebx
push 1
push esi
mov dword [ebp - 0x20], ebx
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
cmp dword [ebp - 0x20], ebx
je 0x401a1e
push ecx
push dword [ebp - 0x20]
lea ecx, [ebp - 0x78]
call fcn.00401ae2
lea eax, [ebp - 0x20]
mov byte [ebp - 4], 1
push eax
push dword [ebp - 0x20]
push dword [ebp - 0x78]
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x401a16
mov eax, dword [ebp - 0x78]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x3c], ebx
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 2
push eax
push ebx
push ebx
push 0x19
push esi
mov dword [ebp - 0x24], ebx
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
cmp dword [ebp - 0x24], ebx
je 0x401869
push dword [ebp - 0x24]
lea ecx, [ebp - 0x44]
call fcn.00401a75
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x44]
push 0x19
push esi
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x401a0e
xor eax, eax
mov dword [ebp - 0x2c], 0xc
lea edi, [ebp - 0x1c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x1c]
push eax
push ebx
push 0x16
call dword [sym.imp.ADVAPI32.dll_CreateWellKnownSid]
test eax, eax
je 0x401a0e
mov edi, dword [ebp - 0x28]
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov esi, dword [ebp - 0x2c]
mov ecx, eax
add esi, 0x1f
mov dword [ebp - 0x38], ebx
add esi, ecx
mov dword [ebp - 0x34], ebx
or esi, 3
mov dword [ebp - 0x30], ebx
inc esi
push esi
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], 3
call fcn.00401a75
push 2
push esi
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x401a06
lea eax, [ebp - 0x1c]
mov esi, 0x10000000
push eax
push esi
push 2
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x401a06
push dword [edi]
push esi
push 2
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x401a06
mov esi, ebx
mov dword [ebp - 0x60], ebx
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x58], ebx
mov byte [ebp - 4], 4
mov edi, dword [ebp - 0x44]
cmp edi, dword [ebp - 0x40]
je 0x401988
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 0x4019fe
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
lea ecx, [ebp - 0x60]
lea esi, [eax + 0xf]
or esi, 3
inc esi
push esi
call fcn.00401a75
mov eax, dword [ebp - 0x60]
push 2
push esi
mov esi, eax
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x4019fe
push dword [edi]
mov edi, dword [ebp - 0x4c]
mov ecx, edi
push 3
push ebx
push 2
push esi
call dword [0x417190]
call edi
test eax, eax
je 0x4019fe
xor eax, eax
lea edi, [ebp - 0x8c]
stosd dword es:[edi], eax
push 1
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x8c]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x4019fe
push ebx
push dword [ebp - 0x38]
lea eax, [ebp - 0x8c]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x4019fe
test esi, esi
je 0x4019d8
push ebx
push esi
push 1
lea eax, [ebp - 0x8c]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorSacl]
test eax, eax
je 0x4019fe
lea eax, [ebp - 0x8c]
mov dword [ebp - 0x6c], 0xc
mov dword [ebp - 0x68], eax
lea eax, [ebp - 0x6c]
push eax
push dword [ebp - 0x50]
mov dword [ebp - 0x64], ebx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x4019fe
mov bl, 1
lea ecx, [ebp - 0x60]
call fcn.00401ac3
lea ecx, [ebp - 0x38]
call fcn.00401ac3
lea ecx, [ebp - 0x44]
call fcn.00401ac3
lea ecx, [ebp - 0x78]
call fcn.00401ac3
lea ecx, [ebp - 0x54]
call fcn.00401436
mov al, bl
jmp 0x401a2c
xor al, al
call fcn.00415cd7
ret