Skip to content

Instantly share code, notes, and snippets.

View justingarrick's full-sized avatar

Justin Garrick justingarrick

View GitHub Profile
@justingarrick
justingarrick / Demangle Swift.py
Created October 5, 2015 13:20 — forked from steventroughtonsmith/Demangle Swift.py
Hopper Swift demangler
import subprocess
def looksLikeBeginning(doc,seg,adr):
if doc.is64Bits() and seg.readByte(adr) == 0x55 and seg.readByte(adr + 1) == 0x48 and seg.readByte(adr + 2) == 0x89 and seg.readByte(adr + 3) == 0xE5:
return True
if not doc.is64Bits() and seg.readByte(adr) == 0x55 and seg.readByte(adr + 1) == 0x89 and seg.readByte(adr + 2) == 0xE5:
return True
return False
doc = Document.getCurrentDocument()