Function at 0x4d1d1d
Capabilities:
Get file size
Read file on windows

Disassembly:
mov eax, 0x5abb92
call fcn.00591b5c
sub esp, 0x130
mov dword [ebp - 0x13c], ecx
lea ecx, [ebp - 0x94]
call fcn.004d9dc1
and dword [ebp - 4], 0
cmp dword [ebp + 0x14], 0
jne 0x4d1d51
lea eax, [ebp - 0x94]
mov dword [ebp + 0x14], eax
mov eax, dword [ebp - 0x13c]
movzx eax, byte [eax + 8]
cmp eax, 0xdb
je 0x4d1d6a
push 0
call fcn.004d177c
pop ecx
mov eax, dword [ebp - 0x13c]
cmp dword [eax + 0xc], 0
je 0x4d1da9
mov eax, dword [ebp - 0x13c]
movzx eax, byte [eax + 9]
test eax, eax
jne 0x4d1d9f
mov eax, dword [ebp - 0x13c]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x108], eax
push dword [ebp - 0x108]
call fcn.00565be4
pop ecx
mov eax, dword [ebp - 0x13c]
and dword [eax + 0xc], 0
mov eax, dword [ebp - 0x13c]
and dword [eax + 0x10], 0
mov eax, dword [ebp - 0x13c]
and dword [eax + 0x14], 0
mov eax, dword [ebp - 0x13c]
and byte [eax + 9], 0
lea ecx, [ebp - 0x84]
call fcn.004d00b6
mov byte [ebp - 4], 1
push dword [ebp + 8]
lea ecx, [ebp - 0x84]
call fcn.004d03d5
push dword [ebp + 0x14]
lea eax, [ebp - 0x84]
push eax
call fcn.004d5a6a
pop ecx
pop ecx
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x4d1e2e
and byte [ebp - 0x109], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x109]
jmp 0x4d23fc
push 0
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x4d1ebe
lea ecx, [ebp - 0xb0]
call fcn.004cde9c
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xb0]
call fcn.004cfd54
lea ecx, [ebp - 0xb0]
call fcn.0055420c
push eax
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
and byte [ebp - 0x10a], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xb0]
call fcn.004ce1b7
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x10a]
jmp 0x4d23fc
cmp dword [ebp - 0x1c], 4
jae 0x4d1f10
push str.File_is_empty_or_too_small
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
mov byte [ebp - 0x10b], 1
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x10b]
jmp 0x4d23fc
and dword [ebp - 0x20], 0
and dword [ebp - 0x88], 0
push 0
lea eax, [ebp - 0x88]
push eax
push 4
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4d1fb8
lea ecx, [ebp - 0xcc]
call fcn.004cde9c
mov byte [ebp - 4], 3
lea ecx, [ebp - 0xcc]
call fcn.004cfd54
lea ecx, [ebp - 0xcc]
call fcn.0055420c
push eax
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
and byte [ebp - 0x10c], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xcc]
call fcn.004ce1b7
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x10c]
jmp 0x4d23fc
cmp dword [ebp - 0x20], 4
jle 0x4d1fc6
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp + 0x10]
jle 0x4d2025
push str.Invalid_header_size
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push dword [ebp + 8]
push str.filename
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x28]
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
and byte [ebp - 0x10d], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x10d]
jmp 0x4d23fc
mov eax, dword [ebp - 0x20]
sub eax, 4
mov dword [ebp - 0x90], eax
push dword [ebp - 0x90]
call fcn.00565bb9
pop ecx
mov dword [ebp - 0x114], eax
mov eax, dword [ebp - 0x114]
mov dword [ebp - 0x8c], eax
cmp dword [ebp - 0x8c], 0
jne 0x4d20a4
push str.Out_of_memory_for_header.
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
and byte [ebp - 0x115], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x115]
jmp 0x4d23fc
and dword [ebp - 0x88], 0
push 0
lea eax, [ebp - 0x88]
push eax
push dword [ebp - 0x90]
push dword [ebp - 0x8c]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4d217d
lea ecx, [ebp - 0xe8]
call fcn.004cde9c
mov byte [ebp - 4], 4
lea ecx, [ebp - 0xe8]
call fcn.004cfd54
lea ecx, [ebp - 0xe8]
call fcn.0055420c
push eax
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push dword [ebp + 8]
push str.filename
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x28]
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x11c], eax
push dword [ebp - 0x11c]
call fcn.00565be4
pop ecx
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
and byte [ebp - 0x11d], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xe8]
call fcn.004ce1b7
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x11d]
jmp 0x4d23fc
mov eax, dword [ebp - 0x88]
cmp eax, dword [ebp - 0x90]
je 0x4d2202
push str.Failed_to_read_the_entire_header
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push dword [ebp + 8]
push str.filename
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x28]
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x124], eax
push dword [ebp - 0x124]
call fcn.00565be4
pop ecx
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
and byte [ebp - 0x125], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x125]
jmp 0x4d23fc
mov ecx, dword [ebp + 0xc]
call fcn.004d1618
push dword [ebp - 0x90]
push dword [ebp - 0x8c]
mov ecx, dword [ebp + 0xc]
call fcn.004d2c5e
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x12c], eax
push dword [ebp - 0x12c]
call fcn.00565be4
pop ecx
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x90]
push eax
call fcn.00565bb9
pop ecx
mov dword [ebp - 0x130], eax
mov eax, dword [ebp - 0x13c]
mov ecx, dword [ebp - 0x130]
mov dword [eax + 0xc], ecx
mov eax, dword [ebp - 0x13c]
cmp dword [eax + 0xc], 0
jne 0x4d22cb
push str.Out_of_memory_reading_file_after_header
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x134], eax
push dword [ebp - 0x134]
call fcn.00565be4
pop ecx
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
and byte [ebp - 0x135], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x135]
jmp 0x4d23fc
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x90]
push eax
push 0
mov eax, dword [ebp - 0x13c]
push dword [eax + 0xc]
call fcn.0058ee10
add esp, 0xc
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x90]
sub eax, 4
mov ecx, dword [ebp - 0x13c]
mov dword [ecx + 0x10], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x90]
mov ecx, dword [ebp - 0x13c]
mov dword [ecx + 0x14], eax
push 0
lea eax, [ebp - 0x88]
push eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x90]
sub eax, 4
push eax
mov eax, dword [ebp - 0x13c]
push dword [eax + 0xc]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x14], eax
mov byte [ebp - 0x15], 1
cmp dword [ebp - 0x14], 0
jne 0x4d239b
lea ecx, [ebp - 0x104]
call fcn.004cde9c
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x104]
call fcn.004cfd54
lea ecx, [ebp - 0x104]
call fcn.0055420c
push eax
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
push dword [ebp + 8]
push str.filename
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x28]
and byte [ebp - 0x15], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x104]
call fcn.004ce1b7
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x90]
sub eax, 4
cmp dword [ebp - 0x88], eax
je 0x4d23c3
push str.Failed_to_read_the_entire_file
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x14]
call dword [eax + 0x10]
and byte [ebp - 0x15], 0
push 0
push dword [ebp - 0x10]
call fcn.004e81eb
pop ecx
pop ecx
mov al, byte [ebp - 0x15]
mov byte [ebp - 0x136], al
and byte [ebp - 4], 0
lea ecx, [ebp - 0x84]
call fcn.004d018e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x94]
call fcn.004d9e07
mov al, byte [ebp - 0x136]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
leave
ret 0x10