redballoonsecurity/ofrak

elf analyzer assumes elf is unpacked when running analyzer

Opened this issue · 0 comments

If you identify and then analyze an elf without unpacking, these lines will throw an error since the children don't exist.

elf_header = await resource.get_only_descendant_as_view(
ElfHeader, r_filter=ResourceFilter.with_tags(ElfHeader)
)
elf_basic_header = await resource.get_only_descendant_as_view(
ElfBasicHeader, r_filter=ResourceFilter.with_tags(ElfBasicHeader)
)
return ProgramAttributes(
elf_header.get_isa(),
None,
elf_basic_header.get_bitwidth(),
elf_basic_header.get_endianness(),
None,
)