Skip to content

Commit

Permalink
chg: Add comments to ELF, PE, and MachO object generators.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Sep 15, 2020
1 parent 50e5f15 commit 18474a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymisp/tools/elfobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def make_elf_objects(lief_parsed: lief.Binary, misp_file: FileObject, standalone
class ELFObject(AbstractMISPObjectGenerator):

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)
if not HAS_PYDEEP:
logger.warning("Please install pydeep: pip install git+https://github.com/kbandla/pydeep.git")
Expand Down Expand Up @@ -74,6 +75,7 @@ def generate_attributes(self):
class ELFSectionObject(AbstractMISPObjectGenerator):

def __init__(self, section: lief.ELF.Section, **kwargs):
"""Creates an ELF Section object. Object generated by ELFObject."""
# Python3 way
# super().__init__('pe-section')
super(ELFSectionObject, self).__init__('elf-section', **kwargs)
Expand Down
2 changes: 2 additions & 0 deletions pymisp/tools/machoobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def make_macho_objects(lief_parsed: lief.Binary, misp_file: FileObject, standalo
class MachOObject(AbstractMISPObjectGenerator):

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
# super().__init__('elf')
super(MachOObject, self).__init__('macho', **kwargs)
Expand Down Expand Up @@ -76,6 +77,7 @@ def generate_attributes(self):
class MachOSectionObject(AbstractMISPObjectGenerator):

def __init__(self, section: lief.MachO.Section, **kwargs):
"""Creates an MachO Section object. Object generated by MachOObject."""
# Python3 way
# super().__init__('pe-section')
super(MachOSectionObject, self).__init__('macho-section', **kwargs)
Expand Down
2 changes: 2 additions & 0 deletions pymisp/tools/peobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def make_pe_objects(lief_parsed: lief.Binary, misp_file: FileObject, standalone:
class PEObject(AbstractMISPObjectGenerator):

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
# super().__init__('pe')
super(PEObject, self).__init__('pe', **kwargs)
Expand Down Expand Up @@ -125,6 +126,7 @@ def generate_attributes(self):
class PESectionObject(AbstractMISPObjectGenerator):

def __init__(self, section: lief.PE.Section, **kwargs):
"""Creates an PE Section object. Object generated by PEObject."""
# Python3 way
# super().__init__('pe-section')
super(PESectionObject, self).__init__('pe-section', **kwargs)
Expand Down

0 comments on commit 18474a2

Please sign in to comment.