Skip to content

Commit

Permalink
fix: [module extractor] fix invalid yara offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Aug 8, 2023
1 parent 529a24c commit 4dc5527
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/lib/module_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def convert_byte_offset_to_string(b_content, offset):
byte_chunk = b_content[:offset + 1]
try:
string_chunk = byte_chunk.decode()
offset = len(string_chunk) - 1
return offset
except UnicodeDecodeError as e:
logger.error(f'Yara offset converter error, {e.reason}\n{byte_chunk}\n{offset}')
string_chunk = byte_chunk
offset = len(string_chunk) - 1
return offset
logger.error(f'Yara offset converter error, {str(e)}\n{offset}/{len(b_content)}')
return convert_byte_offset_to_string(b_content, offset)


# TODO RETRO HUNTS
Expand Down

0 comments on commit 4dc5527

Please sign in to comment.