mirror of https://github.com/MISP/PyMISP
chg: Add comments to ELF, PE, and MachO object generators.
parent
50e5f156bd
commit
18474a2144
|
@ -33,6 +33,7 @@ def make_elf_objects(lief_parsed: lief.Binary, misp_file: FileObject, standalone
|
||||||
class ELFObject(AbstractMISPObjectGenerator):
|
class ELFObject(AbstractMISPObjectGenerator):
|
||||||
|
|
||||||
def __init__(self, parsed: lief.ELF.Binary = None, filepath: Union[Path, str] = None, pseudofile: Union[BytesIO, bytes] = None, **kwargs):
|
def __init__(self, parsed: lief.ELF.Binary = None, filepath: Union[Path, str] = None, pseudofile: Union[BytesIO, bytes] = None, **kwargs):
|
||||||
|
"""Creates an ELF object, with lief"""
|
||||||
super(ELFObject, self).__init__('elf', **kwargs)
|
super(ELFObject, self).__init__('elf', **kwargs)
|
||||||
if not HAS_PYDEEP:
|
if not HAS_PYDEEP:
|
||||||
logger.warning("Please install pydeep: pip install git+https://github.com/kbandla/pydeep.git")
|
logger.warning("Please install pydeep: pip install git+https://github.com/kbandla/pydeep.git")
|
||||||
|
@ -74,6 +75,7 @@ class ELFObject(AbstractMISPObjectGenerator):
|
||||||
class ELFSectionObject(AbstractMISPObjectGenerator):
|
class ELFSectionObject(AbstractMISPObjectGenerator):
|
||||||
|
|
||||||
def __init__(self, section: lief.ELF.Section, **kwargs):
|
def __init__(self, section: lief.ELF.Section, **kwargs):
|
||||||
|
"""Creates an ELF Section object. Object generated by ELFObject."""
|
||||||
# Python3 way
|
# Python3 way
|
||||||
# super().__init__('pe-section')
|
# super().__init__('pe-section')
|
||||||
super(ELFSectionObject, self).__init__('elf-section', **kwargs)
|
super(ELFSectionObject, self).__init__('elf-section', **kwargs)
|
||||||
|
|
|
@ -33,6 +33,7 @@ def make_macho_objects(lief_parsed: lief.Binary, misp_file: FileObject, standalo
|
||||||
class MachOObject(AbstractMISPObjectGenerator):
|
class MachOObject(AbstractMISPObjectGenerator):
|
||||||
|
|
||||||
def __init__(self, parsed: Optional[lief.MachO.Binary] = None, filepath: Optional[Union[Path, str]] = None, pseudofile: Optional[BytesIO] = None, **kwargs):
|
def __init__(self, parsed: Optional[lief.MachO.Binary] = None, filepath: Optional[Union[Path, str]] = None, pseudofile: Optional[BytesIO] = None, **kwargs):
|
||||||
|
"""Creates an MachO object, with lief"""
|
||||||
# Python3 way
|
# Python3 way
|
||||||
# super().__init__('elf')
|
# super().__init__('elf')
|
||||||
super(MachOObject, self).__init__('macho', **kwargs)
|
super(MachOObject, self).__init__('macho', **kwargs)
|
||||||
|
@ -76,6 +77,7 @@ class MachOObject(AbstractMISPObjectGenerator):
|
||||||
class MachOSectionObject(AbstractMISPObjectGenerator):
|
class MachOSectionObject(AbstractMISPObjectGenerator):
|
||||||
|
|
||||||
def __init__(self, section: lief.MachO.Section, **kwargs):
|
def __init__(self, section: lief.MachO.Section, **kwargs):
|
||||||
|
"""Creates an MachO Section object. Object generated by MachOObject."""
|
||||||
# Python3 way
|
# Python3 way
|
||||||
# super().__init__('pe-section')
|
# super().__init__('pe-section')
|
||||||
super(MachOSectionObject, self).__init__('macho-section', **kwargs)
|
super(MachOSectionObject, self).__init__('macho-section', **kwargs)
|
||||||
|
|
|
@ -35,6 +35,7 @@ def make_pe_objects(lief_parsed: lief.Binary, misp_file: FileObject, standalone:
|
||||||
class PEObject(AbstractMISPObjectGenerator):
|
class PEObject(AbstractMISPObjectGenerator):
|
||||||
|
|
||||||
def __init__(self, parsed: Optional[lief.PE.Binary] = None, filepath: Optional[Union[Path, str]] = None, pseudofile: Optional[BytesIO] = None, **kwargs):
|
def __init__(self, parsed: Optional[lief.PE.Binary] = None, filepath: Optional[Union[Path, str]] = None, pseudofile: Optional[BytesIO] = None, **kwargs):
|
||||||
|
"""Creates an PE object, with lief"""
|
||||||
# Python3 way
|
# Python3 way
|
||||||
# super().__init__('pe')
|
# super().__init__('pe')
|
||||||
super(PEObject, self).__init__('pe', **kwargs)
|
super(PEObject, self).__init__('pe', **kwargs)
|
||||||
|
@ -125,6 +126,7 @@ class PEObject(AbstractMISPObjectGenerator):
|
||||||
class PESectionObject(AbstractMISPObjectGenerator):
|
class PESectionObject(AbstractMISPObjectGenerator):
|
||||||
|
|
||||||
def __init__(self, section: lief.PE.Section, **kwargs):
|
def __init__(self, section: lief.PE.Section, **kwargs):
|
||||||
|
"""Creates an PE Section object. Object generated by PEObject."""
|
||||||
# Python3 way
|
# Python3 way
|
||||||
# super().__init__('pe-section')
|
# super().__init__('pe-section')
|
||||||
super(PESectionObject, self).__init__('pe-section', **kwargs)
|
super(PESectionObject, self).__init__('pe-section', **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue