summaryrefslogtreecommitdiff
path: root/python/__init__.py
diff options
context:
space:
mode:
authorplafosse <peter@vector35.com>2016-08-25 00:22:43 +0100
committerplafosse <peter@vector35.com>2016-10-09 13:53:16 -0400
commit1584c0f2ae591eafe6b69a9d663dbff4d32beaff (patch)
tree618575b223e3125b7250759e0a36f1d86d1e67f2 /python/__init__.py
parent55ac7a184b7956c0c2e2ca41d512e7c4a81267d9 (diff)
adding gnu3 demangler apis
Diffstat (limited to 'python/__init__.py')
-rw-r--r--python/__init__.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 26c8fb5d..f5a46798 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -4151,6 +4151,10 @@ class Type(object):
return Type(core.BNCreateUnknownType(unknown_type.handle))
@classmethod
+ def unknown_type(self, s):
+ return Type(core.BNCreateUnknownType(s.handle))
+
+ @classmethod
def enumeration_type(self, arch, e, width = None):
if width is None:
width = arch.default_int_size
@@ -10839,6 +10843,21 @@ def demangle_ms(arch, mangled_name):
names.append(outName[i])
#core.BNFreeDemangledName(outName.value, outSize.value)
return (Type(handle), names)
+ return (None, mangledName)
+
+
+def demangle_gnu3(arch, mangledName):
+ handle = ctypes.POINTER(core.BNType)()
+ outName = ctypes.POINTER(ctypes.c_char_p)()
+ outSize = ctypes.c_ulonglong()
+ names = []
+ if core.BNDemangleGNU3(arch.handle, mangledName, ctypes.byref(handle), ctypes.byref(outName), ctypes.byref(outSize)):
+ for i in xrange(outSize.value):
+ names.append(outName[i])
+ #core.BNFreeDemangledName(outName.value, outSize.value)
+ if not handle:
+ return (None, names)
+ return (Type(handle), names)
return (None, mangled_name)