From cfb2002befc800e6b07cee91fbeb7152fa684037 Mon Sep 17 00:00:00 2001 From: ultramagnus_tcv Date: Tue, 5 Jan 2016 19:53:42 -0600 Subject: [PATCH] Quick adjustment for md5 md5 does _not_ add the comment_start and dib_start fields as part of the hash. (No point since they would change easily if drivers are in a different order.) --- Driv3rs.py | 4 ++-- EXAMPLE.OUTPUT.csv | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Driv3rs.py b/Driv3rs.py index d83499c..29ee94b 100644 --- a/Driv3rs.py +++ b/Driv3rs.py @@ -250,8 +250,8 @@ for i in range(0,len(drivers_list)): # next driver. reposition pointer to beginning of current # driver. send number of bytes to read to hashing function bytes_to_read = drivers_list[i]['comment_start'] + \ - drivers_list[+1]['comment_start'] - SOSfile.seek(drivers_list[i]['comment_start'],0) + drivers_list[+1]['comment_start'] - 4 + SOSfile.seek(drivers_list[i]['comment_start'] + 4,0) drivers_list[i]['md5'] = md5hash(bytes_to_read) # here we run a new loop to determine how many other DIBs exist diff --git a/EXAMPLE.OUTPUT.csv b/EXAMPLE.OUTPUT.csv index 3c802de..7ef0796 100644 --- a/EXAMPLE.OUTPUT.csv +++ b/EXAMPLE.OUTPUT.csv @@ -1,6 +1,6 @@ -SOS_DRIVER_FILE,comment_start,comment_len,comment_txt, dib_start,link_ptr,entry,name_len,name,flag,slot_num,num_devices,unit, dev_type,block_num,mfg,version -EXAMPLE.SOS.DRIVER,0x52c,0x0,None,0x530,0x43e,0x3bf,0x6,.FMTD1,"ACTIVE, Load on Boundary",None,3,0,"Character Device, Write-Only, Formatter",280,Apple Computer,1.10 -EXAMPLE.SOS.DRIVER,0xa94,0x0,None,0xa98,0x0,0x10b,0xa,.SILENTYPE,"INACTIVE",None,1,0,"Character Device, Write-Only, Silentype",Character Device or Undefined,Apple Computer,1.04 -EXAMPLE.SOS.DRIVER,0x1d72,0x0,None,0x1d76,0x0,0xc0,0x8,.PRINTER,"ACTIVE",None,1,0,"Character Device, Write-Only, RS232 Printer",Character Device or Undefined,Apple Computer,1.10 -EXAMPLE.SOS.DRIVER,0x20fc,0x0,None,0x2100,0x0,0x10a,0x8,.CONSOLE,"ACTIVE",None,1,0,"Character Device, Read-Write, System Console",Character Device or Undefined,Apple Computer,1.12 -EXAMPLE.SOS.DRIVER,0x34ee,0x4e,Apple /// CFFA3000 (Compact Flash For Apple 3000) Driver by David Schmidt 2011,0x3540,0x22,0x132,0xb,.CFFA3000D1,"ACTIVE",1,7,0,"Block Device, CFFA3000",Character Device or Undefined,David Schmidt,1.00 +SOS_DRIVER_FILE,comment_start,comment_len,comment_txt, dib_start,link_ptr,entry,name_len,name,flag,slot_num,num_devices,unit, dev_type,block_num,mfg,version,md5 +EXAMPLE.SOS.DRIVER,0x52c,0x0,"None",0x530,0x43e,0x3bf,0x6,.FMTD1,"ACTIVE, Load on Boundary",None,3,0,"Character Device, Write-Only, Formatter",280,Apple Computer,1.10,d17fd5cc96a0a672f4ffe47a9230d042 +EXAMPLE.SOS.DRIVER,0xa94,0x0,"None",0xa98,0x0,0x10b,0xa,.SILENTYPE,"INACTIVE",None,1,0,"Character Device, Write-Only, Silentype",Character Device or Undefined,Apple Computer,1.04,ccb703b232d0364079165d9c0b467b90 +EXAMPLE.SOS.DRIVER,0x1d72,0x0,"None",0x1d76,0x0,0xc0,0x8,.PRINTER,"ACTIVE",None,1,0,"Character Device, Write-Only, RS232 Printer",Character Device or Undefined,Apple Computer,1.10,c431e22a7b96a75bda8c0a73a33a934f +EXAMPLE.SOS.DRIVER,0x20fc,0x0,"None",0x2100,0x0,0x10a,0x8,.CONSOLE,"ACTIVE",None,1,0,"Character Device, Read-Write, System Console",Character Device or Undefined,Apple Computer,1.12,4e8898cecb3293783548a1d3f7f07e6a +EXAMPLE.SOS.DRIVER,0x34ee,0x4e,"Apple /// CFFA3000 (Compact Flash For Apple 3000) Driver by David Schmidt 2011",0x3540,0x22,0x132,0xb,.CFFA3000D1,"ACTIVE",1,7,0,"Block Device, CFFA3000",Character Device or Undefined,David Schmidt,1.00,e91de901867ec2b21f9c08dc5a95c6f5