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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x20838
call fcn.004021c0
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 - 0x20830], eax
mov dword [ebp - 0x20834], edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x4010e1
call fcn.00401000
push edi
call fcn.00401d66
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 - 0x20830]
call fcn.00401d86
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.00401d86
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 0x4031a8
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, eax
cmp edi, esi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20830], 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.00401e9d
mov edi, eax
pop ecx
test edi, edi
jne 0x401292
call esi
cmp eax, 2
je 0x401226
call fcn.00401000
push 2
push 0x4031b4
push ebx
push dword [ebp - 0x20834]
lea eax, [ebp - 0x20c]
push eax
call fcn.00401d86
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.00401d86
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x401277
call fcn.00401000
push esi
lea eax, [ebp - 0x1082c]
push eax
lea eax, [ebp - 0x2082c]
push eax
call fcn.0040104f
add esp, 0xc
mov bl, al
jmp 0x40129a
mov esi, dword [ebp - 0x20838]
mov bl, 1
test bl, bl
je 0x4012a6
lea esi, [ebp - 0x1082c]
jmp 0x4012a9
add esi, 2
push 9
push str.ure_link
lea eax, [ebp - 0x20c]
push edi
push eax
push eax
call fcn.00401d86
add esp, 0x14
test eax, eax
jne 0x4012ca
call fcn.00401000
lea eax, [ebp - 0x20c]
push eax
call fcn.00401e9d
mov edi, eax
pop ecx
test edi, edi
jne 0x4012e2
call fcn.00401000
push 4
push str._bin
push edi
lea eax, [ebp - 0x20c]
push eax
push esi
call fcn.00401d86
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x401305
call fcn.00401000
push edi
lea eax, [ebp - 0x2082c]
push esi
push eax
call fcn.0040104f
add esp, 0xc
test bl, bl
je 0x401372
test al, al
jne 0x401363
mov eax, edi
xor ecx, ecx
cmp dword [ebp - 0x20830], ecx
je 0x401332
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 - 0x20830]
jbe 0x401332
lea eax, [ebp - 0x1082c]
push eax
push str.PATH
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x401363
call fcn.00401000
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004021ac
leave
ret
test al, al
jne 0x40137f
push 0x3b
pop eax
mov word [esi - 2], ax
jmp 0x40131e
lea eax, [esi - 2]
jmp 0x401320