diff --git a/bindings/python/unicorn/unicorn.py b/bindings/python/unicorn/unicorn.py index aef9d99..7b592a7 100644 --- a/bindings/python/unicorn/unicorn.py +++ b/bindings/python/unicorn/unicorn.py @@ -206,6 +206,7 @@ class Uc(object): except: # _uc might be pulled from under our feet pass + # emulate from @begin, and stop when reaching address @until def emu_start(self, begin, until, timeout=0, count=0): status = _uc.uc_emu_start(self._uch, begin, until, timeout, count) diff --git a/include/unicorn/x86.h b/include/unicorn/x86.h index 8855973..fe33c72 100644 --- a/include/unicorn/x86.h +++ b/include/unicorn/x86.h @@ -74,7 +74,7 @@ typedef enum uc_x86_reg { UC_X86_REG_R14D, UC_X86_REG_R15D, UC_X86_REG_R8W, UC_X86_REG_R9W, UC_X86_REG_R10W, UC_X86_REG_R11W, UC_X86_REG_R12W, UC_X86_REG_R13W, UC_X86_REG_R14W, UC_X86_REG_R15W, UC_X86_REG_IDTR, UC_X86_REG_GDTR, UC_X86_REG_LDTR, UC_X86_REG_TR, UC_X86_REG_FPCW, - UC_X86_REG_FPTAG, + UC_X86_REG_FPTAG, UC_X86_REG_ENDING // <-- mark the end of the list of registers } uc_x86_reg; diff --git a/qemu/target-i386/unicorn.c b/qemu/target-i386/unicorn.c index 4b285f9..106266f 100644 --- a/qemu/target-i386/unicorn.c +++ b/qemu/target-i386/unicorn.c @@ -152,7 +152,7 @@ int x86_reg_read(struct uc_struct *uc, unsigned int regid, void *value) case UC_X86_REG_FPSW: { uint16_t fpus = X86_CPU(uc, mycpu)->env.fpus; - fpus = fpus & ~0x3800; + fpus = fpus & ~0x3800; fpus |= ( X86_CPU(uc, mycpu)->env.fpstt & 0x7 ) << 11; *(uint16_t*) value = fpus; } @@ -629,9 +629,8 @@ int x86_reg_write(struct uc_struct *uc, unsigned int regid, const void *value) break; case UC_X86_REG_FP0 ... UC_X86_REG_FP7: { - //floatx80 cpu_set_fp80(uint64_t mant, uint16_t upper); uint64_t mant = *(uint64_t*) value; - uint16_t upper = *(uint16_t*) (value+sizeof(uint64_t)); + uint16_t upper = *(uint16_t*) (value + sizeof(uint64_t)); X86_CPU(uc, mycpu)->env.fpregs[regid - UC_X86_REG_FP0].d = cpu_set_fp80(mant, upper); } break; @@ -654,7 +653,8 @@ int x86_reg_write(struct uc_struct *uc, unsigned int regid, const void *value) fptag >>= 2; } } - } + break; + } switch(uc->mode) { default: