Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separated traceinst and tracecall logs. Added timestamp to output file #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"pagesize" : (25, "number of lines to display per page, 0 = disable paging"),
"session" : ("peda-session-#FILENAME#.txt", "target file to save peda session"),
"tracedepth": (0, "max depth for calls/instructions tracing, 0 means no limit"),
"tracelog" : ("peda-trace-#FILENAME#.txt", "target file to save tracecall output"),
"tracecalllog" : ("peda-tracecall-#FILENAME#.txt", "target file to save tracecall output"),
"traceinstlog" : ("peda-traceinst-#FILENAME#.txt", "target file to save tracecall output"),
"crashlog" : ("peda-crashdump-#FILENAME#.txt", "target file to save crash dump of fuzzing"),
"snapshot" : ("peda-snapshot-#FILENAME#.raw", "target file to save crash dump of fuzzing"),
"autosave" : ("on", "auto saving peda session, e.g: on|off"),
Expand Down
11 changes: 8 additions & 3 deletions peda.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,16 @@ def get_config_filename(self, name):
filename = peda.getpid()
if not filename:
filename = 'unknown'

datetime = time.strftime("_%Y%m%d_%H%M%S");

filename = os.path.basename("%s" % filename)
tmpl_name = config.Option.get(name)
if tmpl_name:
return tmpl_name.replace("#FILENAME#", filename)
if name == "traceinstlog" or name == "tracecalllog":
return tmpl_name.replace("#FILENAME#", filename + datetime)
else:
return tmpl_name.replace("#FILENAME#", filename)
else:
return "peda-%s-%s" % (name, filename)

Expand Down Expand Up @@ -4054,7 +4059,7 @@ def tracecall(self, *arg):
inverse = 1

binname = peda.getfile()
logname = peda.get_config_filename("tracelog")
logname = peda.get_config_filename("tracecalllog")

if mapname is None:
mapname = binname
Expand Down Expand Up @@ -4132,7 +4137,7 @@ def traceinst(self, *arg):
instlist = insts.replace(",", " ").split()

binname = peda.getfile()
logname = peda.get_config_filename("tracelog")
logname = peda.get_config_filename("traceinstlog")

if mapname is None:
mapname = binname
Expand Down