Skip to content

Instantly share code, notes, and snippets.

@landonepps
Last active December 19, 2023 04:59
Show Gist options
  • Save landonepps/6be05dc2a2487a07d915f18c27ce33de to your computer and use it in GitHub Desktop.
Save landonepps/6be05dc2a2487a07d915f18c27ce33de to your computer and use it in GitHub Desktop.
Import ETSymbolication Symbols into Hopper
import csv
doc = Document.getCurrentDocument()
path = Document.askFile("Symbols CSV file", None, False)
if path is not None:
with open(path) as csvfile:
csvreader = csv.reader(csvfile, delimiter=",", quotechar="\"")
for i, parts in enumerate(csvreader):
if len(parts) > 2:
address = int(parts[1].split(",")[0].lstrip("[0x"), 16)
name = parts[2]
seg = doc.getSegmentAtAddress(address)
if seg is not None:
seg.setNameAtAddress(address, name)
else:
print("No segment for 0x" + str(address) + "; unable to set name for " + name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment