Function at 0x431abb
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2234
call fcn.0043d400
mov eax, dword [0x44b240]
xor eax, esp
mov dword [esp + 0x2230], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x2248]
xor ecx, ecx
push edi
mov edi, dword [esp + 0x2248]
mov dword [esp + 0x1c], ecx
lea ebp, [esi + 0x18]
cmp dword [esi + 0x14], ecx
je 0x431af8
push 2
pop ebx
jmp 0x431b02
mov eax, dword [ebp]
mov ebx, dword [eax*4 + 0x444bc4]
mov eax, dword [esp + 0x2250]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x10], ecx
mov ecx, dword [esi + 0x54]
mov dword [esp + 0x20], eax
lea eax, [ecx - 1]
cmp eax, 1
ja 0x431b35
push dword [ecx*4 + 0x44b160]
push str.cannot_read_on_a_File_opened_in__s_mode
push edi
call sym.luart.exe_luaL_error
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push edi
call sym.luart.exe_luaL_buffinit
xor eax, eax
pop ecx
pop ecx
cmp dword [esi + 0x14], eax
je 0x431d97
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push edi
mov dword [esp + 0x30], eax
call fcn.0042126a
push dword [sym.luart.exe_TFile]
push 0xffffffffffffffff
push edi
call sym.luart.exe_lua_toself
push 0xfffffffffffffffe
push edi
mov ebx, dword [eax + 4]
call sym.luart.exe_lua_settop
add esp, 0x18
cmp word [0x44b330], 0
jne 0x431c35
cmp dword [esp + 0x2254], 0
je 0x431c35
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
push 0x20000
push dword [esi + 4]
call ebx
mov ebp, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
pop ecx
push eax
call ebp
push dword [esi + 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 0x431c1c
lea ecx, [esp + 0x240]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [esp + 0x1c]
jne 0x431bdc
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.luart.exe_luaL_addlstring
add esp, 0xc
push dword [esp + 0x18]
push dword [esi + 4]
call ebx
pop ecx
push eax
call ebp
jmp 0x431e99
push 0x43f7a9
push edi
call sym.luart.exe_lua_pushstring
push edi
call sym.luart.exe_lua_error
add esp, 0xc
jmp 0x431e9b
push 0x20000
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
pop ecx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
pop ecx
pop ecx
mov dword [esp + 0x24], eax
lea eax, [esp + 0x1c]
push eax
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1c]
and eax, 0xfffffff8
push eax
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov ebp, dword [esp + 0x20]
cmp dword [esp + 0x18], 0
mov eax, dword [esi + 0xc]
jne 0x431c98
xor ecx, ecx
push ecx
lea ecx, [esp + 0x2c]
push ecx
push 2
lea ecx, [esp + 0x1c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x431cae
xor ecx, ecx
push ecx
lea ecx, [esp + 0x2c]
push ecx
push 1
lea ecx, [esp + 0x1c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
cmp dword [esp + 0x2254], 0
mov eax, dword [esp + 0x10]
je 0x431cc8
push 0xd
pop ecx
cmp ax, cx
je 0x431d71
push 3
pop ecx
cmp ax, cx
jne 0x431ce8
push 0x444de0
push edi
call sym.luart.exe_lua_pushstring
push edi
call sym.luart.exe_lua_error
mov eax, dword [esp + 0x1c]
add esp, 0xc
cmp dword [esp + 0x18], 0
je 0x431d46
cmp ax, 8
jne 0x431d25
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x431d25
sub ecx, 2
inc ebp
cmp word [0x44b330], 0
mov dword [esp + 0x38], ecx
je 0x431d1d
push ebx
push 0x444de4
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
pop ecx
pop ecx
mov eax, dword [esi + 0xc]
jmp 0x431c98
mov cx, word [0x44b330]
test cx, cx
je 0x431d36
movzx eax, cx
jmp 0x431d3c
cmp ax, 0x1f
jbe 0x431d46
push ebx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputwc]
pop ecx
pop ecx
push 2
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x38]
push eax
call sym.luart.exe_luaL_addlstring
add esp, 0xc
cmp dword [esp + 0x2254], 0
jne 0x431c76
sub ebp, 1
jne 0x431c76
push dword [esp + 0x1c]
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push dword [esp + 0x24]
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
pop ecx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
jmp 0x431e99
cmp dword [esi + 4], eax
je 0x431e8e
push dword [esi + 4]
lea eax, [esp + 0x18]
push 1
push ebx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
test eax, eax
je 0x431e9b
push 0xd
pop ecx
cmp dword [ebp], 1
mov eax, dword [esp + 0x14]
jne 0x431e14
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 0x431e11
push dword [esi + 4]
lea eax, [esp + 0x19]
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 + 0x28]
push eax
lea eax, [esp + 0x48]
push eax
call sym.luart.exe_luaL_addlstring
add esp, 0x1c
jmp 0x431e6d
push 0xd
pop ecx
cmp ebx, 2
jne 0x431e1f
cmp ax, 0xa
je 0x431e28
cmp ebx, 1
jne 0x431e42
cmp al, 0xa
jne 0x431e4c
cmp dword [ebp], 0
je 0x431e38
cmp dword [esp + 0x10], ecx
jne 0x431e38
sub dword [esp + 0x38], ebx
cmp dword [esp + 0x2254], 0
jne 0x431e9b
cmp ebx, 2
jne 0x431e4c
movzx eax, ax
jmp 0x431e4f
movsx eax, al
mov dword [esp + 0x10], eax
lea eax, [esp + 0x14]
push ebx
push eax
lea eax, [esp + 0x38]
push eax
call sym.luart.exe_luaL_addlstring
add esp, 0xc
sub dword [esp + 0x20], 1
je 0x431e9b
push dword [esi + 4]
lea eax, [esp + 0x18]
push 1
push ebx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
push 0xd
pop ecx
test eax, eax
jne 0x431dbf
jmp 0x431e9b
push str.could_not_read__File_is_not_open
push edi
call sym.luart.exe_luaL_error
pop ecx
pop ecx
lea eax, [esp + 0x30]
push eax
call sym.luart.exe_luaL_pushresult
cmp dword [esp + 0x3c], 0
pop ecx
jne 0x431ebb
cmp dword [esp + 0x2254], 0
jne 0x431ebb
xor eax, eax
jmp 0x431eef
cmp dword [esi + 0x18], 2
je 0x431ec8
xor eax, eax
cmp dword [esi + 0x14], eax
je 0x431eec
lea eax, [esp + 0x2250]
push eax
push 0xffffffffffffffff
push edi
call sym.luart.exe_lua_tolstring
mov ecx, dword [esp + 0x225c]
shr ecx, 1
push ecx
push eax
push edi
call sym.luart.exe_lua_pushlwstring
add esp, 0x18
xor eax, eax
inc eax
mov ecx, dword [esp + 0x2240]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0043cf52
add esp, 0x2234
ret