Function at 0x4321e8
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2234
call fcn.00449ba0
mov eax, dword [0x459c80]
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 0x432225
push 2
pop ebx
jmp 0x43222f
mov eax, dword [ebp]
mov ebx, dword [eax*4 + 0x450fac]
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 0x432262
push dword [ecx*4 + 0x459170]
push str.cannot_read_on_a_File_opened_in__s_mode
push edi
call sym.wluart.exe_luaL_error
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push edi
call sym.wluart.exe_luaL_buffinit
xor eax, eax
pop ecx
pop ecx
cmp dword [esi + 0x14], eax
je 0x4324c4
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push edi
mov dword [esp + 0x30], eax
call fcn.00421999
push dword [sym.wluart.exe_TFile]
push 0xffffffffffffffff
push edi
call sym.wluart.exe_lua_toself
push 0xfffffffffffffffe
push edi
mov ebx, dword [eax + 4]
call sym.wluart.exe_lua_settop
add esp, 0x18
cmp word [0x459f80], 0
jne 0x432362
cmp dword [esp + 0x2254], 0
je 0x432362
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 0x432349
lea ecx, [esp + 0x240]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [esp + 0x1c]
jne 0x432309
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 + 0x18]
push dword [esi + 4]
call ebx
pop ecx
push eax
call ebp
jmp 0x4325c6
push 0x44bba9
push edi
call sym.wluart.exe_lua_pushstring
push edi
call sym.wluart.exe_lua_error
add esp, 0xc
jmp 0x4325c8
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 0x4323c5
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 0x4323db
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 0x4323f5
push 0xd
pop ecx
cmp ax, cx
je 0x43249e
push 3
pop ecx
cmp ax, cx
jne 0x432415
push 0x4511c8
push edi
call sym.wluart.exe_lua_pushstring
push edi
call sym.wluart.exe_lua_error
mov eax, dword [esp + 0x1c]
add esp, 0xc
cmp dword [esp + 0x18], 0
je 0x432473
cmp ax, 8
jne 0x432452
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x432452
sub ecx, 2
inc ebp
cmp word [0x459f80], 0
mov dword [esp + 0x38], ecx
je 0x43244a
push ebx
push 0x4511cc
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
pop ecx
pop ecx
mov eax, dword [esi + 0xc]
jmp 0x4323c5
mov cx, word [0x459f80]
test cx, cx
je 0x432463
movzx eax, cx
jmp 0x432469
cmp ax, 0x1f
jbe 0x432473
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.wluart.exe_luaL_addlstring
add esp, 0xc
cmp dword [esp + 0x2254], 0
jne 0x4323a3
sub ebp, 1
jne 0x4323a3
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 0x4325c6
cmp dword [esi + 4], eax
je 0x4325bb
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 0x4325c8
push 0xd
pop ecx
cmp dword [ebp], 1
mov eax, dword [esp + 0x14]
jne 0x432541
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 0x43253e
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.wluart.exe_luaL_addlstring
add esp, 0x1c
jmp 0x43259a
push 0xd
pop ecx
cmp ebx, 2
jne 0x43254c
cmp ax, 0xa
je 0x432555
cmp ebx, 1
jne 0x43256f
cmp al, 0xa
jne 0x432579
cmp dword [ebp], 0
je 0x432565
cmp dword [esp + 0x10], ecx
jne 0x432565
sub dword [esp + 0x38], ebx
cmp dword [esp + 0x2254], 0
jne 0x4325c8
cmp ebx, 2
jne 0x432579
movzx eax, ax
jmp 0x43257c
movsx eax, al
mov dword [esp + 0x10], eax
lea eax, [esp + 0x14]
push ebx
push eax
lea eax, [esp + 0x38]
push eax
call sym.wluart.exe_luaL_addlstring
add esp, 0xc
sub dword [esp + 0x20], 1
je 0x4325c8
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 0x4324ec
jmp 0x4325c8
push str.could_not_read__File_is_not_open
push edi
call sym.wluart.exe_luaL_error
pop ecx
pop ecx
lea eax, [esp + 0x30]
push eax
call sym.wluart.exe_luaL_pushresult
cmp dword [esp + 0x3c], 0
pop ecx
jne 0x4325e8
cmp dword [esp + 0x2254], 0
jne 0x4325e8
xor eax, eax
jmp 0x43261c
cmp dword [esi + 0x18], 2
je 0x4325f5
xor eax, eax
cmp dword [esi + 0x14], eax
je 0x432619
lea eax, [esp + 0x2250]
push eax
push 0xffffffffffffffff
push edi
call sym.wluart.exe_lua_tolstring
mov ecx, dword [esp + 0x225c]
shr ecx, 1
push ecx
push eax
push edi
call sym.wluart.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.00449662
add esp, 0x2234
ret