about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2012-06-26 13:45:00 +0200
committerserpilliere <devnull@localhost>2012-06-26 13:45:00 +0200
commit04821c88e1c582b831ae24b408c996292680c545 (patch)
tree5b9369bde92af17bea1dee002bfc5d86b07fc289
parent408e6a88ef7ea6580fe04087bbb56a39832187a2 (diff)
downloadmiasm-04821c88e1c582b831ae24b408c996292680c545.tar.gz
miasm-04821c88e1c582b831ae24b408c996292680c545.zip
arch_ia32: add push/pop fs/gs
-rw-r--r--miasm/arch/ia32_arch.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/miasm/arch/ia32_arch.py b/miasm/arch/ia32_arch.py
index 8672b447..39e47781 100644
--- a/miasm/arch/ia32_arch.py
+++ b/miasm/arch/ia32_arch.py
@@ -128,8 +128,10 @@ r_es = 'es'
 r_ss = 'ss'
 r_cs = 'cs'
 r_ds = 'ds'
+r_fs = 'fs'
+r_gs = 'gs'
 
-segm_regs = [r_es, r_ss, r_cs, r_ds]
+segm_regs = [r_es, r_ss, r_cs, r_ds, r_fs, r_gs]
 
 w8 = "w8"
 se = "se"
@@ -920,6 +922,11 @@ class x86allmncs:
         addop("pop",   [0x17],             noafs, [r_ss]        , {}                 ,{sg:True,}        , {},                         )
         addop("pop",   [0x1f],             noafs, [r_ds]        , {}                 ,{sg:True,}        , {},                         )
 
+
+        addop("pop",[0x0F, 0xa1],         noafs, [r_fs]        , {}                 ,{sg:True,}        , {},                         )
+        addop("pop",[0x0F, 0xa9],         noafs, [r_gs]        , {}                 ,{sg:True,}        , {},                         )
+
+
         addop("prefetch",[0x0F, 0x18],     d0   , no_rm         , {}                 ,{}                , {},                         )
         addop("prefetch",[0x0F, 0x18],     d1   , no_rm         , {}                 ,{}                , {},                         )
         addop("prefetch",[0x0F, 0x18],     d2   , no_rm         , {}                 ,{}                , {},                         )
@@ -935,6 +942,9 @@ class x86allmncs:
         addop("push",  [0x16],             noafs, [r_ss]        , {}                 ,{sg:True,}        , {},                         )
         addop("push",  [0x1E],             noafs, [r_ds]        , {}                 ,{sg:True,}        , {},                         )
 
+        addop("push",[0x0F, 0xa0],         noafs, [r_fs]        , {}                 ,{sg:True,}        , {},                         )
+        addop("push",[0x0F, 0xa8],         noafs, [r_gs]        , {}                 ,{sg:True,}        , {},                         )
+
         addop("rcl",   [0xD0],             d2   , [im1]         , {w8:(0,0)}         ,{}                , {},                         )
         addop("rcl",   [0xD2],             d2   , [r_cl]        , {w8:(0,0)}         ,{}                , {},                         )
         addop("rcl",   [0xC0],             d2   , [u08]         , {w8:(0,0)}         ,{}                , {},                         )
@@ -2269,6 +2279,16 @@ if __name__ == '__main__':
     test_out = []
     log.setLevel(logging.DEBUG)
 
+    instr = x86mnemo.dis('0fa9'.replace(' ', '').decode('hex'),
+                         admode=x86_afs.u16,
+                         opmode=x86_afs.u16)
+    print instr
+    print instr.arg
+    print instr.l
+    print instr.opmode, instr.admode
+    fds
+
+
     instr = x86mnemo.dis('ea21060000'.replace(' ', '').decode('hex'),
                          admode=x86_afs.u16,
                          opmode=x86_afs.u16)