Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Chris Eagle 2015-08-25 11:51:55 -07:00
commit 9396f00bfc
3 changed files with 11 additions and 1 deletions

View File

@ -122,6 +122,10 @@ void x86_reg_reset(uch handle)
switch(uc->mode) {
default:
break;
case UC_MODE_16:
env->hflags = 0;
env->cr[0] = 0;
break;
case UC_MODE_32:
env->hflags |= HF_CS32_MASK | HF_SS32_MASK | HF_OSFXSR_MASK;
env->cr[0] = CR0_PE_MASK; // protected mode

View File

@ -18,7 +18,7 @@ void cb_hookblock(uch handle, uint64_t address, uint32_t size, void *user_data)
fprintf(stderr, "not ok %d - address != 0x1000000 && address != 0x1000200\n", count++);
_exit(1);
}
fprintf(stderr, "ok %d - address (0x%x) is start of basic block\n", count++, address);
fprintf(stderr, "ok %d - address (0x%x) is start of basic block\n", count++, (uint32_t)address);
if (size != 0x200) {
fprintf(stderr, "not ok %d - basic block size != 0x200\n", count++);
_exit(1);

View File

@ -0,0 +1,6 @@
from unicorn import *
uc = Uc(UC_ARCH_X86, UC_MODE_32)
uc.mem_map(0x0000, 0x2000)
uc.mem_map(0x2000, 0x4000)
uc.mem_write(0x1000, 0x1004 * ' ')
print 'Not reached on x86_64 Linux.'