Function at 0x402a7b
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.0040b3d0
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 0x402cbd
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 0x402cb1
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 0x402cc4
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 0x402b8e
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 0x402c84
mov dword [esp + 4], str.EXEFILE
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402baa
mov eax, dword [ebp + 0x10]
jmp 0x402c78
mov dword [esp + 4], 0x40d288
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402bd5
mov dword [esp + 4], edi
mov dword [esp], 0x104
call sub.kernel32.dll_GetCurrentDirectoryA
push eax
push eax
jmp 0x402c84
mov dword [esp + 4], str.OLDPWD
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402bf6
mov dword [esp + 4], 0x418fe0
jmp 0x402c7c
mov dword [esp + 4], str.JREHOMEDIR
mov dword [esp], ebx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402c14
mov dword [esp + 4], 0x418edc
jmp 0x402c7c
mov dword [esp + 4], str.HKEY
mov dword [esp], ebx
call sub.msvcrt.dll_strstr
cmp eax, ebx
jne 0x402c3e
mov dword [esp + 8], 0x400
mov dword [esp + 4], edi
mov dword [esp], ebx
call fcn.004021de
jmp 0x402c84
cmp byte [ebp - 0x8097], 0
jne 0x402c51
mov dword [esp + 4], 0x40d2a3
jmp 0x402c7c
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 0x402c84
lea eax, [ebp - 0x8017]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_strcat
mov eax, dword [0x410a2c]
test eax, eax
je 0x402ca5
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 0x402ab4
mov dword [esp + 4], edx
mov dword [esp], esi
call sub.msvcrt.dll_strcat
mov eax, 1
jmp 0x402cc6
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret