Function at 0x46a820
Capabilities:
Check if file exists
Get common file path
Query environment variable

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 0x510d1b
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x248
mov eax, dword [0x55300c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x254], esi
mov dword [ebp - 0x258], esi
xor eax, eax
mov dword [ebp - 0x258], esi
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x224], 7
mov word [ebp - 0x238], ax
mov dword [ebp - 4], eax
mov eax, dword [0x562e30]
test al, 1
jne 0x46a8b0
or eax, 1
mov dword [0x562d10], 0
mov dword [0x562e30], eax
mov eax, dword [0x562d18]
test eax, eax
je 0x46a95e
cmp eax, 6
ja 0x46a8c8
jb 0x46a95e
lea ecx, [ebp - 0x250]
call fcn.0046ea80
mov edi, eax
lea eax, [ebp - 0x238]
cmp eax, edi
je 0x46a910
mov ecx, eax
call fcn.00406540
movups xmm0, xmmword [edi]
xor eax, eax
movups xmmword [ebp - 0x238], xmm0
movq xmm0, qword [edi + 0x10]
movq qword [ebp - 0x228], xmm0
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 7
mov word [edi], ax
mov edx, dword [ebp - 0x23c]
cmp edx, 8
jb 0x46a950
mov ecx, dword [ebp - 0x250]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46a946
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x46ab38
push edx
push ecx
call fcn.00481e07
add esp, 8
mov ecx, dword [ebp - 0x228]
test ecx, ecx
jne 0x46aa4d
push 0x208
lea eax, [ebp - 0x220]
push 0
push eax
call fcn.004b62b0
add esp, 0xc
lea eax, [ebp - 0x220]
push eax
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
je 0x46a9a4
push 0x104
lea eax, [ebp - 0x220]
push eax
push str._APPDATA_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp word [ebp - 0x220], 0
je 0x46aa21
xor eax, eax
mov dword [ebp - 0x240], 0
lea ecx, [ebp - 0x220]
mov dword [ebp - 0x23c], 7
mov word [ebp - 0x250], ax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x46a9d4
sub ecx, edx
lea eax, [ebp - 0x220]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x250]
call fcn.00406c50
lea ecx, [ebp - 0x238]
call fcn.00406540
movups xmm0, xmmword [ebp - 0x250]
movq xmm1, qword [ebp - 0x240]
movups xmmword [ebp - 0x238], xmm0
movq qword [ebp - 0x228], xmm1
jmp 0x46aa30
movq xmm1, qword [ebp - 0x228]
movups xmm0, xmmword [ebp - 0x238]
mov ecx, dword [ebp - 0x228]
test ecx, ecx
jne 0x46aa4d
mov dword [esi + 0x10], ecx
mov dword [esi + 0x14], ecx
movups xmmword [esi], xmm0
movq qword [esi + 0x10], xmm1
jmp 0x46ab18
mov edx, dword [ebp - 0x224]
mov eax, edx
sub eax, ecx
cmp eax, 9
jb 0x46aa96
cmp edx, 8
lea esi, [ebp - 0x238]
push 0x12
cmovae esi, dword [ebp - 0x238]
lea edi, [ecx + 9]
push 0x5309d8
mov dword [ebp - 0x228], edi
lea eax, [esi + ecx*2]
push eax
call fcn.004b5d30
add esp, 0xc
xor eax, eax
mov word [esi + edi*2], ax
mov esi, dword [ebp - 0x254]
jmp 0x46aab7
push 9
push 0x5309d8
mov byte [ebp - 0x254], 0
lea ecx, [ebp - 0x238]
push dword [ebp - 0x254]
push 9
call fcn.00404560
cmp dword [ebp - 0x224], 8
lea eax, [ebp - 0x238]
cmovae eax, dword [ebp - 0x238]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x46aaf3
cmp dword [ebp - 0x224], 8
lea eax, [ebp - 0x238]
cmovae eax, dword [ebp - 0x238]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
movups xmm0, xmmword [ebp - 0x238]
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0
movups xmmword [esi], xmm0
movq xmm0, qword [ebp - 0x228]
movq qword [esi + 0x10], xmm0
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00482225
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.004c022b
int3