Function at 0x405ea0
Capabilities:
Check if file exists
Compare security identifiers
Create directory
Get common file path
Get token privileges

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 0xffffffffffffffff
push 0x49e981
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x284
mov eax, dword [0x4e3050]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, ecx
mov dword [ebp - 0x258], eax
mov dword [ebp - 0x254], eax
mov dword [ebp - 0x260], eax
mov dword [ebp - 0x25c], 0
mov eax, dword fs:[0x2c]
mov ecx, dword [eax]
mov eax, dword [0x4e5480]
mov dword [ebp - 0x254], ecx
cmp eax, dword [ecx + 4]
jle 0x405f54
push 0x4e5480
call fcn.0047d643
add esp, 4
cmp dword [0x4e5480], 0xffffffff
jne 0x405f54
mov dword [ebp - 4], 1
push 0x4b4830
call fcn.0047d955
add esp, 4
mov byte [ebp - 4], 0
push 0x4e5480
call fcn.0047d5f9
add esp, 4
cmp dword [0x4e3aa0], 0
jne 0x406352
mov dword [ebp - 0x228], 0x4c15b0
mov dword [ebp - 0x224], 0
mov dword [ebp - 4], 2
lea ecx, [ebp - 0x228]
mov eax, dword [ebp - 0x228]
call dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [ebp - 0x224]
push ecx
push 8
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x405fb0
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x406251
xor esi, esi
mov dword [ebp - 0x24c], esi
mov byte [ebp - 4], 3
lea eax, [ebp - 0x248]
push eax
push esi
push esi
push 1
push dword [ebp - 0x224]
mov dword [ebp - 0x248], esi
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x406027
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x406234
push dword [ebp - 0x248]
lea ecx, [ebp - 0x24c]
call fcn.00407e40
mov esi, dword [ebp - 0x24c]
lea eax, [ebp - 0x248]
push eax
push dword [ebp - 0x248]
push esi
push 1
push dword [ebp - 0x224]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x406234
cmp dword [ebp - 0x248], 0
je 0x406234
lea eax, [ebp - 0x250]
mov dword [ebp - 0x240], 0
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0x12
push 1
lea eax, [ebp - 0x240]
mov word [ebp - 0x23c], 0x500
push eax
call dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
je 0x40623a
push dword [ebp - 0x250]
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
push dword [ebp - 0x250]
cmp eax, 1
sete byte [ebp - 0x241]
call dword [sym.imp.ADVAPI32.dll_FreeSid]
mov byte [ebp - 4], 2
push esi
call fcn.0047d9a8
add esp, 4
mov dword [ebp - 0x24c], 0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x224]
mov dword [ebp - 0x228], 0x4c15b0
test eax, eax
je 0x4060d9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x224], 0
cmp byte [ebp - 0x241], 0
je 0x40627a
mov ecx, dword [ebp - 0x254]
mov eax, dword [0x4e5484]
cmp eax, dword [ecx + 4]
jle 0x406143
push 0x4e5484
call fcn.0047d643
add esp, 4
cmp dword [0x4e5484], 0xffffffff
jne 0x406143
mov dword [ebp - 4], 4
push str.GetTempPath2W
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4e5488], eax
mov byte [ebp - 4], 0
push 0x4e5484
call fcn.0047d5f9
add esp, 4
mov eax, dword [0x4e5488]
test eax, eax
je 0x40615e
lea ecx, [ebp - 0x220]
push ecx
push 0x104
call eax
mov esi, eax
jmp 0x40618b
push 0x104
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push str.SystemTemp_
mov esi, eax
lea eax, [ebp - 0x220]
push 0x104
push eax
call fcn.0048728c
add esp, 0xc
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40628e
lea ecx, [ebp - 0x290]
call fcn.004093e0
mov dword [ebp - 4], 5
lea ecx, [ebp - 0x290]
push 1
push 0x10000000
push str.S_1_5_18
call fcn.004095d0
push 1
push 0x10000000
push str.S_1_5_32_544
lea ecx, [ebp - 0x290]
call fcn.004095d0
lea ecx, [ebp - 0x290]
call fcn.00409b40
test eax, eax
je 0x406223
mov eax, dword [ebp - 0x274]
mov dword [ebp - 0x228], eax
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x220]
mov dword [ebp - 0x22c], 0xc
push eax
mov dword [ebp - 0x224], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x290]
call fcn.00409480
jmp 0x40628e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [ebp - 4], 2
push esi
call fcn.0047d9a8
mov dword [ebp - 0x24c], 0
add esp, 4
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x224]
mov dword [ebp - 0x228], 0x4c15b0
test eax, eax
je 0x40627a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x224], 0
lea eax, [ebp - 0x220]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, eax
test esi, esi
je 0x406352
xorps xmm0, xmm0
mov dword [ebp - 0x228], 0
lea ecx, [ebp - 0x220]
mov dword [ebp - 0x224], 0
movups xmmword [ebp - 0x238], xmm0
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4062c0
sub ecx, edx
lea eax, [ebp - 0x220]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x238]
call fcn.00403c30
mov dword [ebp - 4], 6
lea eax, [ebp - 0x238]
push eax
call fcn.00421600
mov byte [ebp - 4], 0
mov ecx, dword [ebp - 0x224]
cmp ecx, 8
jb 0x406335
mov edx, dword [ebp - 0x238]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x40632b
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406396
push ecx
push edx
call fcn.0047d96a
add esp, 8
xor eax, eax
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x224], 7
mov word [ebp - 0x238], ax
mov ecx, dword [ebp - 0x258]
push 0x4e3a90
call fcn.00404d40
mov dword [ebp - 4], 0
mov dword [ebp - 0x25c], 1
mov eax, dword [ebp - 0x258]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0047d4df
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.004827af
int3