about summary refs log tree commit diff stats
path: root/miasm2/arch/x86
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2017-06-02 16:16:12 +0200
committerGitHub <noreply@github.com>2017-06-02 16:16:12 +0200
commitb772f2d9c7aceb7d1ca87cdefd708d4f65d71623 (patch)
tree137332a3b8a0a9124eca2a9ef54bf79abcac7e46 /miasm2/arch/x86
parentdb9c8ea88376eb62f178829151b6a272b068b39d (diff)
parent37a45a885ede52c22f46b1d699921c85d44a6646 (diff)
downloadmiasm-b772f2d9c7aceb7d1ca87cdefd708d4f65d71623.tar.gz
miasm-b772f2d9c7aceb7d1ca87cdefd708d4f65d71623.zip
Merge pull request #565 from serpilliere/objc_padding
Objc padding
Diffstat (limited to 'miasm2/arch/x86')
-rw-r--r--miasm2/arch/x86/ctype.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/miasm2/arch/x86/ctype.py b/miasm2/arch/x86/ctype.py
index 0d8cd924..5e16f945 100644
--- a/miasm2/arch/x86/ctype.py
+++ b/miasm2/arch/x86/ctype.py
@@ -1,10 +1,12 @@
-from miasm2.core.objc import CLeafTypes, ObjCDecl
+from miasm2.core.objc import CLeafTypes, ObjCDecl, PADDING_TYPE_NAME
 from miasm2.core.ctypesmngr import CTypeId, CTypePtr
 
 
 class CTypeAMD64_unk(CLeafTypes):
     """Define C types sizes/alignement for x86_64 architecture"""
 
+    obj_pad = ObjCDecl(PADDING_TYPE_NAME, 1, 1) # __padding__ is size 1/align 1
+
     obj_char = ObjCDecl("char", 1, 1)
     obj_short = ObjCDecl("short", 2, 2)
     obj_int = ObjCDecl("int", 4, 4)
@@ -25,6 +27,8 @@ class CTypeAMD64_unk(CLeafTypes):
 
     def __init__(self):
         self.types = {
+            CTypeId(PADDING_TYPE_NAME): self.obj_pad,
+
             CTypeId('char'): self.obj_char,
             CTypeId('short'): self.obj_short,
             CTypeId('int'): self.obj_int,
@@ -68,7 +72,9 @@ class CTypeAMD64_unk(CLeafTypes):
 
 
 class CTypeX86_unk(CLeafTypes):
-    """Define C types sizes/alignement for x86_64 architecture"""
+    """Define C types sizes/alignement for x86_32 architecture"""
+
+    obj_pad = ObjCDecl(PADDING_TYPE_NAME, 1, 1) # __padding__ is size 1/align 1
 
     obj_char = ObjCDecl("char", 1, 1)
     obj_short = ObjCDecl("short", 2, 2)
@@ -90,6 +96,8 @@ class CTypeX86_unk(CLeafTypes):
 
     def __init__(self):
         self.types = {
+            CTypeId(PADDING_TYPE_NAME): self.obj_pad,
+
             CTypeId('char'): self.obj_char,
             CTypeId('short'): self.obj_short,
             CTypeId('int'): self.obj_int,