fix: pull out masks from loop
This commit is contained in:
parent
0ffcc3a7f8
commit
5a9999c5c4
|
@ -80,15 +80,15 @@ def validate():
|
||||||
result_count = 0
|
result_count = 0
|
||||||
sig_addr = text.start_ea
|
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:
|
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 = idaapi.bin_search(
|
||||||
sig_addr,
|
sig_addr,
|
||||||
text.end_ea,
|
text.end_ea,
|
||||||
|
|
Loading…
Reference in New Issue