mirror of https://github.com/MISP/PyMISP
parent
f0a20cd8ad
commit
5e9433206e
|
@ -36,7 +36,7 @@ class ELFObject(AbstractMISPObjectGenerator):
|
|||
"""Creates an ELF object, with lief"""
|
||||
super().__init__('elf', **kwargs)
|
||||
if not HAS_PYDEEP:
|
||||
logger.warning("Please install pydeep: pip install git+https://github.com/kbandla/pydeep.git")
|
||||
logger.warning("pydeep is missing, please install pymisp this way: pip install pymisp[fileobjects]")
|
||||
if pseudofile:
|
||||
if isinstance(pseudofile, BytesIO):
|
||||
self.__elf = lief.ELF.parse(raw=pseudofile.getvalue())
|
||||
|
|
|
@ -33,9 +33,9 @@ class FileObject(AbstractMISPObjectGenerator):
|
|||
def __init__(self, filepath: Optional[Union[Path, str]] = None, pseudofile: Optional[BytesIO] = None, filename: Optional[str] = None, **kwargs) -> None:
|
||||
super().__init__('file', **kwargs)
|
||||
if not HAS_PYDEEP:
|
||||
logger.warning("Please install pydeep: pip install git+https://github.com/kbandla/pydeep.git")
|
||||
logger.warning("pydeep is missing, please install pymisp this way: pip install pymisp[fileobjects]")
|
||||
if not HAS_MAGIC:
|
||||
logger.warning("Please install python-magic: pip install python-magic.")
|
||||
logger.warning("python-magic is missing, please install pymisp this way: pip install pymisp[fileobjects]")
|
||||
if filename:
|
||||
# Useful in case the file is copied with a pre-defined name by a script but we want to keep the original name
|
||||
self.__filename = filename
|
||||
|
|
|
@ -36,7 +36,7 @@ class MachOObject(AbstractMISPObjectGenerator):
|
|||
"""Creates an MachO object, with lief"""
|
||||
super().__init__('macho', **kwargs)
|
||||
if not HAS_PYDEEP:
|
||||
logger.warning("Please install pydeep: pip install git+https://github.com/kbandla/pydeep.git")
|
||||
logger.warning("pydeep is missing, please install pymisp this way: pip install pymisp[fileobjects]")
|
||||
if pseudofile:
|
||||
if isinstance(pseudofile, BytesIO):
|
||||
self.__macho = lief.MachO.parse(raw=pseudofile.getvalue())
|
||||
|
|
|
@ -39,7 +39,7 @@ class PEObject(AbstractMISPObjectGenerator):
|
|||
"""Creates an PE object, with lief"""
|
||||
super().__init__('pe', **kwargs)
|
||||
if not HAS_PYDEEP:
|
||||
logger.warning("Please install pydeep: pip install git+https://github.com/kbandla/pydeep.git")
|
||||
logger.warning("pydeep is missing, please install pymisp this way: pip install pymisp[fileobjects]")
|
||||
if pseudofile:
|
||||
if isinstance(pseudofile, BytesIO):
|
||||
self.__pe = lief.PE.parse(raw=pseudofile.getvalue())
|
||||
|
|
Loading…
Reference in New Issue