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

Disassembly:
sub esp, 0x10c
mov eax, dword [esp + 0x114]
push ebx
push ebp
push esi
lea ebp, [eax + 0x108]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
push ebp
mov dword [esp + 0x14], ebp
call edi
cmp eax, 0xffffffff
jne 0x41241b
lea ecx, [esp + 0x18]
push 0x104
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
mov al, byte [esp + 0x18]
lea esi, [esp + 0x18]
cmp al, 0x22
jne 0x4122f5
lea edx, [esp + 0x19]
push 0x22
push edx
call dword [sym.imp.MSVCRT.dll__mbschr]
add esp, 8
test eax, eax
je 0x4122f1
mov byte [eax], 0
lea esi, [esp + 0x19]
push esi
call edi
cmp eax, 0xffffffff
jne 0x41233a
or ecx, eax
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x18]
mov edi, ecx
add edi, esi
cmp edi, eax
jbe 0x41233a
mov bl, byte [edi]
cmp bl, 0x20
je 0x412320
cmp bl, 9
jne 0x412331
push esi
mov byte [edi], 0
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x41233a
mov byte [edi], bl
dec edi
lea ecx, [esp + 0x18]
cmp edi, ecx
ja 0x412314
mov edi, str.SystemRoot_
or ecx, 0xffffffff
xor eax, eax
mov ebx, ebp
repne scasb al, byte es:[edi]
not ecx
mov ebp, dword [sym.imp.MSVCRT.dll__mbsnbicmp]
dec ecx
mov edi, ecx
push edi
push esi
push str.SystemRoot_
call ebp
add esp, 0xc
test eax, eax
jne 0x412379
push 0x104
push ebx
add esi, edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
add ebx, eax
mov byte [ebx], 0x5c
inc ebx
jmp 0x4123d3
mov edi, str.system32_
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
push edi
push esi
push str.system32_
call ebp
add esp, 0xc
test eax, eax
jne 0x4123b0
push 0x104
push ebx
add esi, edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
add ebx, eax
mov byte [ebx], 0x5c
inc ebx
jmp 0x4123d3
mov edi, 0x41d588
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
push edi
push esi
push 0x41d588
call ebp
add esp, 0xc
test eax, eax
jne 0x4123d3
add esi, edi
push esi
push 0x41958c
push ebx
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ebx, dword [esp + 0x1c]
add esp, 0xc
lea edx, [esp + 0x18]
push 0
push edx
push 0x104
push ebx
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
lea edi, [esp + 0x18]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ebx, dword [esp + 0x120]
mov eax, 0x3e88cb3d
mov ecx, dword [ebx + 8]
mov edx, dword [ebx + 0xc]
sub edx, ecx
mov ebp, ecx
imul edx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, 1
jae 0x41256f
mov esi, dword [ebx + 4]
test esi, esi
je 0x412469
mov edx, ecx
mov eax, 0x3e88cb3d
sub edx, esi
imul edx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, 1
mov edi, edx
ja 0x41246e
mov edi, 1
test esi, esi
jne 0x412476
xor edx, edx
jmp 0x412489
sub ecx, esi
mov eax, 0x3e88cb3d
imul ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
lea eax, [edx + edi]
test eax, eax
mov dword [esp + 0x10], eax
jge 0x412496
xor eax, eax
mov edx, eax
shl edx, 6
add edx, eax
lea eax, [eax + edx*2]
shl eax, 2
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edi, dword [ebx + 4]
add esp, 4
cmp edi, ebp
mov dword [esp + 0x14], eax
mov esi, eax
je 0x4124d3
push edi
push esi
call fcn.00412720
add edi, 0x20c
add esp, 8
add esi, 0x20c
cmp edi, ebp
jne 0x4124b9
mov ecx, dword [esp + 0x124]
push ecx
push 1
push esi
mov ecx, ebx
call fcn.004126e0
mov edx, dword [ebx + 8]
add esi, 0x20c
push esi
push edx
push ebp
mov ecx, ebx
call fcn.004126a0
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 4]
push eax
push ecx
mov ecx, ebx
call fcn.00412690
mov edx, dword [ebx + 4]
push edx
call fcn.00413190
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
mov ecx, eax
add esp, 4
shl ecx, 6
add ecx, eax
lea edx, [eax + ecx*2]
lea eax, [esi + edx*4]
mov dword [ebx + 0xc], eax
mov eax, dword [ebx + 4]
test eax, eax
jne 0x412536
xor edx, edx
jmp 0x41254c
mov ecx, dword [ebx + 8]
sub ecx, eax
mov eax, 0x3e88cb3d
imul ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
lea eax, [edx + 1]
mov dword [ebx + 4], esi
mov edx, eax
pop edi
shl edx, 6
add edx, eax
lea eax, [eax + edx*2]
lea ecx, [esi + eax*4]
pop esi
mov dword [ebx + 8], ecx
pop ebp
pop ebx
add esp, 0x10c
ret 8
mov edx, ecx
mov eax, 0x3e88cb3d
sub edx, ebp
imul edx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, 1
jae 0x4125ec
lea edx, [ebp + 0x20c]
push edx
push ecx
push ebp
mov ecx, ebx
call fcn.004126a0
mov esi, dword [ebx + 8]
mov eax, dword [esp + 0x124]
mov ecx, esi
push eax
sub ecx, ebp
mov eax, 0x3e88cb3d
imul ecx
sar edx, 7
mov ecx, edx
mov eax, 1
shr ecx, 0x1f
add edx, ecx
mov ecx, ebx
sub eax, edx
push eax
push esi
call fcn.004126e0
mov eax, dword [ebx + 8]
cmp ebp, eax
je 0x412647
mov esi, dword [esp + 0x124]
mov edi, ebp
add ebp, 0x20c
mov ecx, 0x83
cmp ebp, eax
rep movsd dword es:[edi], dword [esi]
jne 0x4125d0
jmp 0x412647
push ecx
push ecx
add ecx, 0xfffffdf4
push ecx
mov ecx, ebx
call fcn.004126a0
mov edx, dword [ebx + 8]
lea eax, [edx - 0x20c]
cmp ebp, eax
je 0x412623
sub eax, 0x20c
sub edx, 0x20c
mov ecx, 0x83
mov esi, eax
mov edi, edx
cmp eax, ebp
rep movsd dword es:[edi], dword [esi]
jne 0x412609
lea eax, [ebp + 0x20c]
cmp ebp, eax
je 0x412647
mov esi, dword [esp + 0x124]
mov edi, ebp
add ebp, 0x20c
mov ecx, 0x83
cmp ebp, eax
rep movsd dword es:[edi], dword [esi]
jne 0x41262d
mov eax, dword [ebx + 8]
pop edi
add eax, 0x20c
pop esi
mov dword [ebx + 8], eax
pop ebp
pop ebx
add esp, 0x10c
ret 8