fix the qiradb to memcommit loads

This commit is contained in:
George Hotz 2014-09-23 19:13:15 -04:00
parent 47be12c76f
commit 9b8ab29d26
4 changed files with 17 additions and 14 deletions

View File

@ -30,6 +30,7 @@ WITH_IDA = False
try: try:
from r2.r_core import RCore from r2.r_core import RCore
WITH_RADARE = True WITH_RADARE = True
WITH_STATIC = True
except: except:
WITH_RADARE = False WITH_RADARE = False

View File

@ -1 +1 @@
1.1 1.2

View File

@ -203,19 +203,21 @@ void Trace::process() {
} }
if (type == 'S') { if (type == 'S') {
pages_[c->address & PAGE_MASK] |= PAGE_WRITE; pages_[c->address & PAGE_MASK] |= PAGE_WRITE;
int byte_count = (c->flags&SIZE_MASK)/8; }
uint64_t data = c->data;
if (is_big_endian_) { // no harm in doing the memory commit every time there's a load, right?
for (int i = byte_count-1; i >= 0; --i) { int byte_count = (c->flags&SIZE_MASK)/8;
commit_memory(c->clnum, c->address+i, data&0xFF); uint64_t data = c->data;
data >>= 8; if (is_big_endian_) {
} for (int i = byte_count-1; i >= 0; --i) {
} else { commit_memory(c->clnum, c->address+i, data&0xFF);
// little endian data >>= 8;
for (int i = 0; i < byte_count; i++) { }
commit_memory(c->clnum, c->address+i, data&0xFF); } else {
data >>= 8; // little endian
} for (int i = 0; i < byte_count; i++) {
commit_memory(c->clnum, c->address+i, data&0xFF);
data >>= 8;
} }
} }
} }