This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\definecolor{background}{RGB}{250, 250, 250} | |
\definecolor{string}{RGB}{89, 135, 75} | |
\definecolor{comment}{RGB}{160, 161, 166} | |
\definecolor{keycolor}{RGB}{153, 54, 159} | |
\definecolor{normal}{RGB}{55, 57, 65} | |
\definecolor{identifier}{RGB}{166, 226, 46} | |
\definecolor{function}{RGB}{75, 122, 235} | |
\setlength{\parindent}{1em} | |
\lstset{ | |
language=C++, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lldb | |
def get_current_addr(): | |
# get current address cs:ip | |
interpreter = lldb.debugger.GetCommandInterpreter() | |
return_object = lldb.SBCommandReturnObject() | |
interpreter.HandleCommand('reg r cs', return_object) | |
cs = int(return_object.GetOutput()[return_object.GetOutput().find("0"):], 0) | |
interpreter.HandleCommand('reg r eip', return_object) | |
eip = int(return_object.GetOutput()[return_object.GetOutput().find("0"):], 0) |