about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2012-12-12 16:20:51 +0100
committerserpilliere <devnull@localhost>2012-12-12 16:20:51 +0100
commit73b7b278452798b37524d9f2ca6c4f7d29945e14 (patch)
tree9253556f47dec439ebbadf5bc68bc649d9785fa0
parent10141478337fcc679c387e16d245b47cfc592e77 (diff)
downloadmiasm-73b7b278452798b37524d9f2ca6c4f7d29945e14.tar.gz
miasm-73b7b278452798b37524d9f2ca6c4f7d29945e14.zip
asmbloc: prettyprint hex asm_label (louis granboulan)
-rw-r--r--miasm/core/asmbloc.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/miasm/core/asmbloc.py b/miasm/core/asmbloc.py
index 324bc9d2..e3110697 100644
--- a/miasm/core/asmbloc.py
+++ b/miasm/core/asmbloc.py
@@ -59,8 +59,10 @@ class asm_label:
             self.offset = int(offset)
 
     def __str__(self):
-        out = "%s: %s"%(self.name, str(self.offset))
-        return out
+        if isinstance(self.offset, (int, long)):
+            return "%s: 0x%08x" % (self.name, self.offset)
+        else:
+            return "%s: %s" % (self.name, str(self.offset))
     def __repr__(self):
         rep = '<asmlabel '
         if self.name: