Commit c5483b02 authored by George Hotz's avatar George Hotz

simpler repro

parent 1b4f80f7
...@@ -10,22 +10,22 @@ import ( ...@@ -10,22 +10,22 @@ import (
) )
func TestUnicornCrash(t *testing.T) { func TestUnicornCrash(t *testing.T) {
fn := "../mipigo/test/test.bin"
ram := make(map[uint32](uint32))
root := "/tmp/cannon/0_13284469" root := "/tmp/cannon/0_13284469"
mu, err := uc.NewUnicorn(uc.ARCH_MIPS, uc.MODE_32|uc.MODE_BIG_ENDIAN) mu, err := uc.NewUnicorn(uc.ARCH_MIPS, uc.MODE_32|uc.MODE_BIG_ENDIAN)
check(err) check(err)
// program // program
dat, _ := ioutil.ReadFile(fn) fn := "../mipigo/test/test.bin"
dat, err := ioutil.ReadFile(fn)
check(err)
mu.MemWrite(0, dat) mu.MemWrite(0, dat)
// inputs // inputs
inputs, _ := ioutil.ReadFile(fmt.Sprintf("%s/input", root)) inputs, _ := ioutil.ReadFile(fmt.Sprintf("%s/input", root))
mu.MemWrite(0x30000000, inputs[0:0xc0]) mu.MemWrite(0x30000000, inputs[0:0xc0])
// load into ram // load into ram, without this (completely unrelated), it doesn't crash
ram := make(map[uint32](uint32))
for i := 0; i < len(dat); i += 4 { for i := 0; i < len(dat); i += 4 {
value := binary.BigEndian.Uint32(dat[i : i+4]) value := binary.BigEndian.Uint32(dat[i : i+4])
if value != 0 { if value != 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment