finixbit / elf-parser

Lightweight elf binary parser with no external dependencies - Sections, Symbols, Relocations, Segments
MIT License
250 stars 44 forks source link

Calling get_* multiple times causes dups #2

Open boguscoder opened 6 years ago

boguscoder commented 6 years ago

Parser’s getters are not guarded against multiple calls and not only repeat unnecessary parsing over and over but also populate data vectors with duplicate entries. At least it would be nice to clean vectos before parsing At best it may makes sense to cache results

finixbit commented 6 years ago

Great idea but its advisable for user calling getters to store them to prevent elf_parser.cpp from holding large parsed data within the program