Function at 0x43db80
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2234
call fcn.0045f980
mov eax, dword [0x470d10]
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 0x43dbc5
mov esi, 2
jmp 0x43dbd2
mov eax, dword [edx]
mov dword [esp + 0x1c], edx
mov esi, dword [eax*4 + 0x46703c]
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 0x43dc04
push dword [ecx*4 + 0x470180]
push str.cannot_read_on_a_File_opened_in__s_mode
push ebx
call sym.wluart_static.exe_luaL_error
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push ebx
call sym.wluart_static.exe_luaL_buffinit
mov eax, dword [esp + 0x18]
add esp, 8
cmp dword [eax + 0x14], ebp
je 0x43de82
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push ebx
mov dword [esp + 0x30], eax
call fcn.0042a220
push dword [sym.wluart_static.exe_TFile]
push 0xffffffffffffffff
push ebx
call sym.wluart_static.exe_lua_toself
push 0xfffffffffffffffe
push ebx
mov esi, dword [eax + 4]
call sym.wluart_static.exe_lua_settop
add esp, 0x18
cmp word [0x470fe0], bp
jne 0x43dd0e
cmp dword [esp + 0x2254], ebp
je 0x43dd0e
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 0x43dcf5
lea ecx, [esp + 0x240]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x43dcb2
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_static.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 0x43df88
push 0x461bb9
push ebx
call sym.wluart_static.exe_lua_pushstring
push ebx
call sym.wluart_static.exe_lua_error
add esp, 0xc
jmp 0x43df88
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 0x43dd81
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 0x43dd96
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 0x43ddae
cmp ax, 0xd
je 0x43de57
cmp ax, 3
jne 0x43ddcc
push 0x467258
push ebx
call sym.wluart_static.exe_lua_pushstring
push ebx
call sym.wluart_static.exe_lua_error
mov eax, dword [esp + 0x20]
add esp, 0xc
cmp dword [esp + 0x10], 0
jne 0x43de2c
cmp ax, 8
jne 0x43de0a
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x43de0a
sub ecx, 2
inc edi
cmp word [0x470fe0], 0
mov dword [esp + 0x38], ecx
je 0x43de02
push esi
push 0x46725c
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
add esp, 8
mov eax, dword [ebp + 0xc]
jmp 0x43dd81
mov cx, word [0x470fe0]
test cx, cx
je 0x43de1b
movzx eax, cx
jmp 0x43de21
cmp ax, 0x1f
jbe 0x43de2c
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_static.exe_luaL_addlstring
add esp, 0xc
cmp dword [esp + 0x2254], 0
jne 0x43dd60
sub edi, 1
jne 0x43dd60
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 0x43df88
mov eax, dword [eax + 4]
test eax, eax
je 0x43dfc1
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 0x43df84
nop word [eax + eax]
mov eax, dword [esp + 0x20]
mov ebx, dword [eax]
mov eax, dword [esp + 0x18]
cmp ebx, 1
jne 0x43df0b
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 0x43df0b
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_static.exe_luaL_addlstring
add esp, 0x1c
jmp 0x43df60
cmp esi, 2
jne 0x43df1b
cmp ax, 0xa
je 0x43df24
movzx ebp, ax
jmp 0x43df48
cmp esi, 1
jne 0x43df45
cmp al, 0xa
jne 0x43df45
test ebx, ebx
je 0x43df31
cmp ebp, 0xd
jne 0x43df31
sub dword [esp + 0x38], esi
cmp dword [esp + 0x2254], 0
jne 0x43df80
cmp esi, 2
jne 0x43df45
movzx ebp, ax
jmp 0x43df48
movsx ebp, al
push esi
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x38]
push eax
call sym.wluart_static.exe_luaL_addlstring
add esp, 0xc
sub edi, 1
je 0x43df80
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 0x43deb0
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x10]
lea eax, [esp + 0x30]
push eax
call sym.wluart_static.exe_luaL_pushresult
add esp, 4
cmp dword [esp + 0x38], 0
pop edi
jne 0x43dfd1
cmp dword [esp + 0x2250], 0
jne 0x43dfd1
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x2230]
xor ecx, esp
call fcn.0045f441
add esp, 0x2234
ret
push str.could_not_read__File_is_not_open
push ebx
call sym.wluart_static.exe_luaL_error
add esp, 8
jmp 0x43df84
mov eax, dword [esp + 0x1c]
cmp dword [eax], 2
je 0x43dfe0
cmp dword [ebp + 0x14], 0
je 0x43e004
lea eax, [esp + 0x224c]
push eax
push 0xffffffffffffffff
push ebx
call sym.wluart_static.exe_lua_tolstring
mov ecx, dword [esp + 0x2258]
shr ecx, 1
push ecx
push eax
push ebx
call sym.wluart_static.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.0045f441
add esp, 0x2234
ret