From 548355acca90bc8c9151533c478b85208570b28a Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Fri, 11 Sep 2015 14:02:27 +0800 Subject: [PATCH] sparc: do not accept BIGENDIAN mode in samples. more sanity check should be done in the core --- bindings/java/samples/Sample_sparc.java | 2 +- bindings/python/sample_sparc.py | 2 +- regress/sparc_reg.py | 2 +- samples/sample_sparc.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/java/samples/Sample_sparc.java b/bindings/java/samples/Sample_sparc.java index 60735d96..60298979 100644 --- a/bindings/java/samples/Sample_sparc.java +++ b/bindings/java/samples/Sample_sparc.java @@ -76,7 +76,7 @@ public class Sample_sparc { System.out.print("Emulate SPARC code\n"); // Initialize emulator in Sparc mode - Unicorn u = new Unicorn(Unicorn.UC_ARCH_SPARC, Unicorn.UC_MODE_BIG_ENDIAN); + Unicorn u = new Unicorn(Unicorn.UC_ARCH_SPARC, Unicorn.UC_MODE_32); // map 2MB memory for this emulation u.mem_map(ADDRESS, 2 * 1024 * 1024, Unicorn.UC_PROT_ALL); diff --git a/bindings/python/sample_sparc.py b/bindings/python/sample_sparc.py index c1a4a4d9..307ba936 100755 --- a/bindings/python/sample_sparc.py +++ b/bindings/python/sample_sparc.py @@ -28,7 +28,7 @@ def test_sparc(): print("Emulate SPARC code") try: # Initialize emulator in SPARC EB mode - mu = Uc(UC_ARCH_SPARC, UC_MODE_BIG_ENDIAN) + mu = Uc(UC_ARCH_SPARC, UC_MODE_32) # map 2MB memory for this emulation mu.mem_map(ADDRESS, 2 * 1024 * 1024) diff --git a/regress/sparc_reg.py b/regress/sparc_reg.py index 0857d671..73858360 100755 --- a/regress/sparc_reg.py +++ b/regress/sparc_reg.py @@ -3,7 +3,7 @@ from unicorn import * from unicorn.sparc_const import * -uc = Uc(UC_ARCH_SPARC, UC_MODE_BIG_ENDIAN) +uc = Uc(UC_ARCH_SPARC, UC_MODE_32) uc.reg_write(UC_SPARC_REG_SP, 100) uc.reg_write(UC_SPARC_REG_FP, 100) print 'writing sp = 100, fp = 100' diff --git a/samples/sample_sparc.c b/samples/sample_sparc.c index 2cdc4915..3f253ff1 100644 --- a/samples/sample_sparc.c +++ b/samples/sample_sparc.c @@ -38,7 +38,7 @@ static void test_sparc(void) printf("Emulate SPARC code\n"); // Initialize emulator in Sparc mode - err = uc_open(UC_ARCH_SPARC, UC_MODE_BIG_ENDIAN, &uc); + err = uc_open(UC_ARCH_SPARC, UC_MODE_32, &uc); if (err) { printf("Failed on uc_open() with error returned: %u (%s)\n", err, uc_strerror(err));