diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2023-03-23 03:23:18 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2023-03-23 03:23:18 -0400 |
commit | 382737c817a172a03b054bcc447437019eabcfb3 (patch) | |
tree | 7002fd739a3a02783de9d8e1cf0e7aaf0e5058bb /.gitignore | |
parent | 6c36678e2f75c3cf33bc48fa93ebdd577fc5c3d7 (diff) | |
download | sploit-382737c817a172a03b054bcc447437019eabcfb3.tar.gz sploit-382737c817a172a03b054bcc447437019eabcfb3.zip |
r2: Rewrite get_elf_symbols()
This addresses a couple issues with get_elf_symbols().
First of all, we can greatly simplify our processing of the r2 output by
getting back json instead of trying to do string processing on their
pretty-printed tables. This resolves a number of issues we were running
into and also makes the code way more maintainable.
Second, we have reevaluated what we actually want to get out of r2. We
now grab section offsets, all FUNC, OBJ, and NOTYPE symbols, and all
strings. The strings and section offsets no longer try to escape
special characters and sometimes aren't accessible through normal object
attributes, but now that we have dictionary subscripting, this isn't an
issue.
Lastly, a few subsets of the symbols are separated into their own tables
and added to the main table as subtables. Sections are located at
sym.sect and offset at 0. Imported symbols are located at sym.imp and are
offset at sect['.plt']. Relocations are located at sym.rel and are offset at
sect['.got']. Strings are located at sym.str and are offset at
sect['.rodata'].
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions