Function at 0x4e56c0
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x6c
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x80]
mov eax, dword [eax]
cmp dword [ebp], 1
mov dword [esp + 0x2c], eax
jle 0x4e596c
mov dword [esp + 0x18], 0x7d0
mov edx, eax
mov edi, 1
mov dword [esp + 0x14], 0
lea esi, [esi]
lea eax, [edi*4]
mov dword [esp + 0x10], eax
mov eax, dword [edx + edi*4]
cmp byte [eax], 0x40
jne 0x4e5960
sub dword [esp + 0x18], 1
je 0x4e59e8
lea ebx, [eax + 1]
lea eax, [esp + 0x30]
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__stat32i64]
test eax, eax
js 0x4e5960
movzx eax, word [esp + 0x36]
and ax, 0xf000
cmp ax, 0x4000
je 0x4e5a17
mov dword [esp], ebx
mov dword [esp + 4], 0x560df9
call sym._fopen
mov ebx, eax
test eax, eax
je 0x4e5960
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._fseek
cmp eax, 0xffffffff
je 0x4e5938
mov dword [esp], ebx
call sym._ftell
mov esi, eax
cmp eax, 0xffffffff
je 0x4e5938
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
call sym._fseek
cmp eax, 0xffffffff
je 0x4e5938
lea eax, [esi + 1]
mov dword [esp], eax
call sym._xmalloc
mov dword [esp + 0xc], ebx
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], eax
mov dword [esp + 0x1c], eax
call sym._fread
mov edx, eax
cmp esi, eax
je 0x4e5805
mov dword [esp], ebx
mov dword [esp + 0x20], eax
call sym._ferror
mov edx, dword [esp + 0x20]
test eax, eax
jne 0x4e592c
mov eax, dword [esp + 0x1c]
mov byte [eax + edx], 0
mov edx, eax
movzx eax, byte [eax]
test al, al
jne 0x4e582f
jmp 0x4e5978
movzx eax, byte [edx + 1]
add edx, 1
test al, al
je 0x4e5978
test byte [eax + eax + 0x568980], 0x40
jne 0x4e5820
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call sym._buildargv
mov edx, eax
mov eax, dword [esp + 0x84]
mov esi, dword [edx]
mov ecx, dword [eax]
cmp ecx, dword [esp + 0x2c]
je 0x4e5a4f
test esi, esi
je 0x4e59d1
xor esi, esi
lea esi, [esi]
lea esi, [esi]
add esi, 1
cmp dword [edx + esi*4], 0
lea eax, [esi*4]
jne 0x4e5870
mov dword [esp + 0x20], eax
lea eax, [edi + esi]
shl eax, 2
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x28], edx
mov eax, dword [ecx + eax]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp]
mov ecx, dword [esp + 0x84]
lea eax, [esi + eax + 1]
shl eax, 2
mov dword [esp + 4], eax
mov eax, dword [ecx]
mov dword [esp], eax
call sym._xrealloc
mov ecx, dword [esp + 0x84]
mov dword [ecx], eax
mov ecx, dword [ebp]
sub ecx, edi
mov edi, dword [esp + 0x14]
shl ecx, 2
mov dword [esp + 8], ecx
lea ecx, [eax + edi*4 + 8]
add eax, dword [esp + 0x24]
mov dword [esp + 4], ecx
mov dword [esp], eax
call sym._memmove
mov ecx, dword [esp + 0x84]
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x10]
add eax, dword [ecx]
mov ecx, dword [esp + 0x20]
mov dword [esp + 4], edx
mov dword [esp], eax
mov dword [esp + 8], ecx
mov dword [esp + 0x10], edx
call sym._memcpy
mov eax, dword [ebp]
mov edx, dword [esp + 0x10]
lea eax, [esi + eax - 1]
mov dword [ebp], eax
mov dword [esp], edx
call sym._free
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call sym._free
mov dword [esp], ebx
call sym._fclose
mov dword [esp + 0x14], edi
add edi, 1
cmp dword [ebp], edi
jle 0x4e596c
mov eax, dword [esp + 0x84]
mov edx, dword [eax]
jmp 0x4e5700
mov dword [esp + 0x14], edi
add edi, 1
cmp dword [ebp], edi
jg 0x4e594c
add esp, 0x6c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 4
call sym._xmalloc
mov dword [eax], 0
mov edx, eax
mov eax, dword [esp + 0x84]
mov ecx, dword [eax]
cmp dword [esp + 0x2c], ecx
jne 0x4e59d1
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x28], edx
xor esi, esi
mov dword [esp], eax
call sym._dupargv
mov dword [esp + 0x20], 0
mov edx, dword [esp + 0x28]
mov ecx, eax
mov eax, dword [esp + 0x84]
mov dword [eax], ecx
mov eax, dword [esp + 0x10]
mov dword [esp + 0x24], eax
jmp 0x4e588e
mov eax, dword [esp + 0x10]
mov dword [esp + 0x20], 0
xor esi, esi
mov dword [esp + 0x24], eax
jmp 0x4e588e
mov ebx, dword [edx]
mov dword [esp], 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov dword [esp + 4], str._s:_error:_too_many___files_encountered_n
mov dword [esp + 8], ebx
mov dword [esp], eax
call sym._fprintf_1
mov dword [esp], 1
call sym._xexit
mov eax, dword [esp + 0x84]
mov eax, dword [eax]
mov ebx, dword [eax]
mov dword [esp], 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov dword [esp + 4], str._s:_error:___file_refers_to_a_directory_n
mov dword [esp + 8], ebx
mov dword [esp], eax
call sym._fprintf_1
mov dword [esp], 1
call sym._xexit
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x20], edx
mov dword [esp], eax
call sym._dupargv
mov edx, dword [esp + 0x20]
mov ecx, eax
mov eax, dword [esp + 0x84]
mov dword [eax], ecx
jmp 0x4e585c