Function at 0x1400449a0
Capabilities:
Read file on windows

Disassembly:
push rbp
push rbx
push rsi
push r15
lea rbp, [rsp - 0x23a8]
mov eax, 0x24a8
call fcn.140056950
sub rsp, rax
mov rax, qword [0x14006c408]
xor rax, rsp
mov qword [rbp + 0x2380], rax
mov qword [rsp + 0x24e8], rdi
mov rsi, rdx
mov ebx, r9d
mov qword [rsp + 0x2498], r13
mov qword [rsp + 0x2490], r14
lea rdx, [0x140000000]
mov dword [rsp + 0x30], ebx
mov rdi, r8
cmp dword [rsi + 0x24], 0
mov r15, rcx
mov qword [rsp + 0x48], r8
je 0x140044a0e
mov r14d, 2
jmp 0x140044a1a
movsxd rax, dword [rsi + 0x28]
mov r14d, dword [rdx + rax*4 + 0x5f820]
movsxd rcx, dword [rsi + 0x70]
xor r13d, r13d
mov dword [rsp + 0x3c], r13d
lea eax, [rcx - 1]
cmp eax, 1
ja 0x140044a45
mov r8, qword [rdx + rcx*8 + 0x6c2b8]
lea rdx, str.cannot_read_on_a_File_opened_in__s_mode
mov rcx, r15
call sym.luart_static.exe_luaL_error
lea rdx, [rsp + 0x60]
mov qword [rsp + 0x24a0], r12
mov rcx, r15
call sym.luart_static.exe_luaL_buffinit
cmp dword [rsi + 0x24], r13d
je 0x140044d0e
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov rcx, r15
mov qword [rsp + 0x50], rax
call fcn.14002eae0
mov r8d, dword [sym.luart_static.exe_TFile]
mov edx, 0xffffffff
mov rcx, r15
call sym.luart_static.exe_lua_toself
mov edx, 0xfffffffe
mov rcx, r15
mov r14, qword [rax + 8]
call sym.luart_static.exe_lua_settop
cmp word [0x14006c708], r13w
jne 0x140044b9b
test ebx, ebx
je 0x140044b9b
mov rcx, qword [rsi + 8]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
mov edx, 0x20000
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
mov r8, qword [rsi + 8]
lea rcx, [rbp + 0x380]
mov edx, 0x1000
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgetws]
test rax, rax
je 0x140044b82
lea rax, [rbp + 0x380]
mov r8, 0xffffffffffffffff
nop dword [rax]
cmp word [rax + r8*2 + 2], r13w
lea r8, [r8 + 1]
jne 0x140044b00
lea r8, [r8*2 - 2]
lea rdx, [rbp + 0x380]
lea rcx, [rsp + 0x60]
call sym.luart_static.exe_luaL_addlstring
mov rcx, qword [rsi + 8]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
mov edx, ebx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
mov ebx, dword [rsp + 0x30]
lea rcx, [rsp + 0x60]
call sym.luart_static.exe_luaL_pushresult
cmp qword [rsp + 0x70], 0
mov r14, qword [rsp + 0x2490]
mov r13, qword [rsp + 0x2498]
mov r12, qword [rsp + 0x24a0]
mov rdi, qword [rsp + 0x24e8]
jne 0x140044e39
test ebx, ebx
jne 0x140044e39
xor eax, eax
jmp 0x140044e6f
lea rdx, [0x1400590b9]
mov rcx, r15
call sym.luart_static.exe_lua_pushstring
mov rcx, r15
call sym.luart_static.exe_lua_error
jmp 0x140044b39
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
mov edx, 0x20000
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
mov rcx, qword [rsi + 0x18]
lea rdx, [rsp + 0x40]
mov dword [rsp + 0x44], eax
call qword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov edx, dword [rsp + 0x40]
mov ebx, eax
mov rcx, qword [rsi + 0x18]
and edx, 0xfffffff8
call qword [sym.imp.KERNEL32.dll_SetConsoleMode]
test ebx, ebx
mov r12, r13
mov ebx, dword [rsp + 0x30]
sete r12b
mov rcx, qword [rsi + 0x18]
test r12, r12
je 0x140044c0a
lea r9, [rsp + 0x3c]
mov qword [rsp + 0x20], r13
mov r8d, 2
lea rdx, [rsp + 0x34]
call qword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x140044c25
lea r9, [rsp + 0x3c]
mov qword [rsp + 0x20], r13
mov r8d, 1
lea rdx, [rsp + 0x34]
call qword [sym.imp.KERNEL32.dll_ReadConsoleW]
movzx ecx, word [rsp + 0x34]
test ebx, ebx
je 0x140044c38
cmp cx, 0xd
je 0x140044ce5
cmp cx, 3
jne 0x140044c5a
lea rdx, [0x14005fa6c]
mov rcx, r15
call sym.luart_static.exe_lua_pushstring
mov rcx, r15
call sym.luart_static.exe_lua_error
movzx ecx, word [rsp + 0x34]
test r12, r12
jne 0x140044cbe
cmp cx, 8
jne 0x140044c9e
mov rax, qword [rsp + 0x70]
test rax, rax
je 0x140044c9e
sub rax, 2
inc rdi
cmp word [0x14006c708], r13w
mov qword [rsp + 0x70], rax
je 0x140044c95
mov rdx, r14
lea rcx, [0x14005fa70]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
mov rcx, qword [rsi + 0x18]
jmp 0x140044c0a
movzx eax, word [0x14006c708]
test ax, ax
je 0x140044caf
movzx ecx, ax
jmp 0x140044cb5
cmp cx, 0x1f
jbe 0x140044cbe
mov rdx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputwc]
mov r8d, 2
lea rdx, [rsp + 0x34]
lea rcx, [rsp + 0x60]
call sym.luart_static.exe_luaL_addlstring
test ebx, ebx
jne 0x140044be4
sub rdi, 1
jne 0x140044be4
mov edx, dword [rsp + 0x40]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov edx, dword [rsp + 0x44]
mov ecx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
jmp 0x140044b3d
mov r9, qword [rsi + 8]
test r9, r9
je 0x140044e25
movsxd r12, r14d
lea rcx, [rsp + 0x38]
mov rdx, r12
mov r8d, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
test rax, rax
je 0x140044e34
nop dword [rax + rax]
mov r8d, dword [rsi + 0x28]
mov eax, dword [rsp + 0x38]
cmp r8d, 1
jne 0x140044d9b
movzx ecx, al
mov edx, 0xe5000000
shr ecx, 3
and ecx, 0x1e
shr edx, cl
and edx, 3
inc edx
mov ebx, edx
cmp rbx, 1
jbe 0x140044d97
mov r9, qword [rsi + 8]
lea rcx, [rsp + 0x39]
dec rdx
mov r8d, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov r8d, ebx
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x60]
call sym.luart_static.exe_luaL_addlstring
jmp 0x140044dfb
mov ebx, dword [rsp + 0x30]
cmp r14d, 2
jne 0x140044dad
cmp ax, 0xa
je 0x140044db7
movzx r13d, ax
jmp 0x140044ddf
cmp r14d, 1
jne 0x140044ddb
cmp al, 0xa
jne 0x140044ddb
test r8d, r8d
je 0x140044dc7
cmp r13d, 0xd
jne 0x140044dc7
sub qword [rsp + 0x70], r12
test ebx, ebx
jne 0x140044b39
cmp r14d, 2
jne 0x140044ddb
movzx r13d, ax
jmp 0x140044ddf
movsx r13d, al
mov r8, r12
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x60]
call sym.luart_static.exe_luaL_addlstring
sub rdi, 1
je 0x140044b39
mov r9, qword [rsi + 8]
lea rcx, [rsp + 0x38]
mov r8d, 1
mov rdx, r12
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov ebx, dword [rsp + 0x30]
test rax, rax
jne 0x140044d40
jmp 0x140044b3d
lea rdx, str.could_not_read__File_is_not_open
mov rcx, r15
call sym.luart_static.exe_luaL_error
jmp 0x140044b3d
cmp dword [rsi + 0x28], 2
je 0x140044e45
cmp dword [rsi + 0x24], 0
je 0x140044e6a
lea r8, [rsp + 0x48]
mov edx, 0xffffffff
mov rcx, r15
call sym.luart_static.exe_lua_tolstring
mov r8, qword [rsp + 0x48]
mov rdx, rax
shr r8, 1
mov rcx, r15
call sym.luart_static.exe_lua_pushlwstring
mov eax, 1
mov rcx, qword [rbp + 0x2380]
xor rcx, rsp
call fcn.140056920
add rsp, 0x24a8
pop r15
pop rsi
pop rbx
pop rbp
ret