def show_asm(self, item, primary):
cur = self.db_cursor()
if primary:
db = "main"
else:
db = "diff"
ea = str(int(item[1], 16))
sql = "select prototype, assembly, name from %s.functions where address = ?"
sql = sql % db
cur.execute(sql, (ea, ))
row = cur.fetchone()
if row is None:
Warning("Sorry, there is no assembly available for the selected function.")
else:
fmt = HtmlFormatter()
fmt.noclasses = True
fmt.linenos = True
asm = self.prettify_asm(row["assembly"])
final_asm = "; %s\n%s proc near\n%s\n%s endp\n"
final_asm = final_asm % (row["prototype"], row["name"], asm, row["name"])
src = highlight(final_asm, NasmLexer(), fmt)
title = "Assembly for %s" % row["name"]
cdiffer = CHtmlViewer()
cdiffer.Show(src, title)
cur.close()
评论列表
文章目录