Function at 0x18005dff0
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov dword [rsp + 0x18], r8d
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
mov r12, qword [rcx + 0x18]
mov rsi, rcx
sub r12, qword [rcx + 0x10]
mov r15, rdx
mov rcx, rdx
sar r12, 3
movsxd rdi, r8d
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_clearerr]
lea ebx, [rdi + 1]
mov rcx, rsi
mov dword [rsp + 0x88], ebx
sub r12d, edi
jne 0x18005e04e
mov r8d, 1
mov rdx, r15
call fcn.18005e310
mov ebp, eax
jmp 0x18005e2ad
lea edx, [r12 + 0x14]
lea r8, str.too_many_arguments
call sym.lua51.dll_luaL_checkstack
mov edx, edi
lea r13, [rdi*8]
mov dword [rsp + 0x70], edx
mov ebp, 1
mov r9d, ebx
dec r12d
test ebp, ebp
je 0x18005e2a2
mov rcx, qword [rsi + 0x10]
mov eax, dword [rcx + r13 + 4]
cmp eax, 0xfffffffb
jne 0x18005e1bd
mov eax, dword [rcx + r13]
movzx ecx, byte [rax + 0x10]
cmp cl, 0x2a
jne 0x18005e0a3
movzx ecx, byte [rax + 0x11]
cmp cl, 0x6e
jne 0x18005e0ee
lea r8, [rsp + 0x20]
mov rcx, r15
lea rdx, [0x18006b374]
call sym.lua51.dll_fscanf
mov rcx, qword [rsi + 0x18]
cmp eax, 1
jne 0x18005e0db
movsd xmm0, qword [rsp + 0x20]
mov ebp, eax
movsd qword [rcx], xmm0
add qword [rsi + 0x18], 8
jmp 0x18005e274
mov dword [rcx + 4], 0xffffffff
add qword [rsi + 0x18], 8
xor ebp, ebp
jmp 0x18005e274
movzx eax, cl
and al, 0xdf
cmp al, 0x4c
jne 0x18005e113
xor r8d, r8d
mov rdx, r15
cmp cl, 0x6c
mov rcx, rsi
sete r8b
call fcn.18005e310
mov ebp, eax
jmp 0x18005e274
cmp cl, 0x61
mov rcx, rsi
jne 0x18005e2f1
mov ebx, 0x200
mov edx, ebx
call fcn.180015ae0
mov r9, r15
mov edx, 1
mov r8d, ebx
mov rcx, rax
mov r14, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov rdi, rax
cmp eax, ebx
jne 0x18005e17e
nop dword [rax]
add ebx, ebx
mov rcx, rsi
mov edx, ebx
call fcn.180015ae0
mov r8d, ebx
mov ecx, edi
sub r8d, edi
add rcx, rax
mov r9, r15
mov edx, 1
mov r14, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add edi, eax
cmp edi, ebx
je 0x18005e150
mov rbx, qword [rsi + 0x18]
mov rdx, r14
mov r8d, edi
mov rcx, rsi
lea rax, [rbx + 8]
mov qword [rsi + 0x18], rax
call fcn.180050890
mov dword [rbx], eax
mov dword [rbx + 4], 0xfffffffb
mov ecx, dword [rsi + 8]
mov eax, dword [rcx + 0x24]
cmp dword [rcx + 0x20], eax
jb 0x18005e274
mov rcx, rsi
call fcn.18002fbc0
jmp 0x18005e274
mov edx, r9d
mov rcx, rsi
cmp eax, 0xfffeffff
ja 0x18005e2ff
call fcn.1800367b0
mov ebx, eax
test eax, eax
je 0x18005e23a
mov edx, ebx
mov rcx, rsi
call fcn.180015ae0
mov r8d, ebx
mov r9, r15
mov edx, 1
mov rcx, rax
mov rdi, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov rbx, qword [rsi + 0x18]
mov rdx, rdi
mov r8d, eax
mov r14, rax
lea rcx, [rbx + 8]
mov qword [rsi + 0x18], rcx
mov rcx, rsi
call fcn.180050890
mov dword [rbx], eax
mov dword [rbx + 4], 0xfffffffb
mov edx, dword [rsi + 8]
mov ecx, dword [rdx + 0x24]
cmp dword [rdx + 0x20], ecx
jb 0x18005e233
mov rcx, rsi
call fcn.18002fbc0
xor ebp, ebp
test r14d, r14d
jmp 0x18005e270
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
mov ecx, eax
mov rdx, r15
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ungetc]
mov rdx, qword [rsi + 0x18]
xor ebp, ebp
lea rcx, [rdx + 8]
mov qword [rsi + 0x18], rcx
mov ecx, dword [rsi + 8]
add ecx, 0x6c
mov dword [rdx + 4], 0xfffffffb
mov dword [rdx], ecx
cmp ebx, 0xffffffff
setne bpl
mov edx, dword [rsp + 0x70]
add r13, 8
mov r9d, dword [rsp + 0x88]
inc edx
inc r9d
mov dword [rsp + 0x70], edx
mov dword [rsp + 0x88], r9d
test r12d, r12d
jne 0x18005e075
mov ebx, edx
jmp 0x18005e2a6
mov ebx, dword [rsp + 0x70]
mov edi, dword [rsp + 0x80]
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ferror]
test eax, eax
je 0x18005e2c9
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call sym.lua51.dll_luaL_fileresult
jmp 0x18005e2dc
test ebp, ebp
jne 0x18005e2d8
mov rcx, qword [rsi + 0x18]
mov dword [rcx - 4], 0xffffffff
sub ebx, edi
mov eax, ebx
mov rbx, qword [rsp + 0x78]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
inc edx
mov r8d, 0x4eb
call fcn.180029ad0
int3
mov r8d, 0x4c8
call fcn.180029ad0
int3