Function at 0x41c550
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x1024
call fcn.004622b0
push ebx
push esi
push edi
mov esi, ecx
mov edi, edx
push esi
mov dword [esp + 0x14], edi
call dword [sym.imp.lua51.dll_lua_gettop]
add esp, 4
lea ebx, [eax + 1]
test edi, edi
jne 0x41c60a
push 6
push str.stdin
push esi
call dword [sym.imp.lua51.dll_lua_pushlstring]
push edi
push 0xffffffffffffffff
push esi
call dword [sym.imp.lua51.dll_lua_tolstring]
push edi
call fcn.004662bb
add esp, 0x1c
mov dword [esp + 0x2c], eax
lea edx, [esp + 0xc]
lea ecx, [esp + 0x28]
call fcn.0041c4c0
test eax, eax
je 0x41c5c3
mov eax, dword [esp + 0x28]
mov byte [esp + eax + 0x30], 0xa
inc dword [esp + 0x28]
mov ecx, dword [esp + 0xc]
cmp ecx, 0x1b
jne 0x41c65b
test edi, edi
je 0x41c65b
push dword [esp + 0x2c]
lea eax, [esp + 0x30]
push 0x49d588
push edi
push eax
call fcn.0046a30d
add esp, 0x10
test eax, eax
je 0x41c64a
push ebx
mov edx, str.reopen
mov ecx, esi
call fcn.0041c440
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push 0x49d8a4
push esi
call dword [sym.imp.lua51.dll_lua_pushfstring]
push 0x40
push 0x49d8a8
push edi
call fcn.00469257
add esp, 0x18
mov dword [esp + 0x2c], eax
test eax, eax
jne 0x41c5a5
push ebx
mov edx, str.open
mov ecx, esi
call fcn.0041c440
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [esp + 0xc]
lea ecx, [esp + 0x28]
call fcn.0041c4c0
mov ecx, dword [esp + 0xc]
cmp ecx, 0xffffffff
je 0x41c66c
mov eax, dword [esp + 0x28]
mov byte [esp + eax + 0x30], cl
inc dword [esp + 0x28]
push 0
push 0xffffffffffffffff
push esi
call dword [sym.imp.lua51.dll_lua_tolstring]
mov dword [esp + 0x18], eax
add esp, 0xc
lea eax, [esp + 0x28]
mov dword [esp + 0x14], 0x41c3e0
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x1c], 1
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 0
test eax, eax
jle 0x41c6b8
mov dword [esp + 0x28], 0
jmp 0x41c6e4
push dword [esp + 0x2c]
call fcn.00469c4d
add esp, 4
test eax, eax
jne 0x41c79e
push dword [esp + 0x2c]
lea eax, [esp + 0x34]
push 0x1000
push 1
push eax
call fcn.00469831
add esp, 0x10
mov dword [esp + 0x24], eax
lea ecx, [esp + 0x30]
mov dword [esp + 0x20], ecx
test eax, eax
je 0x41c79e
cmp byte [ecx], 0x1b
jne 0x41c79e
mov edi, dword [ebp + 8]
test edi, edi
je 0x41c734
push 0x62
push edi
call fcn.00462900
add esp, 8
test eax, eax
jne 0x41c734
mov eax, dword [sym.imp.lua51.dll_lua_pushfstring]
push edi
push str.binary
push str.attempt_to_load_a__s_chunk__mode_is__s_
push esi
call eax
add esp, 0x10
mov edi, 3
jmp 0x41c736
xor edi, edi
test edi, edi
jne 0x41c754
push dword [esp + 0xc]
lea eax, [esp + 0x18]
push eax
push 0x41c3a0
push esi
call dword [sym.imp.lua51.dll_lua_load]
mov edi, eax
add esp, 0x10
push dword [esp + 0x2c]
call fcn.00469c79
add esp, 4
mov dword [esp + 0xc], eax
cmp dword [esp + 0x10], 0
je 0x41c77b
push dword [esp + 0x2c]
call fcn.004692f0
mov eax, dword [esp + 0x10]
add esp, 4
push ebx
push esi
test eax, eax
je 0x41c7ce
call dword [sym.imp.lua51.dll_lua_settop]
push ebx
mov edx, str.read
mov ecx, esi
call fcn.0041c440
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 8]
test edi, edi
je 0x41c73a
push 0x74
push edi
call fcn.00462900
add esp, 8
test eax, eax
jne 0x41c73a
mov eax, dword [sym.imp.lua51.dll_lua_pushfstring]
push edi
push str.text
push str.attempt_to_load_a__s_chunk__mode_is__s_
push esi
call eax
mov edi, 3
jmp 0x41c751
call dword [sym.imp.lua51.dll_lua_remove]
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret