Skip to content

Commit

Permalink
Fix logger interface passed to debloat (#49)
Browse files Browse the repository at this point in the history
* Fix logger interface passed to debloat
  • Loading branch information
nazywam authored May 23, 2023
1 parent 41e289d commit 056ba39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion karton/archive_extractor/archive_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def __init__(
)

def debloat_pe(self, child_contents: bytes) -> Optional[bytes]:
def log_message_wrapped(message: str, *args, **kwargs) -> None:
self.log.info(message)

if HAS_DEBLOAT is False:
self.log.info(
"Child looks like bloated PE file, but debloat is not installed."
Expand All @@ -66,7 +69,10 @@ def debloat_pe(self, child_contents: bytes) -> Optional[bytes]:

with tempfile.NamedTemporaryFile() as f:
process_pe(
pe, out_path=f.name, unsafe_processing=False, log_message=self.log.info
pe,
out_path=f.name,
unsafe_processing=False,
log_message=log_message_wrapped,
)
processed = f.read()

Expand Down

0 comments on commit 056ba39

Please sign in to comment.