Skip to content

Commit

Permalink
latest minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Zateryukin committed Feb 11, 2024
1 parent 983a6b3 commit 150fac9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions json2idc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def read_segments_map(file_name):
lines = f.read().splitlines()
for line in lines:
m = re.match(
r"^\s+(?P<segment>[0-9A-F]{8}):(?P<offset>[0-9A-F]{8})\s+(?P<name>\S+)",
r'^\s*MakeName\s*\(\s*(?P<address>[0-9A-Fa-fXx]+)\s*,\s*"(?P<name>\S+)"\s*\)\s*;',
line)
if m:
name = m["name"]
if all(not name.startswith(x) for x in {"sub_", "loc_", "locret_", "byte_", "word_", "dword_", "start"}):
symbols[name] = (ida_load_seg + int(m["segment"], 16)) * 0x10 + int(m["offset"], 16)
if all(not name.startswith(x) for x in {"sub_", "loc_", "locret_", "byte_", "word_", "dword_"}):
symbols[m["address"]] = name
return symbols

json_fname = sys.argv[1]
Expand Down

0 comments on commit 150fac9

Please sign in to comment.