From 0e52b913e772f4e27c8c6877342fb308e1f7b031 Mon Sep 17 00:00:00 2001 From: Tim Blazytko Date: Sun, 24 Apr 2016 11:47:04 +0200 Subject: [PATCH] added regression test write_before_map.py --- tests/regress/write_before_map.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/regress/write_before_map.py diff --git a/tests/regress/write_before_map.py b/tests/regress/write_before_map.py new file mode 100644 index 00000000..7bdb1e45 --- /dev/null +++ b/tests/regress/write_before_map.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +from __future__ import print_function +from unicorn import * +from unicorn.x86_const import * + +import regress + +X86_CODE64 = "\x90" # NOP + + +class WriteBeforeMap(regress.RegressTest): + def runTest(self): + # Initialize emulator in X86-32bit mode + mu = Uc(UC_ARCH_X86, UC_MODE_64) + + # memory address where emulation starts + ADDRESS = 0x1000000 + + # write machine code to be emulated to memory + mu.mem_write(ADDRESS, X86_CODE64) + + +if __name__ == '__main__': + regress.main()