Function at 0x43def0
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2234
call fcn.0045fc10
mov eax, dword [0x470d00]
xor eax, esp
mov dword [esp + 0x2230], eax
mov ecx, dword [esp + 0x223c]
push ebx
mov ebx, dword [esp + 0x223c]
push ebp
cmp dword [ecx + 0x14], 0
lea edx, [ecx + 0x18]
push esi
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x1c], edx
je 0x43df35
mov esi, 2
jmp 0x43df42
mov eax, dword [edx]
mov dword [esp + 0x1c], edx
mov esi, dword [eax*4 + 0x46705c]
mov ecx, dword [ecx + 0x54]
xor ebp, ebp
push edi
mov edi, dword [esp + 0x2250]
mov dword [esp + 0x28], 0
lea eax, [ecx - 1]
cmp eax, 1
ja 0x43df74
push dword [ecx*4 + 0x470170]
push str.cannot_read_on_a_File_opened_in__s_mode
push ebx
call sym.wluart.exe_luaL_error
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push ebx
call sym.wluart.exe_luaL_buffinit
mov eax, dword [esp + 0x18]
add esp, 8
cmp dword [eax + 0x14], ebp
je 0x43e1f2
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push ebx
mov dword [esp + 0x30], eax
call fcn.0042a580
push dword [sym.wluart.exe_TFile]
push 0xffffffffffffffff
push ebx
call sym.wluart.exe_lua_toself
push 0xfffffffffffffffe
push ebx
mov esi, dword [eax + 4]
call sym.wluart.exe_lua_settop
add esp, 0x18
cmp word [0x470fc0], bp
jne 0x43e07e
cmp dword [esp + 0x2254], ebp
je 0x43e07e
mov ebp, dword [esp + 0x10]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
push 0x20000
push dword [ebp + 4]
call esi
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
add esp, 4
push eax
call edi
push dword [ebp + 4]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x24c]
push 0x1000
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgetws]
add esp, 0x14
test eax, eax
je 0x43e065
lea ecx, [esp + 0x240]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x43e022
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 - 2]
push eax
lea eax, [esp + 0x244]
push eax
lea eax, [esp + 0x38]
push eax
call sym.wluart.exe_luaL_addlstring
add esp, 0xc
push dword [esp + 0x1c]
push dword [ebp + 4]
call esi
add esp, 4
push eax
call edi
add esp, 8
jmp 0x43e2f8
push 0x461bd9
push ebx
call sym.wluart.exe_lua_pushstring
push ebx
call sym.wluart.exe_lua_error
add esp, 0xc
jmp 0x43e2f8
push 0x20000
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
mov ebp, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x24], eax
lea eax, [esp + 0x1c]
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov ecx, dword [esp + 0x1c]
neg eax
sbb eax, eax
and ecx, 0xfffffff8
push ecx
push dword [ebp + 0xc]
inc eax
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
nop word [eax + eax]
cmp dword [esp + 0x10], 0
mov eax, dword [ebp + 0xc]
je 0x43e0f1
push 0
lea ecx, [esp + 0x2c]
push ecx
push 2
lea ecx, [esp + 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x43e106
push 0
lea ecx, [esp + 0x2c]
push ecx
push 1
lea ecx, [esp + 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
cmp dword [esp + 0x2254], 0
mov eax, dword [esp + 0x14]
je 0x43e11e
cmp ax, 0xd
je 0x43e1c7
cmp ax, 3
jne 0x43e13c
push 0x467278
push ebx
call sym.wluart.exe_lua_pushstring
push ebx
call sym.wluart.exe_lua_error
mov eax, dword [esp + 0x20]
add esp, 0xc
cmp dword [esp + 0x10], 0
jne 0x43e19c
cmp ax, 8
jne 0x43e17a
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x43e17a
sub ecx, 2
inc edi
cmp word [0x470fc0], 0
mov dword [esp + 0x38], ecx
je 0x43e172
push esi
push 0x46727c
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
add esp, 8
mov eax, dword [ebp + 0xc]
jmp 0x43e0f1
mov cx, word [0x470fc0]
test cx, cx
je 0x43e18b
movzx eax, cx
jmp 0x43e191
cmp ax, 0x1f
jbe 0x43e19c
push esi
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputwc]
add esp, 8
push 2
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x38]
push eax
call sym.wluart.exe_luaL_addlstring
add esp, 0xc
cmp dword [esp + 0x2254], 0
jne 0x43e0d0
sub edi, 1
jne 0x43e0d0
push dword [esp + 0x1c]
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push dword [esp + 0x24]
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
add esp, 4
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
add esp, 8
jmp 0x43e2f8
mov eax, dword [eax + 4]
test eax, eax
je 0x43e331
push eax
push 1
lea eax, [esp + 0x20]
push esi
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
test eax, eax
je 0x43e2f4
nop word [eax + eax]
mov eax, dword [esp + 0x20]
mov ebx, dword [eax]
mov eax, dword [esp + 0x18]
cmp ebx, 1
jne 0x43e27b
movzx ecx, al
mov edx, 0xe5000000
shr ecx, 3
and ecx, 0x1e
shr edx, cl
and edx, 3
lea ecx, [edx + 1]
mov dword [esp + 0x24], ecx
cmp ecx, 1
jbe 0x43e27b
mov eax, dword [esp + 0x10]
push dword [eax + 4]
lea eax, [esp + 0x1d]
push 1
push edx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
push dword [esp + 0x34]
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x48]
push eax
call sym.wluart.exe_luaL_addlstring
add esp, 0x1c
jmp 0x43e2d0
cmp esi, 2
jne 0x43e28b
cmp ax, 0xa
je 0x43e294
movzx ebp, ax
jmp 0x43e2b8
cmp esi, 1
jne 0x43e2b5
cmp al, 0xa
jne 0x43e2b5
test ebx, ebx
je 0x43e2a1
cmp ebp, 0xd
jne 0x43e2a1
sub dword [esp + 0x38], esi
cmp dword [esp + 0x2254], 0
jne 0x43e2f0
cmp esi, 2
jne 0x43e2b5
movzx ebp, ax
jmp 0x43e2b8
movsx ebp, al
push esi
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x38]
push eax
call sym.wluart.exe_luaL_addlstring
add esp, 0xc
sub edi, 1
je 0x43e2f0
mov eax, dword [esp + 0x10]
push dword [eax + 4]
lea eax, [esp + 0x1c]
push 1
push esi
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
test eax, eax
jne 0x43e220
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x10]
lea eax, [esp + 0x30]
push eax
call sym.wluart.exe_luaL_pushresult
add esp, 4
cmp dword [esp + 0x38], 0
pop edi
jne 0x43e341
cmp dword [esp + 0x2250], 0
jne 0x43e341
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x2230]
xor ecx, esp
call fcn.0045f6d1
add esp, 0x2234
ret
push str.could_not_read__File_is_not_open
push ebx
call sym.wluart.exe_luaL_error
add esp, 8
jmp 0x43e2f4
mov eax, dword [esp + 0x1c]
cmp dword [eax], 2
je 0x43e350
cmp dword [ebp + 0x14], 0
je 0x43e374
lea eax, [esp + 0x224c]
push eax
push 0xffffffffffffffff
push ebx
call sym.wluart.exe_lua_tolstring
mov ecx, dword [esp + 0x2258]
shr ecx, 1
push ecx
push eax
push ebx
call sym.wluart.exe_lua_pushlwstring
add esp, 0x18
mov ecx, dword [esp + 0x223c]
mov eax, 1
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0045f6d1
add esp, 0x2234
ret