Add 'annotate-usecode' command to import USECODE IR JSON annotations
- Introduced a new command 'annotate-usecode' to import USECODE IR JSON annotation hints as Ghidra comments on compiled anchors. - Added argument parsing for multiple IR JSON files, comment type selection, and a dry-run option. - Implemented logic to read annotation records from the provided IR files and set comments on the corresponding addresses in Ghidra. - Enhanced JSON schema to include response structure for the new command.
This commit is contained in:
parent
4d3c8cd81b
commit
daa363c3d2
39 changed files with 41450 additions and 871 deletions
19
_tmp_targets.py
Normal file
19
_tmp_targets.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import csv, pathlib
|
||||
p = pathlib.Path('USECODE/EUSECODE_extracted/class_event_index.tsv')
|
||||
targets = {189,190,191,272,273,283,285}
|
||||
rows = [r for r in csv.DictReader(p.open('r', encoding='utf-8'), delimiter='\t') if int(r['entry_index'], 0) in targets]
|
||||
for eid in sorted(targets):
|
||||
print(f'ENTRY {eid}')
|
||||
for r in rows:
|
||||
if int(r['entry_index'], 0) != eid:
|
||||
continue
|
||||
length = (r.get('derived_body_length') or '').strip()
|
||||
if not length:
|
||||
continue
|
||||
try:
|
||||
n = int(length, 0)
|
||||
except Exception:
|
||||
continue
|
||||
if n == 0:
|
||||
continue
|
||||
print(f" slot {r['slot']} {r['event_name_hint']}: start={r['derived_body_start']} end={r['derived_body_end']} len={r['derived_body_length']} raw={r['raw_event_entry_word']} template={r.get('repeated_template_status','')}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue