Function at 0x401e3e
Capabilities:
Check if file exists
Get file attributes
Get file size
Query environment variable
Set environment variable
Set file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff7fc
pushal
mov dword [ebp - 0x804], 0
mov byte [0x406bc5], 0
push 0x400
push 0x4063ac
push dword [ebp + 8]
call sub.kernel32.dll_ExpandEnvironmentStringsA
mov esi, 0x4063ac
jmp 0x401e8e
lodsb al, byte [esi]
cmp al, 0x25
jne 0x401e8e
push 0x4063ac
call fcn.004048b0
push eax
push 0x4063ac
call sub.kernel32.dll_lstrcpyA
jmp 0x401e93
cmp byte [esi], 0
jne 0x401e72
push 0x4063ac
call sub.kernel32.dll_GetFileAttributesA
mov dword [0x406bac], eax
test eax, 1
je 0x401eb7
xor eax, 1
push eax
push 0x4063ac
call sub.kernel32.dll_SetFileAttributesA
push 0x4063ac
call fcn.00401d07
push 0
push 0x82
push 3
push 0
push 2
push 0xc0000000
push 0x4063ac
call sub.kernel32.dll_CreateFileA
cmp eax, 0xffffffff
jne 0x402061
cmp byte [0x406feb], 0
jne 0x40205c
push 0x4063ac
call sub.kernel32.dll_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x401fd4
push 0x4063ac
call fcn.004048b0
cmp word [eax], 0x2e2a
je 0x401f54
cmp word [eax], 0
je 0x401f54
push 0x400
push 0x407810
push 0x10
push dword [0x406342]
call sub.user32.dll_LoadStringA
push 0x34
push 0x4063ac
push 0x407810
push dword [0x406346]
call sub.user32.dll_MessageBoxA
cmp eax, 6
jne 0x40205c
lea esi, [ebp - 0x400]
mov edi, 0x4063ac
cmp byte [edi + 1], 0x3a
jne 0x401f6d
push edi
call fcn.004048b0
mov edi, eax
push edi
push esi
call sub.kernel32.dll_lstrcpyA
push esi
call sub.kernel32.dll_lstrlenA
cmp eax, 0
jbe 0x401f80
inc eax
push esi
push eax
add esi, eax
push edi
push esi
call sub.kernel32.dll_lstrcpyA
pop eax
add esi, eax
push 0x2e
push str.Exe_Files__.exe_
push esi
call sub.kernel32.dll_RtlMoveMemory
pop esi
lea ebx, [ebp - 0x800]
push 0x4063ac
push ebx
call sub.kernel32.dll_lstrcpyA
push ebx
call fcn.00401c70
push dword [0x406346]
push ebx
push esi
push 0x4063ac
call fcn.00404850
cmp eax, 1
jne 0x401fcf
jmp 0x401e93
jmp 0x40205c
test dword [ebp + 0x10], 2
je 0x402024
cmp byte [0x406bc5], 0
jne 0x40205c
push 0x4063ac
call fcn.00401dec
cmp eax, 1
jne 0x402022
mov byte [0x406bc5], 1
push 0x400
push 0x407c10
push 0x11
push dword [0x406342]
call sub.user32.dll_LoadStringA
push 0x407c10
call fcn.00401cc6
jmp 0x401e93
jmp 0x40205c
push 0x400
push 0x408010
push 0x12
push dword [0x406342]
call sub.user32.dll_LoadStringA
push 0x34
push 0x4063ac
push 0x408010
push dword [0x406346]
call sub.user32.dll_MessageBoxA
cmp eax, 6
jne 0x40205c
jmp 0x401e93
jmp 0x40214a
mov dword [0x406bb0], eax
push 0x400
push 0x408410
push 0x13
push dword [0x406342]
call sub.user32.dll_LoadStringA
push 0x408410
call fcn.00401cc6
push 0x4063ac
call fcn.00401cc6
push 0
push dword [0x406bb0]
call sub.kernel32.dll_GetFileSize
mov dword [0x406bb4], eax
cmp dword [ebp + 0xc], 0
jne 0x4020ac
mov dword [ebp + 0xc], eax
test dword [ebp + 0x10], 4
je 0x4020ce
add eax, 0x237
add eax, dword [0x406320]
push 0x100
push eax
call fcn.004048f0
mov dword [ebp + 0xc], eax
push dword [ebp + 0xc]
pop dword [0x406bc0]
push 0
push dword [0x406bc0]
push 0
push 4
push 0
push dword [0x406bb0]
call sub.kernel32.dll_CreateFileMappingA
or eax, eax
jne 0x402117
push 0x400
push 0x408810
push 0x14
push dword [0x406342]
call sub.user32.dll_LoadStringA
push 0x408810
call fcn.00401cc6
jmp 0x40214a
mov dword [0x406bbc], eax
push 0
push 0
push 0
push 2
push eax
call sub.kernel32.dll_MapViewOfFile
or eax, eax
jne 0x402130
jmp 0x4020f4
mov dword [0x406bb8], eax
mov dword [ebp - 0x804], eax
push 0x4063ac
push str.dup2_last_file
call sub.kernel32.dll_SetEnvironmentVariableA
popal
mov eax, dword [ebp - 0x804]
leave
ret 0xc