コード例 #1
0
ファイル: SEHGraph.py プロジェクト: z6s469s1/idapython-src
def WindbgGetRegBase(tid):
    ok, s = ida_dbg.send_dbg_command("dg %x" % idautils.cpu.fs)
    if not ok:
        return 0
    m = re.compile("[0-9a-f]{4} ([0-9a-f]{8})")
    t = m.match(s.split('\n')[-2])
    if not t:
        return 0
    return int(t.group(1), 16)
コード例 #2
0
ファイル: PteDump.py プロジェクト: AmesianX/src
def DumpPTE(ea1, ea2):
    items = []
    PG = 0x1000
    npages = (ea2 - ea1) / PG
    for i in range(npages):
        ok, r = ida_dbg.send_dbg_command("!pte %x" % ea1)
        if not ok:
            return False
        r = parse_pte(r)
        if r:
            print("VA: %08X  PTE: %s PDE: %s" % (ea1, r['ptepfns'], r['pdepfns']))
        ea1 += PG
コード例 #3
0
def DumpPTE(ea1, ea2):
    items = []
    PG = 0x1000
    npages = (ea2 - ea1) / PG
    for i in range(npages):
        ok, r = ida_dbg.send_dbg_command("!pte %x" % ea1)
        if not ok:
            return False
        r = parse_pte(r)
        if r:
            print("VA: %08X  PTE: %s PDE: %s" %
                  (ea1, r['ptepfns'], r['pdepfns']))
        ea1 += PG
コード例 #4
0
ファイル: PteDump.py プロジェクト: AmesianX/src
    def Refresh(self):
        items = []
        PG = 0x1000
        ea1 = self.ea1
        npages = (self.ea2 - ea1) / PG
        for i in range(npages):
            ok, r = ida_dbg.send_dbg_command("!pte %x" % ea1)
            if not ok:
                return False
            r = parse_pte(r)
            if r:
                items.append([hex(ea1), r['ptepfns']])
            ea1 += PG

        self.items = items
        print(self.items)
        return True
コード例 #5
0
    def Refresh(self):
        items = []
        PG = 0x1000
        ea1 = self.ea1
        npages = (self.ea2 - ea1) / PG
        for i in range(npages):
            ok, r = ida_dbg.send_dbg_command("!pte %x" % ea1)
            if not ok:
                return False
            r = parse_pte(r)
            if r:
                items.append([hex(ea1), r['ptepfns']])
            ea1 += PG

        self.items = items
        print(self.items)
        return True
コード例 #6
0
ファイル: DbgCmd.py プロジェクト: AmesianX/src
    def IssueCommand(self):
        s = ida_kernwin.ask_str(self.last_cmd, 0, "Please enter a debugger command")
        if not s:
            return

        # Save last command
        self.last_cmd = s

        # Add it using a different color
        self.AddLine("debugger>" + ida_lines.COLSTR(s, ida_lines.SCOLOR_VOIDOP))

        ok, out = ida_dbg.send_dbg_command(s)
        if ok:
            for line in out.split("\n"):
                self.AddLine(ida_lines.COLSTR(line, ida_lines.SCOLOR_LIBNAME))
        else:
            self.AddLine(
                ida_lines.COLSTR(
                    "Debugger is not active or does not export ida_dbg.send_dbg_command() (%s)" % out,
                    ida_lines.SCOLOR_ERROR))
        self.Refresh()
コード例 #7
0
ファイル: DbgCmd.py プロジェクト: whyliuxing/src
    def IssueCommand(self):
        s = ida_kernwin.ask_str(self.last_cmd, 0,
                                "Please enter a debugger command")
        if not s:
            return

        # Save last command
        self.last_cmd = s

        # Add it using a different color
        self.AddLine("debugger>" +
                     ida_lines.COLSTR(s, ida_lines.SCOLOR_VOIDOP))

        ok, out = ida_dbg.send_dbg_command(s)
        if ok:
            for line in out.split("\n"):
                self.AddLine(ida_lines.COLSTR(line, ida_lines.SCOLOR_LIBNAME))
        else:
            self.AddLine(
                ida_lines.COLSTR(
                    "Debugger is not active or does not export ida_dbg.send_dbg_command() (%s)"
                    % out, ida_lines.SCOLOR_ERROR))
        self.Refresh()
コード例 #8
0
def WinDbg_command(cmd):
    ok, s = ida_dbg.send_dbg_command(cmd)
    return s if ok else False
コード例 #9
0
ファイル: DrvsDispatch.py プロジェクト: AmesianX/src
def WinDbg_command(cmd):
    ok, s = ida_dbg.send_dbg_command(cmd)
    return s if ok else False