xoofx / LibObjectFile

LibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, PE, DWARF, ar...)
BSD 2-Clause "Simplified" License
159 stars 11 forks source link

ElfObjectFile read file > 2GB #13

Closed onSec-fr closed 3 years ago

onSec-fr commented 4 years ago

Hello, Thx for your work!

I ran into a problem trying to read a file bigger than 2GB because the System.IO.MemoryStream capacity parameter is expecting an integer. I'm not sure it has anything to do with your library, but if so, could you provide a workaround ?

Screenshot_4

onSec-fr commented 4 years ago

Note : Usually I could read the file in chunks but how to do it because ElfObjectFile.Read is expecting a stream ?

xoofx commented 3 years ago

Sorry to get back to you on this only now, I completely forgot about this issue.

So by default, ElfObjectFile will load the section in memory if you are in read-write mode, otherwise you should be able to load the sections in read-only mode with ElfReaderOptions.ReadOnly.