Hook breakpoint in ida7.0 failed

141 views Asked by At

I try to hook breakpoint at 0x403E65 in ida7.0, but unfortunately, it nevers reach the method DbgHook.dbg_bpt, so my hook is useless. Refer to this demo, I really don't understand what's wrong.

ida_script.py.

from idaapi import *

chunks = {}

class DbgHook(DBG_Hooks):
    def dbg_bpt(self, tid, ea):
        global chunks
        print "test"
        chunks[GetRegValue("eax")] = GetRegValue("ebx")
        continue_process()
        return 0

try:
    if debugger:
        debugger.unhook()
except Exception as e:
    pass


AddBpt(0x403E65)
debugger = DBG_Hooks()
debugger.hook()
request_start_process("C:\\Users\\win7\\Desktop\\codemap.exe", "", "")
run_requests()
1

There are 1 answers

0
SGS On

If it's an existing breakpoint which is disabled, you'll need to enable it.