Function at 0x402d80
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov eax, 0x80ac
mov ebp, esp
push edi
push esi
push ebx
call fcn.004063d0
mov ecx, 0x20
sub esp, eax
xor eax, eax
mov esi, dword [ebp + 8]
lea edi, [ebp - 0x8097]
mov edx, dword [ebp + 0xc]
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x8017]
lea ebx, [ebp - 0x8097]
mov cx, 0x7fff
rep stosb byte es:[edi], al
cmp byte [edx], 0
je 0x402fc2
mov dword [esp], edx
mov dword [esp + 4], 0x25
mov dword [ebp - 0x809c], edx
call sub.msvcrt.dll_strchr
mov edx, dword [ebp - 0x809c]
test eax, eax
mov edi, eax
je 0x402fb6
lea eax, [eax + 1]
mov dword [esp + 4], 0x25
mov dword [esp], eax
mov dword [ebp - 0x80a4], edx
mov dword [ebp - 0x80a0], eax
call sub.msvcrt.dll_strchr
test eax, eax
mov dword [ebp - 0x809c], eax
je 0x402fc9
mov edx, dword [ebp - 0x80a4]
mov ecx, edi
mov dword [esp], esi
sub ecx, edx
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
call sub.msvcrt.dll_strncat
mov eax, dword [ebp - 0x809c]
mov dword [esp], ebx
mov byte [ebp - 0x8097], 0
sub eax, edi
mov edi, esi
dec eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x80a0]
mov dword [esp + 4], eax
call sub.msvcrt.dll_strncat
xor eax, eax
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov dword [esp + 4], str.EXEDIR
mov dword [esp], ebx
not ecx
lea edi, [esi + ecx - 1]
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402e93
mov eax, dword [ebp + 0x14]
mov dword [esp], esi
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
call sub.msvcrt.dll_strncat
jmp 0x402f89
mov dword [esp + 4], str.EXEFILE
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402eaf
mov eax, dword [ebp + 0x10]
jmp 0x402f7d
mov dword [esp + 4], 0x4083de
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402eda
mov dword [esp + 4], edi
mov dword [esp], 0x104
call sub.kernel32.dll_GetCurrentDirectoryA
push eax
push eax
jmp 0x402f89
mov dword [esp + 4], str.OLDPWD
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402efb
mov dword [esp + 4], 0x413734
jmp 0x402f81
mov dword [esp + 4], str.JREHOMEDIR
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402f19
mov dword [esp + 4], 0x413630
jmp 0x402f81
mov dword [esp + 4], str.HKEY
mov dword [esp], ebx
call sub.msvcrt.dll_strstr
cmp eax, ebx
jne 0x402f43
mov dword [esp + 8], 0x400
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.004021ce
jmp 0x402f89
cmp byte [ebp - 0x8097], 0
jne 0x402f56
mov dword [esp + 4], 0x4083f9
jmp 0x402f81
lea eax, [ebp - 0x8017]
mov dword [esp + 8], 0x7fff
mov dword [esp + 4], eax
mov dword [esp], ebx
call sub.kernel32.dll_GetEnvironmentVariableA
sub esp, 0xc
test eax, eax
je 0x402f89
lea eax, [ebp - 0x8017]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_strcat
mov eax, dword [0x40b07c]
test eax, eax
je 0x402faa
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Substitute:_t_s___s_n
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov edx, dword [ebp - 0x809c]
inc edx
jmp 0x402db9
mov dword [esp + 4], edx
mov dword [esp], esi
call sub.msvcrt.dll_strcat
mov eax, 1
jmp 0x402fcb
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret