def add(self, description, address=0, force=0, timeout=0, mode=0): """Add hook to Immunity Debugger hook database @param type: Type of hook @param desc: Descriptive string @param force: Force hook adding @param timeout: time to live in memory @param mode: thread mode of ttl execution """ self.desc = description self.address = address self.force = force self.timeout = timeout # mode = 1 then, execute ttl hook in the same thread enviroment as the python command/script # mode = 0 use your own thread enviroment to place and execute the ttl hook # you'll be using mode = 0 at least you really know what you are doing. self.mode = mode if self.type == HookTypes["ORDINARY_BP_HOOK"]: debugger.set_breakpoint(self.address, 0x200L, "") elif self.type == HookTypes["LOG_BP_HOOK"]: debugger.set_logging_breakpoint(self.address) pickled_object = pickle.dumps(self) return debugger.add_hook(pickled_object, self.desc, self.type, self.address, self.force, self.timeout, self.mode)
def add2(self, description, address = 0, replace = True): if self.type == HookTypes["ORDINARY_BP_HOOK"]: debugger.set_breakpoint(address,0x200L,"") elif self.type == HookTypes["LOG_BP_HOOK"]: debugger.set_logging_breakpoint(address) self.desc = description self.address = address self.replace = replace self.descdict[address] = description return debugger.AddHook(self, self.check_run, self.desc, self.type, self.address, self.replace)
def add2(self, description, address=0, replace=False): if self.type == HookTypes["ORDINARY_BP_HOOK"]: debugger.set_breakpoint(address, 0x200L, "") elif self.type == HookTypes["LOG_BP_HOOK"]: debugger.set_logging_breakpoint(address) self.desc = description self.address = address self.replace = replace self.descdict[address] = description return debugger.AddHook(self, self.check_run, self.desc, self.type, self.address, self.replace)
def add(self,description,address=0,force=0,timeout=0,mode=0): """Add hook to Immunity Debugger hook database @param type: Type of hook @param desc: Descriptive string @param force: Force hook adding @param timeout: time to live in memory @param mode: thread mode of ttl execution """ self.desc = description self.address = address self.force=force self.timeout=timeout # mode = 1 then, execute ttl hook in the same thread enviroment as the python command/script # mode = 0 use your own thread enviroment to place and execute the ttl hook # you'll be using mode = 0 at least you really know what you are doing. self.mode=mode if self.type == HookTypes["ORDINARY_BP_HOOK"]: debugger.set_breakpoint(self.address,0x200L,"") elif self.type == HookTypes["LOG_BP_HOOK"]: debugger.set_logging_breakpoint(self.address) pickled_object = pickle.dumps(self) return debugger.add_hook( pickled_object , self.desc , self.type, self.address,self.force,self.timeout,self.mode)