Skip to content

Commit

Permalink
Add small docs for idamem (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazywam authored Sep 17, 2020
1 parent c4b39b9 commit 0992265
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 0 additions & 4 deletions docs/extractor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ Internally used classes and routines

.. autoclass:: malduck.extractor.extract_manager.ProcmemExtractManager
:members:
.. autoclass:: malduck.extractor.extractor.ExtractorBase
:members:
.. autoclass:: malduck.extractor.extractor.MetaExtractor
:members:
6 changes: 3 additions & 3 deletions malduck/extractor/extract_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def push_file(self, filepath: str, base: int = 0) -> Optional[str]:
:param base: Memory dump base address
:type base: int
:return: Family name if ripped successfully and provided better configuration than previous files.
Returns None otherwise.
Returns None otherwise.
"""
log.debug("Started extraction of file %s:%x", filepath, base)
with ProcessMemory.from_file(filepath, base=base) as p:
Expand Down Expand Up @@ -214,10 +214,10 @@ def push_procmem(
:param p: ProcessMemory object
:type p: :class:`malduck.procmem.ProcessMemory`
:param rip_binaries: Look for binaries (PE, ELF) in provided ProcessMemory and try to perform extraction using
specialized variants (ProcessMemoryPE, ProcessMemoryELF)
specialized variants (ProcessMemoryPE, ProcessMemoryELF)
:type rip_binaries: bool (default: False)
:return: Family name if ripped successfully and provided better configuration than previous procmems.
Returns None otherwise.
Returns None otherwise.
"""
from ..procmem import ProcessMemoryPE, ProcessMemoryELF
from ..procmem.binmem import ProcessMemoryBinary
Expand Down
2 changes: 1 addition & 1 deletion malduck/extractor/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def xxx_call(self, p: ProcessMemory, addr: int, match: YaraStringMatch) -> Confi
:param strings_or_method:
If method name doesn't match the string identifier, pass yara string identifier as decorator argument.
Multiple strings are accepted
:type strings_or_method: *str, optional
:type strings_or_method: str, optional
.. py:decoratormethod:: Extractor.extractor
Expand Down
15 changes: 14 additions & 1 deletion malduck/procmem/idamem.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,20 @@ def __len__(self):

class IDAProcessMemory(ProcessMemory):
"""
ProcessMemory representation operating in IDAPython context [BETA]
ProcessMemory representation operating in IDAPython context
Short name: `idamem`
Initialize by creating the object within IDAPython context and then use like a
normal procmem object:
.. code-block:: python
from malduck import idamem, xor
ida = idamem()
decrypted_data = xor(b"KEYZ", ida.readv(0x0040D320, 128))
some_wide_string = ida.asciiz(0x402010).decode("utf-16")
"""

def __init__(self):
Expand Down

0 comments on commit 0992265

Please sign in to comment.