fastloghook 如何在免疫调试器 pycommand 部分工作?我想不通。我尝试的一切都不起作用,我知道这段代码一团糟。我真的不明白 fastloghook 当 bphook 工作得如此好时,这让我发疯。我需要一个解释:/
#!/usr/bin/env python
import immlib
import struct
from immlib import FastLogHook
def main(args):
"""
Will hook and run its own assembly code then return control
"""
imm = immlib.Debugger()
# Set name
Name = "hippie"
fast = imm.getKnowledge(Name)
if fast:
hook_list = fast.getAllLog()
imm.log(str(hook_list))
imm.log("%s" item[1[0]])
# Instantiate fastloghook
fast = immlib.FastLogHook(imm)
# Primary address to hook on to
fast.logFunction(imm.getAddress("msvcrt.strcpy"))
# Takes register and offset. dereference parameters from the stack
# or capture data at a known offset from a register
fast.logBaseDisplacement('ESP', 0x4)
fast.logBaseDisplacement('ESP', 0x8)
# Tracks the value of a specific register when the hook is hit
fast.logRegister("ESP")
# Logs known memory offset at hook time
# fast.logDirectMemory()
# Set the hook
fast.Hook()
# Save data so we can retrieve results later
imm.addKnowledge(Name, fast, force_add=1)
return "LogBPHook installed"`