Skip to content

Commit

Permalink
Add logging stacktrace in 'image' property (#39)
Browse files Browse the repository at this point in the history
Co-authored-by: Arkadiusz Wróbel <[email protected]>
  • Loading branch information
catsuryuu and Arkadiusz Wróbel authored Aug 20, 2020
1 parent d9ba8c2 commit 89760f4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions malduck/procmem/binmem.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import logging
from abc import ABCMeta, abstractmethod
from typing import List, Iterator, Optional, Type, TypeVar

from .region import Region
from .procmem import ProcessMemory, ProcessMemoryBuffer

log = logging.getLogger(__name__)

T = TypeVar("T", bound="ProcessMemoryBinary")


Expand Down Expand Up @@ -49,6 +52,11 @@ def image(self: T) -> Optional[T]:
self._image = self.__class__.from_memory(self, image=True)
return self._image
except Exception:
import traceback

log.debug(
"image construction throwed exception: %s", traceback.format_exc()
)
return None

@abstractmethod
Expand Down

0 comments on commit 89760f4

Please sign in to comment.