about summary refs log tree commit diff stats
path: root/test/arch/x86/qemu/testqemu.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2016-04-26 18:08:43 +0200
committerAjax <commial@gmail.com>2016-04-26 18:08:43 +0200
commita536dc45a6149d565632eadea3422cd310f197ce (patch)
tree8ecc908dc1f2bceb02fbb86b2531cc52b640e4dd /test/arch/x86/qemu/testqemu.py
parentcc5963091971b2cf2bb4ea57210994ad43eb3b43 (diff)
downloadmiasm-a536dc45a6149d565632eadea3422cd310f197ce.tar.gz
miasm-a536dc45a6149d565632eadea3422cd310f197ce.zip
QEMU test: add a GS segment in test script
Diffstat (limited to 'test/arch/x86/qemu/testqemu.py')
-rw-r--r--test/arch/x86/qemu/testqemu.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/arch/x86/qemu/testqemu.py b/test/arch/x86/qemu/testqemu.py
index a7df4fe4..65d5825a 100644
--- a/test/arch/x86/qemu/testqemu.py
+++ b/test/arch/x86/qemu/testqemu.py
@@ -6,6 +6,7 @@ from pdb import pm
 
 from miasm2.analysis.sandbox import Sandbox_Linux_x86_32
 from miasm2.jitter.jitload import log_func
+from miasm2.jitter.csts import PAGE_READ, PAGE_WRITE
 from miasm2.os_dep.win_api_x86_32 import get_str_ansi, upck32
 
 # Utils
@@ -126,6 +127,12 @@ except AttributeError:
 
 log_func.setLevel(logging.ERROR)
 
+# Segmentation
+sb.jitter.cpu.set_segm_base(8, 0x7fff0000)
+sb.jitter.cpu.GS = 8
+sb.jitter.vm.add_memory_page(0x7fff0000 + 0x14, PAGE_READ | PAGE_WRITE, "AAAA")
+
+
 # Run
 sb.run(addr)