Function at 0x10021ff0
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa30
mov eax, dword [0x10167c60]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push esi
mov esi, ecx
push edi
mov eax, dword [esi + 0x10]
cmp dword [eax - 0xc], 0
jne 0x1002208f
push 0x208
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.100e67c0
add esp, 0xc
lea eax, [ebp - 0x61c]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea ecx, [ebp - 0xa2d]
call fcn.1001fe00
push eax
lea eax, [ebp - 0x61c]
push eax
call ebx
lea edx, [ebp - 0x61c]
lea ecx, [edx + 2]
nop dword [eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10022070
sub edx, ecx
lea eax, [ebp - 0x61c]
sar edx, 1
lea ecx, [esi + 0x10]
push edx
push eax
call fcn.1000b940
mov eax, dword [esi]
cmp dword [eax - 0xc], 0
jne 0x10022135
push 0x208
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.100e67c0
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0
push 0x1a
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea ecx, [ebp - 0xa2d]
call fcn.1001d4e0
push eax
lea eax, [ebp - 0x20c]
push eax
call ebx
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x100220f9
lea eax, [ebp - 0x20c]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
lea ecx, [ebp - 0xa2d]
call fcn.1001df60
push eax
lea eax, [ebp - 0x20c]
push eax
call ebx
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10022117
sub ecx, edx
lea eax, [ebp - 0x20c]
sar ecx, 1
push ecx
push eax
mov ecx, esi
call fcn.1000b940
mov eax, dword [esi + 4]
cmp dword [eax - 0xc], 0
jne 0x100221b2
push 0x208
lea eax, [ebp - 0x824]
push 0
push eax
call fcn.100e67c0
add esp, 0xc
lea eax, [ebp - 0x824]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea ecx, [ebp - 0xa2d]
call fcn.1001dbe0
push eax
lea eax, [ebp - 0x824]
push eax
call ebx
lea edx, [ebp - 0x824]
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10022193
sub edx, ecx
lea eax, [ebp - 0x824]
sar edx, 1
lea ecx, [esi + 4]
push edx
push eax
call fcn.1000b940
mov eax, dword [esi + 0xc]
cmp dword [eax - 0xc], 0
jne 0x1002222f
push 0x208
lea eax, [ebp - 0xa2c]
push 0
push eax
call fcn.100e67c0
add esp, 0xc
lea eax, [ebp - 0xa2c]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0xa2c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea ecx, [ebp - 0xa2d]
call fcn.1001d860
push eax
lea eax, [ebp - 0xa2c]
push eax
call ebx
lea edx, [ebp - 0xa2c]
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10022210
sub edx, ecx
lea eax, [ebp - 0xa2c]
sar edx, 1
lea ecx, [esi + 0xc]
push edx
push eax
call fcn.1000b940
mov eax, dword [esi + 8]
cmp dword [eax - 0xc], 0
jne 0x100222df
push 0x208
lea eax, [ebp - 0x414]
push 0
push eax
call fcn.100e67c0
add esp, 0xc
lea eax, [ebp - 0x414]
push 0
push 0x1a
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea ecx, [ebp - 0xa2d]
call fcn.1001f9a0
push eax
lea eax, [ebp - 0x414]
push eax
call ebx
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1002229a
lea eax, [ebp - 0x414]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
lea ecx, [ebp - 0xa2d]
call fcn.1001e3c0
push eax
lea eax, [ebp - 0x414]
push eax
call ebx
lea edx, [ebp - 0x414]
lea ecx, [edx + 2]
nop dword [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x100222c0
sub edx, ecx
lea eax, [ebp - 0x414]
sar edx, 1
lea ecx, [esi + 8]
push edx
push eax
call fcn.1000b940
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100c495f
mov esp, ebp
pop ebp
ret