Function at 0x40109e
Capabilities:
Check if file exists
Query environment variable
Set environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2083c
call fcn.00401af0
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
push 0x104
push edi
push 0
mov dword [ebp - 0x20834], eax
mov dword [ebp - 0x2083c], edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x4010e1
call fcn.00401000
push edi
call fcn.0040169b
mov ebx, eax
pop ecx
movzx ecx, word [ebx]
lea eax, [ebp - 0x41c]
test cx, cx
je 0x401112
mov esi, ebx
mov edx, eax
movzx ecx, cx
sub esi, edx
mov word [eax], cx
inc eax
inc eax
movzx edx, word [esi + eax]
movzx ecx, dx
test dx, dx
jne 0x401101
mov ecx, eax
lea edx, [ebp - 0x41c]
sub ecx, edx
and ecx, 0xfffffffe
cmp ecx, 8
jl 0x40115b
cmp word [eax - 8], 0x2e
jne 0x40115b
movzx ecx, word [eax - 6]
cmp cx, 0x45
je 0x40113b
cmp cx, 0x65
jne 0x40115b
movzx ecx, word [eax - 4]
cmp cx, 0x58
je 0x40114b
cmp cx, 0x78
jne 0x40115b
movzx ecx, word [eax - 2]
cmp cx, 0x45
je 0x401164
cmp cx, 0x65
je 0x401164
push 0x2e
pop ecx
mov word [eax], cx
add eax, 8
push 0x62
pop ecx
push 0x69
mov word [eax - 6], cx
pop ecx
push 0x6e
mov word [eax - 4], cx
pop ecx
mov word [eax - 2], cx
lea ecx, [ebp - 0x41c]
sub eax, ecx
sar eax, 1
push eax
mov eax, ecx
push eax
push ebx
push edi
push dword [ebp - 0x20834]
call fcn.004016bb
push 0xd
push str..._basis_link
xor eax, eax
push ebx
mov word [ebx], ax
lea eax, [ebp - 0x20c]
push edi
push eax
call fcn.004016bb
add esp, 0x28
test eax, eax
jne 0x4011ba
call fcn.00401000
and dword [ebp - 0x20838], 0
mov esi, 0x7fff
push esi
lea eax, [ebp - 0x2082c]
push eax
push 0x403158
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, eax
cmp edi, esi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20834], edi
jae 0x4011f8
test edi, edi
jne 0x4011fd
call esi
cmp eax, 0xcb
je 0x4011fd
call fcn.00401000
xor eax, eax
mov word [ebp + edi*2 - 0x2082c], ax
lea eax, [ebp - 0x20c]
push eax
call fcn.004017d2
mov edi, eax
pop ecx
test edi, edi
jne 0x401296
call esi
cmp eax, 2
je 0x401226
call fcn.00401000
push 2
push 0x403164
push ebx
push dword [ebp - 0x2083c]
lea eax, [ebp - 0x20c]
push eax
call fcn.004016bb
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x40124e
call fcn.00401000
push 0xb
push str...program
push edi
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x1082c]
push eax
call fcn.004016bb
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x401277
call fcn.00401000
push ebx
lea eax, [ebp - 0x1082c]
push eax
lea eax, [ebp - 0x2082c]
push eax
call fcn.0040104f
add esp, 0xc
mov byte [ebp - 0x2082d], al
jmp 0x4012a3
mov ebx, dword [ebp - 0x20838]
mov byte [ebp - 0x2082d], 1
cmp byte [ebp - 0x2082d], 0
lea esi, [ebp - 0x1082c]
jne 0x4012b5
lea esi, [ebx + 2]
push 0
push 0x403184
lea eax, [ebp - 0x20c]
push edi
push eax
push eax
call fcn.004016bb
add esp, 0x14
test eax, eax
jne 0x4012d6
call fcn.00401000
push ebx
lea eax, [ebp - 0x2082c]
push esi
push eax
call fcn.0040104f
add esp, 0xc
cmp byte [ebp - 0x2082d], 0
je 0x401348
test al, al
jne 0x401339
mov eax, ebx
xor ecx, ecx
cmp dword [ebp - 0x20834], ecx
je 0x401308
push 0x3b
pop edx
mov word [eax], dx
inc eax
inc eax
mov dx, word [ebp + ecx*2 - 0x2082c]
mov word [eax], dx
inc eax
inc eax
inc ecx
cmp ecx, dword [ebp - 0x20834]
jbe 0x401308
lea eax, [ebp - 0x1082c]
push eax
push str.PATH
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x401339
call fcn.00401000
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401ae1
leave
ret
test al, al
jne 0x401355
push 0x3b
pop eax
mov word [esi - 2], ax
jmp 0x4012f4
lea eax, [esi - 2]
jmp 0x4012f6