mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 07:40:38 -08:00
Replace binascii and struct with native Python methods (#2582)
* refactor: replace binascii with bytes for hex conversions
Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
* refactor: replace struct unpacking with bytes conversion
Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
* simplify byte extraction for ELF header
Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
* Revert "refactor: replace struct unpacking with bytes conversion"
This reverts commit 483f8c9a85.
* update CHANGELOG
Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
---------
Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
Co-authored-by: Willi Ballenthin <wballenthin@google.com>
This commit is contained in:
@@ -36,7 +36,6 @@ Check the output window for any errors, and/or the summary of changes.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import binascii
|
||||
from pathlib import Path
|
||||
|
||||
import ida_nalt
|
||||
@@ -85,7 +84,7 @@ def main():
|
||||
#
|
||||
# see: https://github.com/idapython/bin/issues/11
|
||||
a = meta.sample.md5.lower()
|
||||
b = binascii.hexlify(ida_nalt.retrieve_input_file_md5()).decode("ascii").lower()
|
||||
b = bytes.hex(ida_nalt.retrieve_input_file_md5()).lower()
|
||||
if not a.startswith(b):
|
||||
logger.error("sample mismatch")
|
||||
return -2
|
||||
|
||||
Reference in New Issue
Block a user