diff options
| author | Louis <louis@losynix.net> | 2019-09-30 09:51:35 +0200 |
|---|---|---|
| committer | Louis <louis@losynix.net> | 2019-09-30 09:51:35 +0200 |
| commit | 880a1a345a4378b5a783dadaf7d33c9a434f610c (patch) | |
| tree | d748e35fb4476a7edcca85b0516b18b3be77922f /example | |
| parent | 469babfe67688163429d2595705aac5462b7758f (diff) | |
| download | miasm-880a1a345a4378b5a783dadaf7d33c9a434f610c.tar.gz miasm-880a1a345a4378b5a783dadaf7d33c9a434f610c.zip | |
fix int 1 handling
Diffstat (limited to 'example')
| -rw-r--r-- | example/jitter/test_x86_32_seh.py | 4 | ||||
| -rw-r--r-- | example/samples/x86_32_seh.S | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/example/jitter/test_x86_32_seh.py b/example/jitter/test_x86_32_seh.py index 595b9586..d29d3a22 100644 --- a/example/jitter/test_x86_32_seh.py +++ b/example/jitter/test_x86_32_seh.py @@ -24,6 +24,9 @@ def deal_exception_illegal_instruction(jitter): jitter.pc = win_api_x86_32_seh.fake_seh_handler(jitter, win_api_x86_32_seh.EXCEPTION_ILLEGAL_INSTRUCTION) return True +def deal_exception_single_step(jitter): + jitter.pc = win_api_x86_32_seh.fake_seh_handler(jitter, win_api_x86_32_seh.EXCEPTION_SINGLE_STEP) + return True def return_from_seh(jitter): win_api_x86_32_seh.return_from_seh(jitter) @@ -47,6 +50,7 @@ sb.jitter.add_exception_handler(EXCEPT_SOFT_BP, deal_exception_breakpoint) sb.jitter.add_exception_handler(EXCEPT_DIV_BY_ZERO, deal_exception_div) sb.jitter.add_exception_handler(1<<17, deal_exception_privileged_instruction) sb.jitter.add_exception_handler(EXCEPT_UNK_MNEMO, deal_exception_illegal_instruction) +sb.jitter.add_exception_handler(EXCEPT_INT_1, deal_exception_single_step) sb.jitter.add_breakpoint(win_api_x86_32_seh.return_from_exception, return_from_seh) diff --git a/example/samples/x86_32_seh.S b/example/samples/x86_32_seh.S index 7bb2c3cd..a637cccf 100644 --- a/example/samples/x86_32_seh.S +++ b/example/samples/x86_32_seh.S @@ -41,6 +41,12 @@ lbl_err_end4: ADD ESP, 4 RET +;; Single step +lbl_err_5: + INT 0x1 +lbl_err_end5: + NOP + error: MOV ECX, DWORD PTR [ESP+0xC] MOV EAX, DWORD PTR [ECX+0xB8] @@ -66,6 +72,7 @@ labels_err: .dword lbl_err_2 .dword lbl_err_3 .dword lbl_err_4 +.dword lbl_err_5 labels_err_end: @@ -74,3 +81,4 @@ labels_err_end: .dword lbl_err_end2 .dword lbl_err_end3 .dword lbl_err_end4 +.dword lbl_err_end5 |