mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
chg: [module extrator] add debug
This commit is contained in:
parent
2691000d0c
commit
bd7aa979bd
1 changed files with 5 additions and 1 deletions
|
@ -104,7 +104,11 @@ def _get_word_regex(word):
|
||||||
|
|
||||||
def convert_byte_offset_to_string(b_content, offset):
|
def convert_byte_offset_to_string(b_content, offset):
|
||||||
byte_chunk = b_content[:offset + 1]
|
byte_chunk = b_content[:offset + 1]
|
||||||
string_chunk = byte_chunk.decode()
|
try:
|
||||||
|
string_chunk = byte_chunk.decode()
|
||||||
|
except UnicodeDecodeError as e:
|
||||||
|
logger.error(f'Yara offset coverter error, {e.reason}\n{b_content}\n{offset}')
|
||||||
|
string_chunk = b_content
|
||||||
offset = len(string_chunk) - 1
|
offset = len(string_chunk) - 1
|
||||||
return offset
|
return offset
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue