Commit 69791851 authored by George Hotz's avatar George Hotz

faster if we don't syncregs each time

parent 55b44daa
......@@ -51,6 +51,7 @@ func TestCompareUnicornEvm(t *testing.T) {
uniram := make(map[uint32](uint32))
ministart := time.Now()
go RunUnicorn(fn, uniram, false, func(step int, mu uc.Unicorn, ram map[uint32](uint32)) {
SyncRegs(mu, ram)
cuni <- RegSerialize(ram)
done.Lock()
done.Unlock()
......
......@@ -23,6 +23,7 @@ func main() {
lastStep := 0
mu := GetHookedUnicorn(root, ram, func(step int, mu uc.Unicorn, ram map[uint32](uint32)) {
if step%1000000 == 0 {
SyncRegs(mu, ram)
WriteCheckpoint(ram, root, step)
}
lastStep = step
......
......@@ -149,7 +149,6 @@ func GetHookedUnicorn(root string, ram map[uint32](uint32), callback func(int, u
}, 0, 0x80000000)
mu.HookAdd(uc.HOOK_CODE, func(mu uc.Unicorn, addr uint64, size uint32) {
SyncRegs(mu, ram)
callback(steps, mu, ram)
steps += 1
}, 0, 0x80000000)
......
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