Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't skip over symbol at start of file in _populate_symbols
Lets say we have an ELF with the following symbols ``` Symbol table '.symtab' contains 5 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000035 0 NOTYPE LOCAL DEFAULT 2 aaaa 2: 0000000000000022 0 NOTYPE LOCAL DEFAULT 2 bbbb 3: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 cccc 4: 0000000000000054 0 NOTYPE GLOBAL DEFAULT 2 dddd ``` Then pwnlib's ELF(binary).symbols will be `{'aaaa': 53, 'bbbb': 34, 'dddd': 84}`. This is missing the symbol `cccc`, because it's value is 0. This change checks the name instead of the value, because the value can be 0 if the symbol points to the beginning. The new and correct value of pwnlib's ELF(binary).symbols will be `{'aaaa': 53, 'cccc': 0, 'bbbb': 34, 'dddd': 84}`.
- Loading branch information