将immlib用于API挂钩Python会产生错误

2024-05-15 04:04:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用免疫调试器进行简单的API挂钩,现在我从这里开始学习本教程http://c0defreak.blogspot.com/2013/03/sniffing-data-before-its-gets-encryted.html,并将python脚本保存在pycommands文件夹中,当我运行该命令时,我发现这是一个错误

Unable to read memory of debugged process. Breakpoint at FFFFFFFF is deleted.

请问我似乎遗漏了什么

编辑

我用来测试的代码看起来是这样的

from immlib import *

class fire (LogBpHook) :
          def __init__(self):
                   self.imm=Debugger();
                   self.logfile = "C:\\Users\\user\\Desktop\\ff_log.txt"
#directory where the log file has to be saved
                   LogBpHook.__init__(self)

          def run(self,regs):
                   addr=self.imm.readLong(regs['ESP']+8)
                   str=self.imm.readString(addr)
                   self.imm.log("PR_Write ( 0x%x) <- %s" % (addr,str) )
                   fd = open( self.logfile, "a" )
                   fd.write( str )
                   fd.close()
# this function run automatically when hook is hit and function code is #executed which logs it in to file and displays on log window of debugger

def main(args) :
          imm=Debugger()
          wfun=imm.getAddress("nss3.PR_Write")
#setup hook point
          fire_hook=fire()
          fire_hook.add( "%08x" % wfun, wfun)
          return "[*] READY for ACTION"

我已经点击了播放按钮,并试图从firefox浏览器登录到表单,但它没有显示在调试器中,也没有显示在文本文件中


Tags: oftoselflogisdefhookfire

热门问题