mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-31 06:26:14 +00:00
fix: [module extractor] fix invalid yara offset
This commit is contained in:
parent
529a24c191
commit
4dc5527c1a
1 changed files with 4 additions and 4 deletions
|
@ -106,11 +106,11 @@ def convert_byte_offset_to_string(b_content, offset):
|
||||||
byte_chunk = b_content[:offset + 1]
|
byte_chunk = b_content[:offset + 1]
|
||||||
try:
|
try:
|
||||||
string_chunk = byte_chunk.decode()
|
string_chunk = byte_chunk.decode()
|
||||||
|
offset = len(string_chunk) - 1
|
||||||
|
return offset
|
||||||
except UnicodeDecodeError as e:
|
except UnicodeDecodeError as e:
|
||||||
logger.error(f'Yara offset converter error, {e.reason}\n{byte_chunk}\n{offset}')
|
logger.error(f'Yara offset converter error, {str(e)}\n{offset}/{len(b_content)}')
|
||||||
string_chunk = byte_chunk
|
return convert_byte_offset_to_string(b_content, offset)
|
||||||
offset = len(string_chunk) - 1
|
|
||||||
return offset
|
|
||||||
|
|
||||||
|
|
||||||
# TODO RETRO HUNTS
|
# TODO RETRO HUNTS
|
||||||
|
|
Loading…
Add table
Reference in a new issue