diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-08-04 21:38:37 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-08-07 16:42:35 +0200 |
| commit | 5bc206a9e39c3f638edaf8e262dbd9535b9ff097 (patch) | |
| tree | e81122901b2e7e37a3a49915d82a92d1046cc6c1 | |
| parent | 4d86620428f0d12f8796c569bf026ae14ce1e72e (diff) | |
| download | miasm-5bc206a9e39c3f638edaf8e262dbd9535b9ff097.tar.gz miasm-5bc206a9e39c3f638edaf8e262dbd9535b9ff097.zip | |
Objc: enhance C str types
| -rw-r--r-- | miasm2/core/objc.py | 8 |
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: |