From 18474a2144d047024b1bb9a789663d8cce73237b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 15 Sep 2020 12:39:59 +0200 Subject: [PATCH] chg: Add comments to ELF, PE, and MachO object generators. --- pymisp/tools/elfobject.py | 2 ++ pymisp/tools/machoobject.py | 2 ++ pymisp/tools/peobject.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/pymisp/tools/elfobject.py b/pymisp/tools/elfobject.py index bacf85a..78c7f62 100644 --- a/pymisp/tools/elfobject.py +++ b/pymisp/tools/elfobject.py @@ -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") @@ -74,6 +75,7 @@ class ELFObject(AbstractMISPObjectGenerator): 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) diff --git a/pymisp/tools/machoobject.py b/pymisp/tools/machoobject.py index 503ef13..c08ad7d 100644 --- a/pymisp/tools/machoobject.py +++ b/pymisp/tools/machoobject.py @@ -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) @@ -76,6 +77,7 @@ class MachOObject(AbstractMISPObjectGenerator): 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) diff --git a/pymisp/tools/peobject.py b/pymisp/tools/peobject.py index 7d5bcc9..47f0899 100644 --- a/pymisp/tools/peobject.py +++ b/pymisp/tools/peobject.py @@ -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) @@ -125,6 +126,7 @@ class PEObject(AbstractMISPObjectGenerator): 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)