Function at 0x43d640
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2234
call fcn.0044c680
mov eax, dword [0x45a210]
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 0x43d685
mov esi, 2
jmp 0x43d692
mov eax, dword [edx]
mov dword [esp + 0x1c], edx
mov esi, dword [eax*4 + 0x453b9c]
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 0x43d6c4
push dword [ecx*4 + 0x45a160]
push str.cannot_read_on_a_File_opened_in__s_mode
push ebx
call sym.luart.exe_luaL_error
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push ebx
call sym.luart.exe_luaL_buffinit
mov eax, dword [esp + 0x18]
add esp, 8
cmp dword [eax + 0x14], ebp
je 0x43d942
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push ebx
mov dword [esp + 0x30], eax
call fcn.00429d10
push dword [sym.luart.exe_TFile]
push 0xffffffffffffffff
push ebx
call sym.luart.exe_lua_toself
push 0xfffffffffffffffe
push ebx
mov esi, dword [eax + 4]
call sym.luart.exe_lua_settop
add esp, 0x18
cmp word [0x45a2d0], bp
jne 0x43d7ce
cmp dword [esp + 0x2254], ebp
je 0x43d7ce
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 0x43d7b5
lea ecx, [esp + 0x240]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x43d772
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 + 0x1c]
push dword [ebp + 4]
call esi
add esp, 4
push eax
call edi
add esp, 8
jmp 0x43da48
push 0x44e7b8
push ebx
call sym.luart.exe_lua_pushstring
push ebx
call sym.luart.exe_lua_error
add esp, 0xc
jmp 0x43da48
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 0x43d841
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 0x43d856
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 0x43d86e
cmp ax, 0xd
je 0x43d917
cmp ax, 3
jne 0x43d88c
push 0x453db8
push ebx
call sym.luart.exe_lua_pushstring
push ebx
call sym.luart.exe_lua_error
mov eax, dword [esp + 0x20]
add esp, 0xc
cmp dword [esp + 0x10], 0
jne 0x43d8ec
cmp ax, 8
jne 0x43d8ca
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x43d8ca
sub ecx, 2
inc edi
cmp word [0x45a2d0], 0
mov dword [esp + 0x38], ecx
je 0x43d8c2
push esi
push 0x453dbc
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
add esp, 8
mov eax, dword [ebp + 0xc]
jmp 0x43d841
mov cx, word [0x45a2d0]
test cx, cx
je 0x43d8db
movzx eax, cx
jmp 0x43d8e1
cmp ax, 0x1f
jbe 0x43d8ec
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.luart.exe_luaL_addlstring
add esp, 0xc
cmp dword [esp + 0x2254], 0
jne 0x43d820
sub edi, 1
jne 0x43d820
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 0x43da48
mov eax, dword [eax + 4]
test eax, eax
je 0x43da81
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 0x43da44
nop word [eax + eax]
mov eax, dword [esp + 0x20]
mov ebx, dword [eax]
mov eax, dword [esp + 0x18]
cmp ebx, 1
jne 0x43d9cb
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 0x43d9cb
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.luart.exe_luaL_addlstring
add esp, 0x1c
jmp 0x43da20
cmp esi, 2
jne 0x43d9db
cmp ax, 0xa
je 0x43d9e4
movzx ebp, ax
jmp 0x43da08
cmp esi, 1
jne 0x43da05
cmp al, 0xa
jne 0x43da05
test ebx, ebx
je 0x43d9f1
cmp ebp, 0xd
jne 0x43d9f1
sub dword [esp + 0x38], esi
cmp dword [esp + 0x2254], 0
jne 0x43da40
cmp esi, 2
jne 0x43da05
movzx ebp, ax
jmp 0x43da08
movsx ebp, al
push esi
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x38]
push eax
call sym.luart.exe_luaL_addlstring
add esp, 0xc
sub edi, 1
je 0x43da40
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 0x43d970
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x10]
lea eax, [esp + 0x30]
push eax
call sym.luart.exe_luaL_pushresult
add esp, 4
cmp dword [esp + 0x38], 0
pop edi
jne 0x43da91
cmp dword [esp + 0x2250], 0
jne 0x43da91
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x2230]
xor ecx, esp
call fcn.0044c1d1
add esp, 0x2234
ret
push str.could_not_read__File_is_not_open
push ebx
call sym.luart.exe_luaL_error
add esp, 8
jmp 0x43da44
mov eax, dword [esp + 0x1c]
cmp dword [eax], 2
je 0x43daa0
cmp dword [ebp + 0x14], 0
je 0x43dac4
lea eax, [esp + 0x224c]
push eax
push 0xffffffffffffffff
push ebx
call sym.luart.exe_lua_tolstring
mov ecx, dword [esp + 0x2258]
shr ecx, 1
push ecx
push eax
push ebx
call sym.luart.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.0044c1d1
add esp, 0x2234
ret