Function at 0x4016e6
Capabilities:
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0x80000000
mov dword [esp], str.w64devkit.ini
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileW]
call eax
sub esp, 0x1c
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x401740
mov eax, 0
jmp 0x401a30
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 1
mov dword [esp + 8], 4
mov dword [esp + 4], 0xc
lea eax, [ebp + 0xc]
mov dword [esp], eax
call fcn.0040114a
mov dword [ebp - 0x20], eax
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0x40000
mov dword [esp + 8], 1
mov dword [esp + 4], 1
lea eax, [ebp + 0xc]
mov dword [esp], eax
call fcn.0040114a
mov edx, eax
mov eax, dword [ebp - 0x20]
mov dword [eax], edx
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x38]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x40000
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ReadFile]
call eax
sub esp, 0x14
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
cmp dword [ebp - 0x24], 0
je 0x4017f3
mov eax, dword [ebp - 0x38]
cmp eax, 0x40000
jne 0x4017fd
mov eax, 0
jmp 0x401a30
mov eax, dword [ebp - 0x20]
mov edx, dword [eax]
mov eax, dword [ebp - 0x38]
add edx, eax
mov eax, dword [ebp - 0x20]
mov dword [eax + 4], edx
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
lea eax, [ebp - 0x44]
mov edx, dword [ebp - 0x20]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.004013ca
mov eax, dword [ebp - 0x3c]
cmp eax, 3
je 0x401897
cmp eax, 3
ja 0x4018dd
cmp eax, 2
je 0x40187d
cmp eax, 2
ja 0x4018dd
test eax, eax
je 0x4018dc
cmp eax, 1
jne 0x4018dd
mov eax, dword [ebp - 0x44]
mov edx, dword [ebp - 0x40]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00401614
mov dword [ebp - 0x14], eax
jmp 0x401946
mov eax, dword [ebp - 0x44]
mov edx, dword [ebp - 0x40]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00401614
mov dword [ebp - 0x18], eax
jmp 0x401946
cmp dword [ebp - 0xc], 0
jne 0x401945
cmp dword [ebp - 0x14], 1
jne 0x401945
cmp dword [ebp - 0x18], 2
jne 0x401945
mov eax, dword [ebp - 0x44]
mov edx, dword [ebp - 0x40]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
lea eax, [ebp + 0xc]
mov dword [esp], eax
call fcn.00401681
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x40]
add eax, 1
mov dword [ebp - 0x10], eax
jmp 0x401945
nop
mov eax, dword [ebp - 0x10]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 2
mov dword [esp + 4], 2
lea eax, [ebp + 0xc]
mov dword [esp], eax
call fcn.0040114a
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0x28]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0xc]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov eax, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
call eax
sub esp, 0x18
test eax, eax
je 0x40194b
jmp 0x401955
nop
jmp 0x401829
mov eax, 0
jmp 0x401a30
mov dword [ebp - 0x2c], 0x410
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 2
mov dword [esp + 4], 2
lea eax, [ebp + 0xc]
mov dword [esp], eax
call fcn.0040114a
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
call eax
sub esp, 0xc
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x4019b8
mov eax, dword [ebp - 0x10]
cmp dword [ebp - 0x2c], eax
jae 0x4019bf
mov eax, 0
jmp 0x401a30
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x104
mov dword [esp + 8], 2
mov dword [esp + 4], 2
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0040114a
mov dword [ebp - 0x34], eax
mov dword [esp + 0xc], 0
mov eax, dword [ebp - 0x34]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x104
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
call eax
sub esp, 0x10
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x401a26
cmp dword [ebp - 0x10], 0x103
jbe 0x401a2d
mov eax, 0
jmp 0x401a30
mov eax, dword [ebp - 0x34]
leave
ret