Function at 0x405170
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 0x44a78d
mov eax, dword fs:[0]
push eax
sub esp, 0x278
mov eax, dword [0x461040]
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 - 0x27c], eax
mov dword [ebp - 0x248], eax
mov dword [ebp - 0x284], eax
mov dword [ebp - 0x280], 0
mov eax, dword fs:[0x2c]
mov edi, dword [eax]
mov eax, dword [0x4637c0]
cmp eax, dword [edi + 4]
jle 0x405208
push 0x4637c0
call fcn.00429618
add esp, 4
cmp dword [0x4637c0], 0xffffffff
jne 0x405208
mov dword [ebp - 4], 1
push 0x44dd80
call fcn.004298b8
mov byte [ebp - 4], 0
push 0x4637c0
call fcn.004295c7
add esp, 8
cmp dword [0x461ad0], 0
jne 0x4058f8
mov dword [ebp - 0x220], 0x457750
mov dword [ebp - 0x21c], 0
mov dword [ebp - 4], 2
mov eax, dword [ebp - 0x220]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x44e26c]
lea ecx, [ebp - 0x220]
call esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [ebp - 0x21c]
push ecx
push 8
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x40526e
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x405890
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 0x4052e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x405871
push dword [ebp - 0x23c]
lea ecx, [ebp - 0x240]
call fcn.004060d0
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 0x405871
cmp dword [ebp - 0x23c], 0
je 0x405871
lea eax, [ebp - 0x244]
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 0x405877
push dword [ebp - 0x244]
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
push dword [ebp - 0x244]
mov dword [ebp - 0x248], eax
call dword [sym.imp.ADVAPI32.dll_FreeSid]
mov byte [ebp - 4], 2
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x240], 0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 0x220], 0x457750
test eax, eax
je 0x405391
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x21c], 0
cmp dword [ebp - 0x248], 1
jne 0x4058b9
mov eax, dword [0x4637c4]
cmp eax, dword [edi + 4]
jle 0x4053f5
push 0x4637c4
call fcn.00429618
add esp, 4
cmp dword [0x4637c4], 0xffffffff
jne 0x4053f5
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 [0x4637c8], eax
mov byte [ebp - 4], 0
push 0x4637c4
call fcn.004295c7
add esp, 4
mov esi, dword [0x4637c8]
lea eax, [ebp - 0x218]
test esi, esi
je 0x40541d
push eax
push 0x104
mov ecx, esi
call dword [0x44e26c]
call esi
mov dword [ebp - 0x23c], eax
jmp 0x405448
push 0x104
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.00432945
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4057c7
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.00401270
sub esp, 8
lea ecx, [ebp - 0x278]
push str.S_1_5_32_544
call fcn.00401270
mov eax, dword [ebp - 0x258]
test eax, eax
je 0x4054f8
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x258], 0
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x405513
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x25c], 0
mov eax, dword [ebp - 0x268]
test eax, eax
jle 0x405695
mov edx, dword [ebp - 0x260]
xor ecx, ecx
mov dword [ebp - 0x240], ecx
test edx, edx
je 0x40558f
lea eax, [ebp - 0x248]
mov dword [ebp - 0x244], ecx
push eax
lea eax, [ebp - 0x240]
mov dword [ebp - 0x248], ecx
push eax
lea eax, [ebp - 0x244]
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
jne 0x405570
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x254], eax
jmp 0x405695
cmp dword [ebp - 0x244], 0
mov eax, dword [ebp - 0x268]
jne 0x405589
xor ecx, ecx
mov dword [ebp - 0x240], ecx
jmp 0x40558f
mov ecx, dword [ebp - 0x240]
test eax, eax
jle 0x40593a
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 0x4055bb
mov dword [ebp - 0x254], eax
jmp 0x405695
push 0x14
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x25c], eax
test eax, eax
jne 0x4055e0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x254], eax
jmp 0x405695
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x40561a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x254], eax
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x405695
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x25c], 0
jmp 0x405695
push 0
push dword [ebp - 0x258]
push 1
push dword [ebp - 0x25c]
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x40565d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x254], eax
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x405695
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x25c], 0
jmp 0x405695
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x405695
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 edi, edx
mov eax, dword [ebp - 0x278]
test edi, edi
jle 0x4056df
test esi, esi
js 0x40593a
cmp esi, edx
jge 0x40593a
mov ecx, dword [eax + esi*8]
test ecx, ecx
je 0x4056da
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, dword [ebp - 0x274]
mov eax, dword [ebp - 0x278]
inc esi
cmp esi, edi
jl 0x4056b0
test eax, eax
je 0x4056f6
push eax
call fcn.0042dfa3
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 0x405727
push eax
call fcn.0042dfa3
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 0x40574c
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x25c]
test eax, eax
je 0x40575d
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov byte [ebp - 4], 8
mov eax, dword [ebp - 0x26c]
test eax, eax
je 0x40577e
push eax
call fcn.0042dfa3
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 0x4057b3
push eax
call fcn.0042dfa3
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 0x4058f8
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]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405800
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x230]
call fcn.00403b90
mov dword [ebp - 4], 0xa
lea eax, [ebp - 0x230]
push eax
call fcn.00409a90
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x21c]
cmp eax, 7
jbe 0x4058db
mov ecx, dword [ebp - 0x230]
lea eax, [eax*2 + 2]
mov edx, ecx
cmp eax, 0x1000
jb 0x4058d0
mov ecx, dword [edx - 4]
sub edx, ecx
lea eax, [edx - 4]
cmp eax, 0x1f
ja 0x405944
jmp 0x4058d0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [ebp - 4], 2
test esi, esi
je 0x405886
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x240], 0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 0x220], 0x457750
test eax, eax
je 0x4058b9
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 0x4057cd
test ecx, ecx
je 0x4058db
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor eax, eax
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov ecx, dword [ebp - 0x27c]
push 0x461ac0
call fcn.00402b30
mov dword [ebp - 4], 0
mov dword [ebp - 0x280], 1
mov eax, dword [ebp - 0x27c]
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.00429557
mov esp, ebp
pop ebp
ret
push 0x8000000b
call fcn.004018f0
call fcn.0042e352
int3