Merge pull request #639 from esanfelix/master

Fixed ARM sample to properly run THUMB code #638
This commit is contained in:
Nguyen Anh Quynh 2016-09-20 20:07:47 +08:00 committed by GitHub
commit 5092bb11f1
2 changed files with 4 additions and 2 deletions

View file

@ -85,7 +85,8 @@ def test_thumb():
mu.hook_add(UC_HOOK_CODE, hook_code) mu.hook_add(UC_HOOK_CODE, hook_code)
# emulate machine code in infinite time # emulate machine code in infinite time
mu.emu_start(ADDRESS, ADDRESS + len(THUMB_CODE)) # Note we start at ADDRESS | 1 to indicate THUMB mode.
mu.emu_start(ADDRESS | 1, ADDRESS + len(THUMB_CODE))
# now print out some registers # now print out some registers
print(">>> Emulation done. Below is the CPU context") print(">>> Emulation done. Below is the CPU context")

View file

@ -135,7 +135,8 @@ static void test_thumb(void)
// emulate machine code in infinite time (last param = 0), or when // emulate machine code in infinite time (last param = 0), or when
// finishing all the code. // finishing all the code.
err = uc_emu_start(uc, ADDRESS, ADDRESS + sizeof(THUMB_CODE) -1, 0, 0); // Note we start at ADDRESS | 1 to indicate THUMB mode.
err = uc_emu_start(uc, ADDRESS | 1, ADDRESS + sizeof(THUMB_CODE) -1, 0, 0);
if (err) { if (err) {
printf("Failed on uc_emu_start() with error returned: %u\n", err); printf("Failed on uc_emu_start() with error returned: %u\n", err);
} }