Function at 0x1001b940
Capabilities:
Check if file exists
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1006c34c
mov eax, dword fs:[0]
push eax
sub esp, 0x660
mov eax, dword [0x10086e84]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [0x100884b0]
mov dword [ebp - 0x63c], eax
mov eax, dword [edx + 0xc]
xor ebx, ebx
mov ecx, 0x100884b0
mov dword [ebp - 0x638], ebx
call eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x648], esi
push 0x206
lea ecx, [ebp - 0x626]
push ebx
push ecx
mov dword [ebp - 4], ebx
mov word [ebp - 0x628], bx
call fcn.10042010
add esp, 0xc
lea edx, [ebp - 0x634]
push edx
push 1
push 0xc
mov dword [ebp - 0x634], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
mov eax, dword [ebp - 0x634]
cmp eax, ebx
je 0x1001bab7
lea ecx, [ebp - 0x628]
push ecx
push ebx
push eax
push 0x28
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [ebp - 0x634]
mov edi, dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
lea edx, [ebp - 0x62c]
push edx
push ebx
push ebx
push 1
push eax
mov dword [ebp - 0x62c], ebx
call edi
mov eax, dword [ebp - 0x62c]
cmp eax, ebx
je 0x1001ba9e
push eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x1001ba9c
mov edx, dword [ebp - 0x62c]
mov eax, dword [ebp - 0x634]
lea ecx, [ebp - 0x62c]
push ecx
push edx
push esi
push 1
push eax
call edi
test eax, eax
je 0x1001ba90
mov edx, dword [esi]
lea ecx, [ebp - 0x630]
push ecx
push edx
mov dword [ebp - 0x630], 0
call sub.ADVAPI32.dll_ConvertSidToStringSidW
mov eax, dword [ebp - 0x630]
test eax, eax
je 0x1001ba90
push eax
lea ecx, [ebp - 0x648]
call fcn.1000a7ef
mov eax, dword [ebp - 0x630]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor ebx, ebx
mov ecx, dword [ebp - 0x634]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x648]
mov dword [ebp - 0x634], ebx
mov edx, dword [0x100884b0]
mov eax, dword [edx + 0xc]
mov ecx, 0x100884b0
call eax
lea edi, [eax + 0x10]
mov dword [ebp - 0x62c], edi
cmp word [ebp - 0x628], bx
mov byte [ebp - 4], 1
je 0x1001bc67
cmp dword [esi - 0xc], ebx
je 0x1001bc67
mov edx, dword [0x100884b0]
mov eax, dword [edx + 0xc]
mov ecx, 0x100884b0
call eax
add eax, 0x10
mov dword [ebp - 0x644], eax
push esi
lea ecx, [ebp - 0x644]
push str._sEnvironment
push ecx
mov byte [ebp - 4], 2
call fcn.100093b9
add esp, 0xc
mov dword [ebp - 0x630], ebx
mov edx, dword [ebp - 0x644]
push 0x20019
push edx
push SysStringLen
lea ecx, [ebp - 0x630]
mov byte [ebp - 4], 3
call fcn.100020c0
cmp eax, ebx
jne 0x1001bbd4
push 0x40e
lea eax, [ebp - 0x41e]
push ebx
push eax
mov word [ebp - 0x420], bx
call fcn.10042010
add esp, 0xc
lea ecx, [ebp - 0x640]
push ecx
lea edx, [ebp - 0x420]
push edx
mov esi, 0x208
push 0x10077930
lea ecx, [ebp - 0x630]
mov dword [ebp - 0x640], esi
call fcn.100126f0
cmp word [ebp - 0x420], bx
jne 0x1001bbbc
lea eax, [ebp - 0x640]
push eax
lea ecx, [ebp - 0x420]
push ecx
push str.TEMP
lea ecx, [ebp - 0x630]
mov dword [ebp - 0x640], esi
call fcn.100126f0
lea edx, [ebp - 0x420]
push edx
lea ecx, [ebp - 0x62c]
call fcn.1000a7ef
mov edi, dword [ebp - 0x62c]
mov esi, dword [edi - 0xc]
cmp esi, ebx
je 0x1001bc30
xor dl, dl
xor eax, eax
cmp esi, ebx
jle 0x1001bc13
test dl, dl
je 0x1001bc00
movzx ecx, word [edi + eax*2]
cmp cx, 0x61
jb 0x1001bc00
cmp cx, 0x7a
ja 0x1001bc00
add ecx, 0xffffffe0
mov word [edi + eax*2], cx
jmp 0x1001bc0c
cmp word [edi + eax*2], 0x25
jne 0x1001bc0c
test dl, dl
sete dl
add eax, 1
cmp eax, esi
jl 0x1001bbe3
lea eax, [ebp - 0x628]
push eax
push str._USERPROFILE_
lea ecx, [ebp - 0x62c]
call fcn.1000f5b0
mov edi, dword [ebp - 0x62c]
mov eax, dword [ebp - 0x630]
cmp eax, ebx
je 0x1001bc41
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x644]
add eax, 0xfffffff0
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x1001bc67
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call fcn.10001240
test al, al
je 0x1001bc90
mov ecx, dword [ebp - 0x634]
push ecx
call fcn.10011200
add esp, 4
test eax, eax
je 0x1001bc90
mov eax, dword [edi - 0xc]
mov ecx, 1
lea esi, [eax + 4]
jmp 0x1001bc97
mov eax, dword [edi - 0xc]
xor ecx, ecx
mov esi, eax
cmp eax, ebx
jne 0x1001bcb7
mov edx, dword [ebp - 0x63c]
mov eax, dword [ebp + 8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov dword [ebp - 0x638], eax
jmp 0x1001bdeb
cmp dword [ebp - 0x63c], ebx
je 0x1001bde3
mov ebx, dword [ebp + 8]
cmp esi, ebx
jae 0x1001bde3
test ecx, ecx
je 0x1001bdcd
push 0x40e
lea ecx, [ebp - 0x41e]
push 0
push ecx
mov word [ebp - 0x420], 0
call fcn.10042010
push 0xffffffffffffffff
push edi
lea edx, [ebp - 0x420]
push 0x208
push edx
call fcn.100421ff
add esp, 0x1c
push 0x10077900
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov esi, eax
test esi, esi
je 0x1001bd70
lea ecx, [ebp - 0x420]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov esi, eax
test esi, esi
je 0x1001bd70
lea ecx, [ebp - 0x66c]
call fcn.100045f8
mov eax, dword [ebp - 0x654]
neg eax
sbb eax, eax
lea edx, [ebp - 0x658]
and eax, edx
push eax
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea ecx, [ebp - 0x66c]
mov esi, eax
call fcn.10002bec
test esi, esi
jne 0x1001bd81
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x1001bd81
test esi, esi
je 0x1001bdb7
mov esi, dword [ebp - 0x63c]
push 0xffffffffffffffff
lea ecx, [ebp - 0x420]
push ecx
push ebx
push esi
call fcn.100421ff
mov eax, esi
add esp, 0x10
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x1001bda0
sub eax, edx
sar eax, 1
mov dword [ebp - 0x638], eax
jmp 0x1001bdeb
mov edx, dword [ebp - 0x63c]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov dword [ebp - 0x638], eax
jmp 0x1001bdeb
mov eax, dword [ebp - 0x63c]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov dword [ebp - 0x638], esi
jmp 0x1001bdeb
push 0x7a
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea eax, [edi - 0x10]
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x1001be0b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x648]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x1001be34
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x638]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10041ffa
mov esp, ebp
pop ebp
ret