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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x44919d
mov eax, dword fs:[0]
push eax
sub esp, 0x27c
mov eax, dword [0x45f024]
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 - 0x280], eax
mov dword [ebp - 0x244], eax
mov dword [ebp - 0x288], eax
mov dword [ebp - 0x284], 0
mov eax, dword fs:[0x2c]
mov ecx, dword [eax]
mov eax, dword [0x461750]
mov dword [ebp - 0x244], ecx
cmp eax, dword [ecx + 4]
jle 0x4050fe
push 0x461750
call fcn.00428235
add esp, 4
cmp dword [0x461750], 0xffffffff
jne 0x4050fe
mov dword [ebp - 4], 1
push 0x44c5c0
call fcn.004284d5
mov byte [ebp - 4], 0
push 0x461750
call fcn.004281e4
add esp, 8
cmp dword [0x45fa60], 0
jne 0x4057a6
mov dword [ebp - 0x220], 0x455d30
mov dword [ebp - 0x21c], 0
mov dword [ebp - 4], 2
lea ecx, [ebp - 0x220]
mov eax, dword [ebp - 0x220]
call dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [ebp - 0x21c]
push ecx
push 8
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
jne 0x405160
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x405742
xor esi, esi
mov dword [ebp - 0x240], esi
mov byte [ebp - 4], 3
lea eax, [ebp - 0x23c]
push eax
push esi
push esi
push 1
push dword [ebp - 0x21c]
mov dword [ebp - 0x23c], esi
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x4051d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x405726
push dword [ebp - 0x23c]
lea ecx, [ebp - 0x240]
call fcn.00405f80
mov esi, dword [ebp - 0x240]
lea eax, [ebp - 0x23c]
push eax
push dword [ebp - 0x23c]
push esi
push 1
push dword [ebp - 0x21c]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x405726
cmp dword [ebp - 0x23c], 0
je 0x405726
lea eax, [ebp - 0x248]
mov dword [ebp - 0x238], 0
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0x12
push 1
lea eax, [ebp - 0x238]
mov word [ebp - 0x234], 0x500
push eax
call dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
je 0x40572d
push dword [ebp - 0x248]
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
push dword [ebp - 0x248]
mov dword [ebp - 0x27c], eax
call dword [sym.imp.ADVAPI32.dll_FreeSid]
mov byte [ebp - 4], 2
push esi
call edi
mov dword [ebp - 0x240], 0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 0x220], 0x455d30
test eax, eax
je 0x40527f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x21c], 0
cmp dword [ebp - 0x27c], 1
jne 0x40576b
mov ecx, dword [ebp - 0x244]
mov eax, dword [0x461754]
cmp eax, dword [ecx + 4]
jle 0x4052e9
push 0x461754
call fcn.00428235
add esp, 4
cmp dword [0x461754], 0xffffffff
jne 0x4052e9
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 [0x461758], eax
mov byte [ebp - 4], 0
push 0x461754
call fcn.004281e4
add esp, 4
mov eax, dword [0x461758]
test eax, eax
je 0x405308
lea ecx, [ebp - 0x218]
push ecx
push 0x104
call eax
mov dword [ebp - 0x23c], eax
jmp 0x405339
push 0x104
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push str.SystemTemp_
mov dword [ebp - 0x23c], eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.00431505
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x405680
mov dword [ebp - 0x278], eax
mov dword [ebp - 0x274], eax
mov dword [ebp - 0x270], eax
mov dword [ebp - 4], 5
mov dword [ebp - 0x26c], eax
mov dword [ebp - 0x268], eax
mov dword [ebp - 0x264], eax
mov byte [ebp - 4], 6
mov dword [ebp - 0x260], eax
mov dword [ebp - 0x25c], eax
mov dword [ebp - 0x258], eax
mov dword [ebp - 0x254], eax
mov dword [ebp - 0x250], eax
mov dword [ebp - 0x24c], eax
mov dword [ebp - 4], 7
sub esp, 8
lea ecx, [ebp - 0x278]
push str.S_1_5_18
call fcn.00401250
sub esp, 8
lea ecx, [ebp - 0x278]
push str.S_1_5_32_544
call fcn.00401250
mov eax, dword [ebp - 0x258]
test eax, eax
je 0x4053e5
push eax
call edi
mov dword [ebp - 0x258], 0
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x4053fc
push eax
call edi
mov dword [ebp - 0x25c], 0
mov eax, dword [ebp - 0x268]
test eax, eax
jle 0x405550
mov edx, dword [ebp - 0x260]
xor ecx, ecx
mov dword [ebp - 0x240], ecx
test edx, edx
je 0x405479
lea eax, [ebp - 0x244]
mov dword [ebp - 0x248], ecx
push eax
lea eax, [ebp - 0x240]
mov dword [ebp - 0x244], ecx
push eax
lea eax, [ebp - 0x248]
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
jne 0x40545a
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x254], eax
jmp 0x405550
cmp dword [ebp - 0x248], 0
mov eax, dword [ebp - 0x268]
jne 0x405473
xor ecx, ecx
mov dword [ebp - 0x240], ecx
jmp 0x405479
mov ecx, dword [ebp - 0x240]
test eax, eax
jle 0x4057e8
lea edx, [ebp - 0x258]
push edx
push ecx
push dword [ebp - 0x26c]
push eax
call dword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
je 0x4054a5
mov dword [ebp - 0x254], eax
jmp 0x405550
push 0x14
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x25c], eax
test eax, eax
jne 0x4054cb
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x254], eax
jmp 0x405550
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x4054fe
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x254], eax
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x405550
push eax
call edi
mov dword [ebp - 0x25c], 0
jmp 0x405550
push 0
push dword [ebp - 0x258]
push 1
push dword [ebp - 0x25c]
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x4054d8
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x405550
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x218]
mov dword [ebp - 0x224], 0xc
push eax
mov dword [ebp - 0x21c], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov dword [ebp - 4], 9
xor esi, esi
mov edx, dword [ebp - 0x274]
mov eax, edx
mov dword [ebp - 0x244], eax
test eax, eax
mov eax, dword [ebp - 0x278]
jle 0x4055a0
test esi, esi
js 0x4057e8
cmp esi, edx
jge 0x4057e8
mov ecx, dword [eax + esi*8]
test ecx, ecx
je 0x405597
push ecx
call edi
mov edx, dword [ebp - 0x274]
mov eax, dword [ebp - 0x278]
inc esi
cmp esi, dword [ebp - 0x244]
jl 0x405571
test eax, eax
je 0x4055b7
push eax
call fcn.0042cb63
add esp, 4
mov dword [ebp - 0x278], 0
mov eax, dword [ebp - 0x26c]
mov dword [ebp - 0x274], 0
mov dword [ebp - 0x270], 0
test eax, eax
je 0x4055e8
push eax
call fcn.0042cb63
add esp, 4
mov dword [ebp - 0x26c], 0
mov eax, dword [ebp - 0x258]
mov dword [ebp - 0x268], 0
mov dword [ebp - 0x264], 0
test eax, eax
je 0x405609
push eax
call edi
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x405616
push eax
call edi
mov byte [ebp - 4], 8
mov eax, dword [ebp - 0x26c]
test eax, eax
je 0x405637
push eax
call fcn.0042cb63
add esp, 4
mov dword [ebp - 0x26c], 0
mov dword [ebp - 0x268], 0
mov dword [ebp - 0x264], 0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x278]
test eax, eax
je 0x40566c
push eax
call fcn.0042cb63
add esp, 4
mov dword [ebp - 0x278], 0
mov dword [ebp - 0x274], 0
mov dword [ebp - 0x270], 0
mov eax, dword [ebp - 0x23c]
test eax, eax
je 0x4057a6
xorps xmm0, xmm0
mov dword [ebp - 0x220], 0
lea ecx, [ebp - 0x218]
mov dword [ebp - 0x21c], 0
movups xmmword [ebp - 0x230], xmm0
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4056b5
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x230]
call fcn.00403ac0
mov dword [ebp - 4], 0xa
lea eax, [ebp - 0x230]
push eax
call fcn.004097a0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x21c]
cmp eax, 8
jb 0x405789
mov ecx, dword [ebp - 0x230]
lea eax, [eax*2 + 2]
mov edx, ecx
cmp eax, 0x1000
jb 0x405782
mov ecx, dword [edx - 4]
sub edx, ecx
lea eax, [edx - 4]
cmp eax, 0x1f
ja 0x4057f2
jmp 0x405782
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov byte [ebp - 4], 2
test esi, esi
je 0x405738
push esi
call edi
mov dword [ebp - 0x240], 0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 0x220], 0x455d30
test eax, eax
je 0x40576b
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x21c], 0
lea eax, [ebp - 0x218]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
jmp 0x405686
test ecx, ecx
je 0x405789
push ecx
call edi
xor eax, eax
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov ecx, dword [ebp - 0x280]
push 0x45fa50
call fcn.00402a10
mov dword [ebp - 4], 0
mov dword [ebp - 0x284], 1
mov eax, dword [ebp - 0x280]
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.0042817f
mov esp, ebp
pop ebp
ret
push 0x8000000b
call fcn.00401910
call fcn.0042cf12
int3