Function at 0x587120
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x102c
call fcn.0059f510
mov eax, dword [0x5f300c]
xor eax, esp
mov dword [esp + 0x1028], eax
push ebx
push esi
push edi
mov edi, ecx
mov ebx, edx
push ebx
mov dword [esp + 0x10], ebx
mov eax, dword [edi + 0x14]
mov esi, dword [edi + 0xc]
sub esi, dword [eax]
sub esi, 0x10
sar esi, 4
dec esi
mov dword [esp + 0x18], esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_clearerr]
add esp, 4
test esi, esi
jne 0x5871f1
push 1
mov edx, ebx
mov ecx, edi
call fcn.00586fe0
mov esi, dword [ebp + 8]
add esp, 4
mov ebx, eax
inc esi
push dword [esp + 0xc]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ferror]
add esp, 4
test eax, eax
je 0x58741e
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov esi, dword [eax]
mov eax, dword [edi + 0xc]
push esi
mov dword [eax + 8], 0
add dword [edi + 0xc], 0x10
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push edi
call sym.SciTE.exe_lua_pushstring
mov ecx, dword [edi + 0xc]
mov eax, esi
cdq
add esp, 8
mov dword [ecx], eax
mov eax, 3
mov dword [ecx + 4], edx
mov dword [ecx + 8], 0x13
add dword [edi + 0xc], 0x10
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1028]
xor ecx, esp
call fcn.0059df64
mov esp, ebp
pop ebp
ret
lea eax, [esi + 0x14]
push eax
push edi
call sym.SciTE.exe_lua_checkstack
add esp, 8
test eax, eax
je 0x58744a
mov esi, dword [ebp + 8]
mov ebx, 1
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], esi
dec eax
mov dword [esp + 0x14], eax
test ebx, ebx
je 0x587182
mov edx, esi
mov ecx, edi
call fcn.00577fd0
cmp eax, 0x5d88e0
je 0x587337
mov eax, dword [eax + 8]
and eax, 0xf
cmp al, 3
jne 0x587337
mov edx, esi
mov ecx, edi
call fcn.00577fd0
cmp dword [eax + 8], 0x13
jne 0x587263
mov ebx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], eax
jmp 0x58727f
push 0
lea edx, [esp + 0x1c]
mov ecx, eax
call fcn.0059ac20
add esp, 4
test eax, eax
je 0x58745a
mov ebx, dword [esp + 0x18]
test ebx, ebx
jne 0x5872de
mov ebx, dword [esp + 0xc]
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getc]
add esp, 4
mov dword [esp + 0x10], eax
push ebx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ungetc]
add esp, 8
mov edx, 0x602fe6
mov ecx, edi
call fcn.00593400
mov ecx, dword [edi + 0xc]
mov dword [ecx], eax
movzx eax, byte [eax + 4]
or eax, 0x40
mov dword [ecx + 8], eax
mov eax, dword [edi + 0x10]
add dword [edi + 0xc], 0x10
cmp dword [eax + 0xc], 0
jle 0x5872cf
mov ecx, edi
call fcn.00585d20
xor ebx, ebx
cmp dword [esp + 0x10], 0xffffffff
setne bl
jmp 0x587408
lea eax, [esp + 0x30]
mov dword [esp + 0x2c], edi
mov dword [esp + 0x20], eax
lea eax, [esp + 0x20]
push ebx
push eax
mov dword [esp + 0x30], 0
mov dword [esp + 0x2c], 0x1000
call sym.SciTE.exe_luaL_prepbuffsize
push dword [esp + 0x14]
push ebx
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov esi, eax
lea eax, [esp + 0x38]
add dword [esp + 0x40], esi
push eax
call sym.SciTE.exe_luaL_pushresult
xor eax, eax
add esp, 0x1c
cmp eax, esi
mov esi, dword [esp + 0x10]
sbb ebx, ebx
neg ebx
jmp 0x587408
push 0
push esi
push edi
call sym.SciTE.exe_lua_tolstring
add esp, 0xc
test eax, eax
je 0x58746f
mov cl, byte [eax]
cmp cl, 0x2a
jne 0x587355
mov cl, byte [eax + 1]
movsx eax, cl
add eax, 0xffffffb4
cmp eax, 0x22
ja case.0x58736b.77
movzx eax, byte [eax + 0x587490]
jmp dword [eax*4 + 0x58747c]
mov edx, dword [esp + 0xc]
mov ecx, edi
call fcn.00586c40
mov ebx, eax
jmp 0x587408
mov edx, dword [esp + 0xc]
mov ecx, edi
push 1
call fcn.00586fe0
mov ebx, eax
jmp 0x587405
mov edx, dword [esp + 0xc]
mov ecx, edi
push 0
call fcn.00586fe0
mov ebx, eax
jmp 0x587405
mov esi, dword [esp + 0xc]
lea eax, [esp + 0x30]
mov dword [esp + 0x2c], edi
mov dword [esp + 0x20], eax
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0x1000
lea eax, [esp + 0x20]
push 0x1000
push eax
call sym.SciTE.exe_luaL_prepbuffsize
push esi
push 0x1000
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add dword [esp + 0x40], eax
add esp, 0x18
cmp eax, 0x1000
je 0x5873c6
mov esi, dword [esp + 0x10]
lea eax, [esp + 0x20]
push eax
call sym.SciTE.exe_luaL_pushresult
mov ebx, 1
add esp, 4
mov eax, dword [esp + 0x14]
inc esi
mov dword [esp + 0x10], esi
test eax, eax
jne 0x587216
jmp 0x587182
test ebx, ebx
jne 0x587430
add dword [edi + 0xc], 0xfffffff0
mov eax, dword [edi + 0xc]
mov dword [eax + 8], ebx
add dword [edi + 0xc], 0x10
sub esi, dword [ebp + 8]
mov ecx, dword [esp + 0x1034]
mov eax, esi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0059df64
mov esp, ebp
pop ebp
ret
push 0x5ffdfc
push str.stack_overflow___s_
push edi
call sym.SciTE.exe_luaL_error
mov edx, esi
mov ecx, edi
call fcn.0057b140
push str.invalid_format
push esi
push edi
call sym.SciTE.exe_luaL_argerror
push 4
mov edx, esi
mov ecx, edi
call fcn.0057a9a0
mov edi, edi
xchg ebp, eax
jae 5797079
add byte [esi - 0x7bffa78d], ah
jae 0x5874df
add byte [edx + 0x73], dh
pop eax
add byte [ebx + 0x74], ah
pop eax
add byte [eax], al
add al, 4
add al, 4
add al, 4
add al, 4
add al, 4
add al, 4
add al, 4
add al, 4
add al, 4
add al, 4
add dword [esp + eax], eax
add al, 4
add al, 4
add al, 4
add al, 4
add al, byte [ebx + eax]
int3
call fcn.00587120
add esp, 4
pop ebp
ret