simsong / dfxml

Digital Forensics XML project and library
http://www.forensicswiki.org/wiki/Category:Digital_Forensics_XML
Other
64 stars 22 forks source link

Traceback in iblkfind.py #14

Open jahrome opened 9 years ago

jahrome commented 9 years ago
Traceback (most recent call last):
  File "./iblkfind.py", line 42, in <module>
    dfxml.read_dfxml(xmlfile=open(args[0],"rb"),callback=process)
  File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 1463, in read_dfxml
    r.process_xml_stream(xmlfile,callback,preserve_fis)
  File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 1018, in process_xml_stream
    p.ParseFile(xml_stream)    
  File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 1249, in _end_element
    self.callback(self.fileobject)
  File "./iblkfind.py", line 36, in process
    if fi.has_sector(s):
  File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 762, in has_sector
    if run.has_sector(s): return True
  File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 265, in has_sector
    return self.img_offset <= s * self.sector_size < self.img_offset+self.len
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Seems like related to the fact that some files do not have _imgoffset specified in fiwalk xml output:

      <byte_runs>
       <byte_run file_offset='0' fill='0' len='15044608'/>
      </byte_runs>
simsong commented 9 years ago

Correct. There is no block to find. Should be an easy fix---just check to see if variable is none and fail early.

Please submit a pull request when it is ready. Thanks for the notice.

On Jul 27, 2015, at 12:45 PM, Jerome M notifications@github.com wrote:

Traceback (most recent call last): File "./iblkfind.py", line 42, in dfxml.read_dfxml(xmlfile=open(args[0],"rb"),callback=process) File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 1463, in read_dfxml r.process_xml_stream(xmlfile,callback,preserve_fis) File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 1018, in process_xml_stream p.ParseFile(xml_stream)
File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 1249, in _end_element self.callback(self.fileobject) File "./iblkfind.py", line 36, in process if fi.has_sector(s): File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 762, in has_sector if run.has_sector(s): return True File "/mnt/jer/Sources/Forensics/dfxml_git/python/dfxml.py", line 265, in has_sector return self.img_offset <= s * self.sector_size < self.img_offset+self.len TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' Seems like related to the fact that some file do not have img_offset specified in fiwalk xml output:

  <byte_runs>
   <byte_run file_offset='0' fill='0' len='15044608'/>
  </byte_runs>

— Reply to this email directly or view it on GitHub.