dfxml icon indicating copy to clipboard operation
dfxml copied to clipboard

Traceback in iblkfind.py

Open jahrome opened this issue 10 years ago • 1 comments

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 img_offset specified in fiwalk xml output:

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

jahrome avatar Jul 27 '15 16:07 jahrome

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 [email protected] 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.

simsong avatar Jul 27 '15 17:07 simsong