diff options
Diffstat (limited to '')
| -rw-r--r-- | miasm/arch/ia32_sem.py | 17 | ||||
| -rw-r--r-- | miasm/tools/win_api.py | 6 |
2 files changed, 19 insertions, 4 deletions
diff --git a/miasm/arch/ia32_sem.py b/miasm/arch/ia32_sem.py index 6870639d..af8ee7b3 100644 --- a/miasm/arch/ia32_sem.py +++ b/miasm/arch/ia32_sem.py @@ -20,8 +20,23 @@ from miasm.arch.ia32_reg import * from miasm.arch.ia32_arch import * import math +# interrupt with eip update after instr +EXCEPT_CODE_AUTOMOD = (1<<0) EXCEPT_SOFT_BP = (1<<1) -EXCEPT_PRIV_INSN = 1<<7 + +EXCEPT_BREAKPOINT_INTERN = (1<<2) + +EXCEPT_NUM_UDPT_EIP = (1<<5) +# interrupt with eip at instr +EXCEPT_UNK_MEM_AD = (1<<6) +EXCEPT_THROW_SEH = (1<<7) +EXCEPT_UNK_EIP = (1<<8) +EXCEPT_ACCESS_VIOL = (1<<9) +EXCEPT_INT_DIV_BY_ZERO = (1<<10) +EXCEPT_PRIV_INSN = (1<<11) +EXCEPT_ILLEGAL_INSN = (1<<12) + + reg_eax = 'eax' reg_ebx = 'ebx' reg_ecx = 'ecx' diff --git a/miasm/tools/win_api.py b/miasm/tools/win_api.py index 95ff4d5d..97521486 100644 --- a/miasm/tools/win_api.py +++ b/miasm/tools/win_api.py @@ -33,8 +33,8 @@ import time def get_next_alloc_addr(size): global alloc_ad ret = winobjs.alloc_ad - winobjs.alloc_ad = (winobjs.alloc_ad + size + winobjs.alloc_align) - winobjs.alloc_ad &= (0xffffffff ^ winobjs.alloc_align) + winobjs.alloc_ad = (winobjs.alloc_ad + size + winobjs.alloc_align-1) + winobjs.alloc_ad &= (0xffffffff ^ (winobjs.alloc_align-1)) return ret """ @@ -109,7 +109,7 @@ class handle_generator(): class c_winobjs: def __init__(self): self.alloc_ad = 0x20000000 - self.alloc_align = 0x4000-1 + self.alloc_align = 0x4000 self.handle_toolhelpsnapshot = 0xaaaa00 self.toolhelpsnapshot_info = {} self.handle_curprocess = 0xaaaa01 |