Beispiel #1
0
def extract_file_section_names(smda_report, file_path):
    lief_binary = lief.parse(file_path)
    if not isinstance(lief_binary, lief.PE.Binary):
        return
    if lief_binary and lief_binary.sections:
        base_address = lief_binary.optional_header.imagebase
        for section in lief_binary.sections:
            yield Section(section.name), base_address + section.virtual_address
Beispiel #2
0
def extract_file_section_names():
    """extract section names

    IDA must load resource sections for this to be complete
        - '-R' from console
        - Check 'Load resource sections' when opening binary in IDA manually
    """
    for seg in capa.features.extractors.ida.helpers.get_segments(
            skip_header_segments=True):
        yield Section(idaapi.get_segm_name(seg)), seg.start_ea
Beispiel #3
0
def extract_file_section_names(pe, file_path):
    base_address = pe.OPTIONAL_HEADER.ImageBase

    for section in pe.sections:
        try:
            name = section.Name.partition(b"\x00")[0].decode("ascii")
        except UnicodeDecodeError:
            continue

        yield Section(name), base_address + section.VirtualAddress
Beispiel #4
0
def extract_file_section_names(vw, file_path):
    for va, _, segname, _ in vw.getSegments():
        yield Section(segname), va
Beispiel #5
0
def extract_file_section_names(data: DataUnit):
    for addr, seg in data.obj.bin.seg.items():
        yield Section(seg), addr
Beispiel #6
0
def extract_file_section_names(elf, **kwargs):
    for section in elf.iter_sections():
        if section.name:
            yield Section(section.name), section.header.sh_addr
        elif section.is_null():
            yield Section("NULL"), section.header.sh_addr