fix: pull out masks from loop

This commit is contained in:
Anna 2022-01-04 03:30:43 -05:00
parent 0ffcc3a7f8
commit 5a9999c5c4
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
1 changed files with 8 additions and 8 deletions

View File

@ -80,15 +80,15 @@ def validate():
result_count = 0
sig_addr = text.start_ea
# Expects a byte array
fmt_sig = [int(s, 16).to_bytes(1, 'little') if s != '??' else b'\0' for s in sig.split(' ')]
fmt_sig = b''.join(fmt_sig)
# Another byte array, 0 = "??" wildcard
sig_mask = [int(b != '??').to_bytes(1, 'little') for b in sig.split(' ')]
sig_mask = b''.join(sig_mask)
while True:
# Expects a byte array
fmt_sig = [int(s, 16).to_bytes(1, 'little') if s != '??' else b'\0' for s in sig.split(' ')]
fmt_sig = b''.join(fmt_sig)
# Another byte array, 0 = "??" wildcard
sig_mask = [int(b != '??').to_bytes(1, 'little') for b in sig.split(' ')]
sig_mask = b''.join(sig_mask)
sig_addr = idaapi.bin_search(
sig_addr,
text.end_ea,