From fce82b9532df559b148bae8a5ca86c247ddb7dbc Mon Sep 17 00:00:00 2001 From: esanfelix Date: Tue, 20 Sep 2016 10:15:58 +0200 Subject: [PATCH] Fixed ARM sample to properly run THUMB code #638 --- samples/sample_arm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/sample_arm.c b/samples/sample_arm.c index 2c69ce6a..fc3570ec 100644 --- a/samples/sample_arm.c +++ b/samples/sample_arm.c @@ -135,7 +135,8 @@ static void test_thumb(void) // emulate machine code in infinite time (last param = 0), or when // 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) { printf("Failed on uc_emu_start() with error returned: %u\n", err); }