about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2017-08-04 21:38:37 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2017-08-07 16:42:35 +0200
commit5bc206a9e39c3f638edaf8e262dbd9535b9ff097 (patch)
treee81122901b2e7e37a3a49915d82a92d1046cc6c1
parent4d86620428f0d12f8796c569bf026ae14ce1e72e (diff)
downloadmiasm-5bc206a9e39c3f638edaf8e262dbd9535b9ff097.tar.gz
miasm-5bc206a9e39c3f638edaf8e262dbd9535b9ff097.zip
Objc: enhance C str types
-rw-r--r--miasm2/core/objc.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/miasm2/core/objc.py b/miasm2/core/objc.py
index 3fe0e9fe..eb169040 100644
--- a/miasm2/core/objc.py
+++ b/miasm2/core/objc.py
@@ -35,7 +35,13 @@ def objc_to_str(objc, result=None):
             result += "[%d]" % objc.elems
             objc = objc.objtype
         elif isinstance(objc, ObjCPtr):
-            result = "(*%s)" % result
+            if not result and isinstance(objc.objtype, ObjCFunc):
+                result = objc.objtype.name
+            if isinstance(objc.objtype, (ObjCPtr, ObjCDecl, ObjCStruct, ObjCUnion)):
+                result = "*%s" % result
+            else:
+                result = "(*%s)" % result
+
             objc = objc.objtype
         elif isinstance(objc, (ObjCDecl, ObjCStruct, ObjCUnion)):
             if result: