Function at 0x402254
Capabilities:
Check if file exists
Get file attributes
Get file size
Query environment variable
Read file via mapping
Set environment variable
Set file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff3fc
pushal
mov dword [ebp - 0xc04], 0
mov byte [0x40bc66], 0
push 0x400
lea eax, [ebp - 0xc00]
push eax
push dword [ebp + 8]
call sub.kernel32.dll_ExpandEnvironmentStringsA
push 0x400
push 0x40b44d
lea eax, [ebp - 0xc00]
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsA
mov esi, 0x40b44d
jmp 0x4022bc
lodsb al, byte [esi]
cmp al, 0x25
jne 0x4022bc
push 0x40b44d
call fcn.00405db0
push eax
push 0x40b44d
call sub.kernel32.dll_lstrcpyA
jmp 0x4022c1
cmp byte [esi], 0
jne 0x4022a0
mov edi, 0x40b44d
cmp byte [edi + 1], 0x3a
je 0x40231b
push 0x400
lea eax, [ebp - 0xc00]
push eax
push 0
call sub.kernel32.dll_GetModuleFileNameA
lea eax, [ebp - 0xc00]
push eax
call fcn.00402086
cmp byte [edi], 0x5c
je 0x402301
push 0x40b0fb
lea eax, [ebp - 0xc00]
push eax
call sub.kernel32.dll_lstrcatA
push edi
lea eax, [ebp - 0xc00]
push eax
call sub.kernel32.dll_lstrcatA
lea eax, [ebp - 0xc00]
push eax
push edi
call sub.kernel32.dll_lstrcpyA
push 0x40b44d
call sub.kernel32.dll_GetFileAttributesA
mov dword [0x40bc4d], eax
test dword [ebp + 0x10], 0x80000000
je 0x402335
jmp 0x402354
test eax, 1
je 0x40234a
xor eax, 1
push eax
push 0x40b44d
call sub.kernel32.dll_SetFileAttributesA
push 0x40b44d
call fcn.0040211d
test dword [ebp + 0x10], 0x80000000
je 0x40237b
push 0
push 0x82
push 3
push 0
push 1
push 0x80000000
push 0x40b44d
call sub.kernel32.dll_CreateFileA
jmp 0x402397
push 0
push 0x82
push 3
push 0
push 2
push 0xc0000000
push 0x40b44d
call sub.kernel32.dll_CreateFileA
cmp eax, 0xffffffff
jne 0x40251b
cmp byte [0x40c094], 0
jne 0x402516
push 0x40b44d
call sub.kernel32.dll_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x40248e
push 0x40b44d
call fcn.00405db0
cmp word [eax], 0x2e2a
je 0x40240e
cmp word [eax], 0
je 0x40240e
push 0x400
push 0x40e8b9
push 0x10
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x34
push 0x40b44d
push 0x40e8b9
push dword [0x40b3e6]
call sub.user32.dll_MessageBoxA
cmp eax, 6
jne 0x402516
lea esi, [ebp - 0x400]
mov edi, 0x40b44d
cmp byte [edi + 1], 0x3a
jne 0x402427
push edi
call fcn.00405db0
mov edi, eax
push edi
push esi
call sub.kernel32.dll_lstrcpyA
push esi
call fcn.00405c60
cmp eax, 0
jbe 0x40243a
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
push esi
call sub.kernel32.dll_RtlMoveMemory
pop esi
lea ebx, [ebp - 0x800]
push 0x40b44d
push ebx
call sub.kernel32.dll_lstrcpyA
push ebx
call fcn.00402086
push dword [0x40b3e6]
push ebx
push esi
push 0x40b44d
call fcn.00405d40
cmp eax, 1
jne 0x402489
jmp 0x40231b
jmp 0x402516
test dword [ebp + 0x10], 2
je 0x4024de
cmp byte [0x40bc66], 0
jne 0x402516
push 0x40b44d
call fcn.00402202
cmp eax, 1
jne 0x4024dc
mov byte [0x40bc66], 1
push 0x400
push 0x40ecb9
push 0x11
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x40ecb9
call fcn.004020dc
jmp 0x40231b
jmp 0x402516
push 0x400
push 0x40f0b9
push 0x12
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x34
push 0x40b44d
push 0x40f0b9
push dword [0x40b3e6]
call sub.user32.dll_MessageBoxA
cmp eax, 6
jne 0x402516
jmp 0x40231b
jmp 0x40266b
mov dword [0x40bc51], eax
push 0x400
push 0x40f4b9
push 0x13
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x40f4b9
call fcn.004020dc
push 0x40b44d
call fcn.004020dc
push 0
push dword [0x40bc51]
call sub.kernel32.dll_GetFileSize
mov dword [0x40bc55], eax
cmp dword [ebp + 0xc], 0
jne 0x402566
mov dword [ebp + 0xc], eax
test dword [ebp + 0x10], 4
je 0x402588
add eax, 0x232
add eax, dword [0x40b3c0]
push 0x100
push eax
call fcn.00405df0
mov dword [ebp + 0xc], eax
push dword [ebp + 0xc]
pop dword [0x40bc61]
test dword [ebp + 0x10], 0x80000000
je 0x4025b1
push 0
push 0
push 0
push 2
push 0
push dword [0x40bc51]
call sub.kernel32.dll_CreateFileMappingA
jmp 0x4025ca
push 0
push dword [0x40bc61]
push 0
push 4
push 0
push dword [0x40bc51]
call sub.kernel32.dll_CreateFileMappingA
or eax, eax
jne 0x4025f1
push 0x400
push 0x40f8b9
push 0x14
push dword [0x40b3e2]
call sub.user32.dll_LoadStringA
push 0x40f8b9
call fcn.004020dc
jmp 0x40266b
mov dword [0x40bc5d], eax
test dword [ebp + 0x10], 0x80000000
je 0x40260f
push 0
push 0
push 0
push 4
push eax
call sub.kernel32.dll_MapViewOfFile
jmp 0x40261d
push 0
push 0
push 0
push 2
push eax
call sub.kernel32.dll_MapViewOfFile
or eax, eax
jne 0x402623
jmp 0x4025ce
mov dword [0x40bc59], eax
mov dword [ebp - 0xc04], eax
push 0x40b44d
push 0x40b12b
call sub.kernel32.dll_SetEnvironmentVariableA
push 0x40b44d
lea eax, [ebp - 0xc00]
push eax
call sub.kernel32.dll_lstrcpyA
lea eax, [ebp - 0xc00]
push eax
call fcn.00402086
lea eax, [ebp - 0xc00]
push eax
push 0x40b13a
call sub.kernel32.dll_SetEnvironmentVariableA
popal
mov eax, dword [ebp - 0xc04]
leave
ret 0xc