From a7c2a4572ee305d7d81cc914c3466a1051abf84f Mon Sep 17 00:00:00 2001 From: AydinChavez Date: Tue, 22 Nov 2016 23:11:07 +0100 Subject: [PATCH] Separated traceinst and tracecall logs. Added timestamp to output file --- lib/config.py | 3 ++- peda.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/config.py b/lib/config.py index 5704fc7..b486afa 100644 --- a/lib/config.py +++ b/lib/config.py @@ -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"), diff --git a/peda.py b/peda.py index 3deee3d..690c2aa 100644 --- a/peda.py +++ b/peda.py @@ -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) @@ -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 @@ -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