From fc33ee7dc10b2188db2303bfb4323f79dbfe357e Mon Sep 17 00:00:00 2001 From: Paul Hagstrom Date: Sun, 27 Dec 2015 02:30:10 -0500 Subject: [PATCH] Fixes to keep commas and quotation marks from messing up the CSV output --- Driv3rs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Driv3rs.py b/Driv3rs.py index 75d03dc..1414e43 100644 --- a/Driv3rs.py +++ b/Driv3rs.py @@ -118,7 +118,7 @@ for i in range(0,len(drivers_list)): drivers_list[i]['comment_len'] = comment_len if comment_len != 0x0000: comment_txt = readUnpack(comment_len, type = 't') - drivers_list[i]['comment_txt'] = comment_txt + drivers_list[i]['comment_txt'] = comment_txt.replace('"', "''") # quotation marks will mess up csv else: drivers_list[i]['comment_txt'] = 'None' @@ -283,7 +283,7 @@ for i in range(0,len(drivers_list)): csvout.write(disk_img + ',' + \ hex(drivers_list[i]['comment_start']) + ',' + \ hex(drivers_list[i]['comment_len']) + ',' + \ - drivers_list[i]['comment_txt'] + ',' + \ + '"' + drivers_list[i]['comment_txt'] + '"' + ',' + \ hex(drivers_list[i]['dib_start']) + ',' + \ hex(drivers_list[i]['link_ptr']) + ',' + \ hex(drivers_list[i]['entry']) + ',' + \