sparc: do not accept BIGENDIAN mode in samples. more sanity check should be done in the core
This commit is contained in:
parent
b306fa65bd
commit
548355acca
@ -76,7 +76,7 @@ public class Sample_sparc {
|
|||||||
System.out.print("Emulate SPARC code\n");
|
System.out.print("Emulate SPARC code\n");
|
||||||
|
|
||||||
// Initialize emulator in Sparc mode
|
// 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
|
// map 2MB memory for this emulation
|
||||||
u.mem_map(ADDRESS, 2 * 1024 * 1024, Unicorn.UC_PROT_ALL);
|
u.mem_map(ADDRESS, 2 * 1024 * 1024, Unicorn.UC_PROT_ALL);
|
||||||
|
@ -28,7 +28,7 @@ def test_sparc():
|
|||||||
print("Emulate SPARC code")
|
print("Emulate SPARC code")
|
||||||
try:
|
try:
|
||||||
# Initialize emulator in SPARC EB mode
|
# 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
|
# map 2MB memory for this emulation
|
||||||
mu.mem_map(ADDRESS, 2 * 1024 * 1024)
|
mu.mem_map(ADDRESS, 2 * 1024 * 1024)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
from unicorn import *
|
from unicorn import *
|
||||||
from unicorn.sparc_const 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_SP, 100)
|
||||||
uc.reg_write(UC_SPARC_REG_FP, 100)
|
uc.reg_write(UC_SPARC_REG_FP, 100)
|
||||||
print 'writing sp = 100, fp = 100'
|
print 'writing sp = 100, fp = 100'
|
||||||
|
@ -38,7 +38,7 @@ static void test_sparc(void)
|
|||||||
printf("Emulate SPARC code\n");
|
printf("Emulate SPARC code\n");
|
||||||
|
|
||||||
// Initialize emulator in Sparc mode
|
// 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) {
|
if (err) {
|
||||||
printf("Failed on uc_open() with error returned: %u (%s)\n",
|
printf("Failed on uc_open() with error returned: %u (%s)\n",
|
||||||
err, uc_strerror(err));
|
err, uc_strerror(err));
|
||||||
|
Loading…
Reference in New Issue
Block a user