Function at 0x43fa70
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2234
call fcn.00463670
mov eax, dword [0x475d80]
xor eax, esp
mov dword [esp + 0x2230], eax
mov ecx, dword [esp + 0x223c]
push ebx
push ebp
push esi
cmp dword [ecx + 0x14], 0
lea edx, [ecx + 0x18]
push edi
mov edi, dword [esp + 0x2248]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], edx
je 0x43fab6
mov esi, 2
jmp 0x43fac3
mov eax, dword [edx]
mov dword [esp + 0x18], edx
mov esi, dword [eax*4 + 0x46b07c]
mov ecx, dword [ecx + 0x54]
xor ebx, ebx
mov ebp, dword [esp + 0x2250]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x24], 0
lea eax, [ecx - 1]
cmp eax, 1
ja 0x43faf8
push dword [ecx*4 + 0x47518c]
push str.cannot_read_on_a_File_opened_in__s_mode
push edi
call sym.wluart_static.exe_luaL_error
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push edi
call sym.wluart_static.exe_luaL_buffinit
mov eax, dword [esp + 0x18]
add esp, 8
cmp dword [eax + 0x14], ebx
je 0x43fd68
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push edi
mov dword [esp + 0x2c], eax
call fcn.0042cf10
push dword [sym.wluart_static.exe_TFile]
push 0xffffffffffffffff
push edi
call sym.wluart_static.exe_lua_toself
push 0xfffffffffffffffe
push edi
mov esi, dword [eax + 4]
call sym.wluart_static.exe_lua_settop
add esp, 0x18
cmp word [0x476160], bx
jne 0x43fc02
cmp dword [esp + 0x2254], ebx
je 0x43fc02
mov ebx, dword [esp + 0x10]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
push 0x20000
push dword [ebx + 4]
call esi
mov ebp, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
add esp, 4
push eax
call ebp
push dword [ebx + 4]
mov dword [esp + 0x24], 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 0x43fbe9
lea ecx, [esp + 0x240]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x43fba6
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 + 0x18]
push dword [ebx + 4]
call esi
add esp, 4
push eax
call ebp
add esp, 8
jmp 0x43fe6d
push 0x465c19
push edi
call sym.wluart_static.exe_lua_pushstring
push edi
call sym.wluart_static.exe_lua_error
add esp, 0xc
jmp 0x43fe6d
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 ebx, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x18]
push eax
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov ecx, dword [esp + 0x18]
and ecx, 0xfffffff8
mov dword [esp + 0x1c], eax
push ecx
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
cmp dword [esp + 0x1c], 0
mov eax, dword [ebx + 0xc]
jne 0x43fc67
push 0
lea ecx, [esp + 0x28]
push ecx
push 2
lea ecx, [esp + 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x43fc7c
push 0
lea ecx, [esp + 0x28]
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 0x43fc94
cmp ax, 0xd
je 0x43fd3d
cmp ax, 3
jne 0x43fcb2
push 0x46b3ac
push edi
call sym.wluart_static.exe_lua_pushstring
push edi
call sym.wluart_static.exe_lua_error
mov eax, dword [esp + 0x20]
add esp, 0xc
cmp dword [esp + 0x1c], 0
je 0x43fd12
cmp ax, 8
jne 0x43fcf0
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x43fcf0
sub ecx, 2
inc ebp
cmp word [0x476160], 0
mov dword [esp + 0x38], ecx
je 0x43fce8
push esi
push 0x46b3b0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
add esp, 8
mov eax, dword [ebx + 0xc]
jmp 0x43fc67
mov cx, word [0x476160]
test cx, cx
je 0x43fd01
movzx eax, cx
jmp 0x43fd07
cmp ax, 0x1f
jbe 0x43fd12
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 0x43fc46
sub ebp, 1
jne 0x43fc46
push dword [esp + 0x18]
push dword [esp + 0x2c]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push dword [esp + 0x2c]
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 0x43fe6d
mov eax, dword [eax + 4]
test eax, eax
je 0x43fe8f
push eax
push 1
lea eax, [esp + 0x28]
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 0x43fe69
nop dword [eax]
mov eax, dword [esp + 0x18]
mov edi, dword [eax]
mov eax, dword [esp + 0x20]
cmp edi, 1
jne 0x43fdec
movzx ecx, al
mov edx, 0xe5000000
shr ecx, 3
and ecx, 0x1e
shr edx, cl
and edx, 3
lea ebp, [edx + 1]
cmp ebp, 1
jbe 0x43fde8
mov eax, dword [esp + 0x10]
push dword [eax + 4]
lea eax, [esp + 0x25]
push 1
push edx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
push ebp
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x48]
push eax
call sym.wluart_static.exe_luaL_addlstring
mov ebp, dword [esp + 0x30]
add esp, 0x1c
jmp 0x43fe45
mov ebp, dword [esp + 0x14]
cmp esi, 2
jne 0x43fdfc
cmp ax, 0xa
je 0x43fe05
movzx ebx, ax
jmp 0x43fe29
cmp esi, 1
jne 0x43fe26
cmp al, 0xa
jne 0x43fe26
test edi, edi
je 0x43fe12
cmp ebx, 0xd
jne 0x43fe12
sub dword [esp + 0x38], esi
cmp dword [esp + 0x2254], 0
jne 0x43fe65
cmp esi, 2
jne 0x43fe26
movzx ebx, ax
jmp 0x43fe29
movsx ebx, al
push esi
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x38]
push eax
call sym.wluart_static.exe_luaL_addlstring
add esp, 0xc
sub ebp, 1
mov dword [esp + 0x14], ebp
je 0x43fe65
mov eax, dword [esp + 0x10]
push dword [eax + 4]
lea eax, [esp + 0x24]
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 0x43fd90
mov edi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x10]
lea eax, [esp + 0x30]
push eax
call sym.wluart_static.exe_luaL_pushresult
add esp, 4
cmp dword [esp + 0x38], 0
jne 0x43fe9f
cmp dword [esp + 0x2254], 0
jne 0x43fe9f
xor eax, eax
jmp 0x43fed4
push str.could_not_read__File_is_not_open
push edi
call sym.wluart_static.exe_luaL_error
add esp, 8
jmp 0x43fe69
cmp dword [ebx + 0x18], 2
je 0x43feab
cmp dword [ebx + 0x14], 0
je 0x43fecf
lea eax, [esp + 0x2250]
push eax
push 0xffffffffffffffff
push edi
call sym.wluart_static.exe_lua_tolstring
mov ecx, dword [esp + 0x225c]
shr ecx, 1
push ecx
push eax
push edi
call sym.wluart_static.exe_lua_pushlwstring
add esp, 0x18
mov eax, 1
mov ecx, dword [esp + 0x2240]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00463052
add esp, 0x2234
ret