Function at 0x18013c860
Capabilities:
Check if file exists
Get file attributes
Parse pe header
Read file on windows

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x390]
sub rsp, 0x490
mov rax, qword [0x18018f008]
xor rax, rsp
mov qword [rbp + 0x380], rax
mov qword [rsp + 0x50], rcx
xor edi, edi
lea rcx, [rbp - 0x80]
mov qword [rsp + 0x58], rdx
mov qword [rsp + 0x70], rcx
mov r15, r8
mov rsi, 0xffffffffffffffff
mov dword [rsp + 0x78], edi
lea rcx, [rsp + 0x70]
mov dword [rsp + 0x7c], 0xc8
mov r8d, esi
mov byte [rbp - 0x80], dil
mov r13d, edi
call sym.tcl86t.dll_hcl_DStringAppend
movsxd rcx, dword [rsp + 0x78]
mov ebx, edi
test ecx, ecx
mov r14d, edi
mov r12d, edi
cmovns rbx, rcx
cmovns r14d, ecx
mov qword [rsp + 0x48], rbx
nop dword [rax + rax]
mov ebx, dword [rsp + 0x7c]
cmp r14d, ebx
jl 0x18013c964
add ebx, ebx
cmp r14d, ebx
jl 0x18013c904
lea ebx, [r14 + 1]
mov rcx, qword [rsp + 0x70]
lea rax, [rbp - 0x80]
mov dword [rsp + 0x7c], ebx
cmp rcx, rax
jne 0x18013c946
mov ecx, ebx
call sym.tcl86t.dll_hclpAlloc
mov rdi, rax
test rax, rax
jne 0x18013c92d
test ebx, ebx
jne 0x18013cdce
movsxd r8, dword [rsp + 0x78]
mov rcx, rdi
mov rdx, qword [rsp + 0x70]
call sub.VCRUNTIME140.dll_memcpy
mov qword [rsp + 0x70], rdi
jmp 0x18013c969
mov edx, ebx
call sym.tcl86t.dll_hclpRealloc
mov rdi, rax
test rax, rax
jne 0x18013c95d
test ebx, ebx
jne 0x18013cddd
mov qword [rsp + 0x70], rax
jmp 0x18013c969
mov rdi, qword [rsp + 0x70]
mov rax, qword [rsp + 0x48]
lea rcx, [rsp + 0x70]
mov dword [rsp + 0x78], r14d
mov r8d, esi
mov byte [rax + rdi], r13b
movsxd rax, r12d
lea rdx, [rax + rax*4]
lea rax, [0x18015fb48]
add rdx, rax
call sym.tcl86t.dll_hcl_DStringAppend
mov rcx, qword [rsp + 0x70]
lea rax, [rbp + 0x60]
xor edi, edi
mov qword [rbp + 0x50], rax
mov dword [rbp + 0x58], edi
mov dword [rbp + 0x5c], 0xc8
mov byte [rbp + 0x60], dil
test rcx, rcx
jne 0x18013c9bb
mov eax, edi
jmp 0x18013c9c8
mov edx, dword [rsp + 0x78]
lea r8, [rbp + 0x50]
call sym.tcl86t.dll_hcl_UtfToUniCharDString
lea rcx, [rsp + 0x60]
mov r9d, 0x104
mov qword [rsp + 0x28], rcx
xor r8d, r8d
lea rcx, [rbp + 0x170]
mov rdx, rax
mov qword [rsp + 0x20], rcx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SearchPathW]
mov rcx, qword [rbp + 0x50]
mov ebx, eax
lea rax, [rbp + 0x60]
cmp rcx, rax
je 0x18013ca06
call sym.tcl86t.dll_hclpFree
mov dword [rbp + 0x58], edi
lea rax, [rbp + 0x60]
mov qword [rbp + 0x50], rax
mov dword [rbp + 0x5c], 0xc8
mov byte [rbp + 0x60], dil
test ebx, ebx
je 0x18013cb9d
lea rcx, [rbp + 0x170]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x18013cb9d
test al, 0x10
jne 0x18013cb9d
lea rax, [rbp + 0x60]
mov dword [rbp + 0x58], edi
mov qword [rbp + 0x50], rax
lea rcx, [rbp + 0x170]
mov rax, rsi
mov dword [rbp + 0x5c], 0xc8
mov byte [rbp + 0x60], dil
inc rax
cmp word [rcx + rax*2], di
jne 0x18013ca62
lea r8, [rbp + 0x50]
mov edx, eax
lea rcx, [rbp + 0x170]
call sym.tcl86t.dll_hcl_UniCharToUtfDString
mov rdx, r15
sub rdx, rax
nop dword [rax]
nop word [rax + rax]
movzx ecx, byte [rax]
mov byte [rdx + rax], cl
lea rax, [rax + 1]
test cl, cl
jne 0x18013ca90
mov rcx, qword [rbp + 0x50]
lea rax, [rbp + 0x60]
cmp rcx, rax
je 0x18013cab0
call sym.tcl86t.dll_hclpFree
lea rax, [rbp + 0x60]
mov dword [rbp + 0x58], edi
mov edx, 0x2e
mov qword [rbp + 0x50], rax
mov rcx, r15
mov dword [rbp + 0x5c], 0xc8
mov byte [rbp + 0x60], dil
call qword [sym.imp.VCRUNTIME140.dll_strrchr]
mov rbx, rax
test rax, rax
je 0x18013cb0c
lea rdx, str..cmd
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
test eax, eax
je 0x18013cc22
lea rdx, str..bat
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
test eax, eax
je 0x18013cc22
xor r9d, r9d
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
lea rcx, [rbp + 0x170]
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, rsi
je 0x18013cb9d
xor eax, eax
lea r9, [rsp + 0x44]
lea rdx, [rbp + 0x130]
mov word [rbp + 0x130], ax
mov rcx, rdi
mov qword [rsp + 0x20], rax
lea r8d, [rax + 0x40]
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, 0x5a4d
mov rcx, rdi
cmp word [rbp + 0x130], ax
je 0x18013cbac
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test rbx, rbx
je 0x18013cb9d
lea rdx, str..com
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
test eax, eax
je 0x18013cc22
inc r12d
cmp r12d, 5
jl 0x18013c8f0
jmp 0x18013cc28
cmp word [rbp + 0x148], 0x40
je 0x18013cbbe
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x18013cc22
mov edx, dword [rbp + 0x16c]
xor r9d, r9d
xor r8d, r8d
mov byte [rsp + 0x40], r13b
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov qword [rsp + 0x20], r13
lea r9, [rsp + 0x44]
mov r13d, 2
lea rdx, [rsp + 0x40]
mov r8d, r13d
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
movzx eax, byte [rsp + 0x40]
cmp al, 0x4e
jne 0x18013cc11
cmp byte [rsp + 0x41], 0x45
jne 0x18013cc22
jmp 0x18013cc28
cmp al, 0x50
jne 0x18013cc22
cmp byte [rsp + 0x41], 0x45
mov r13d, 3
je 0x18013cc28
mov r13d, 1
mov rcx, qword [rsp + 0x70]
lea rax, [rbp - 0x80]
cmp rcx, rax
je 0x18013cc3b
call sym.tcl86t.dll_hclpFree
mov dword [rsp + 0x78], 0
lea rax, [rbp - 0x80]
mov qword [rsp + 0x70], rax
mov dword [rsp + 0x7c], 0xc8
mov byte [rbp - 0x80], 0
test r13d, r13d
jne 0x18013cd13
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x10c
jb 0x18013cc97
add eax, 0xffffd8cd
cmp eax, 0x25
jb 0x18013cc86
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], reloc.WS2_32.dll_shutdown
jmp 0x18013ccb0
lea rcx, [0x180000000]
movzx ebx, byte [rax + rcx + 0x15ea88]
jmp 0x18013cca8
mov eax, eax
lea rcx, [0x180000000]
movzx ebx, byte [rax + rcx + 0x15f8f0]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], ebx
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call sym.tcl86t.dll_hcl_ErrnoMsg
mov rbx, rax
call sym.tcl86t.dll_hcl_ErrnoId
mov rdi, qword [rsp + 0x50]
test rdi, rdi
je 0x18013cced
mov r9, rbx
mov qword [rsp + 0x20], 0
mov r8, rax
lea rdx, str.POSIX
mov rcx, rdi
call sym.tcl86t.dll_hcl_SetErrorCode
mov rdx, qword [rsp + 0x58]
lea rcx, str.couldnt_execute___s_:__s
mov r8, rbx
call sym.tcl86t.dll_hcl_ObjPrintf
mov rdx, rax
mov rcx, rdi
call sym.tcl86t.dll_hcl_SetObjResult
xor eax, eax
jmp 0x18013cda4
cmp r13d, 2
jne 0x18013cda1
mov r8d, 0x104
lea rdx, [rbp + 0x170]
lea rcx, [rbp + 0x170]
call qword [sym.imp.KERNEL32.dll_GetShortPathNameW]
lea rax, [rbp + 0x60]
mov dword [rbp + 0x58], 0
mov qword [rbp + 0x50], rax
lea rax, [rbp + 0x170]
mov dword [rbp + 0x5c], 0xc8
mov byte [rbp + 0x60], 0
nop dword [rax + rax]
inc rsi
cmp word [rax + rsi*2], 0
jne 0x18013cd60
lea r8, [rbp + 0x50]
mov edx, esi
lea rcx, [rbp + 0x170]
call sym.tcl86t.dll_hcl_UniCharToUtfDString
sub r15, rax
nop
movzx ecx, byte [rax]
mov byte [r15 + rax], cl
lea rax, [rax + 1]
test cl, cl
jne 0x18013cd80
mov rcx, qword [rbp + 0x50]
lea rax, [rbp + 0x60]
cmp rcx, rax
je 0x18013cda1
call sym.tcl86t.dll_hclpFree
mov eax, r13d
mov rcx, qword [rbp + 0x380]
xor rcx, rsp
call fcn.180146240
mov rbx, qword [rsp + 0x4e8]
add rsp, 0x490
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov edx, ebx
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, ebx
lea rcx, str.unable_to_realloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3