tking2 / volatility

Automatically exported from code.google.com/p/volatility
GNU General Public License v2.0
0 stars 1 forks source link

mutantscan crashes on silent option #242

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After all the unicode changes occurred we are unable to run mutantscan with the 
silent option because we cannot do len() on the unicode object.  Here is a 
possible patch, though you might have something better in mind.  

Also if object_obj.NameInfo.Name is None, you get a warning.  This fixes both:

Index: volatility/plugins/filescan.py
===================================================================
--- volatility/plugins/filescan.py  (revision 1592)
+++ volatility/plugins/filescan.py  (working copy)
@@ -287,7 +287,7 @@
             ##   continue

             if self._config.SILENT:
-                if len(object_obj.NameInfo.Name) == 0:
+                if not object_obj.NameInfo.Name or 
len(str(object_obj.NameInfo.Name)) == 0:
                     continue

             yield (object_obj, mutant)

Original issue reported on code.google.com by jamie.l...@gmail.com on 11 Apr 2012 at 2:56

GoogleCodeExporter commented 9 years ago
sorry forgot to cc people

Original comment by jamie.l...@gmail.com on 11 Apr 2012 at 4:21

GoogleCodeExporter commented 9 years ago
Hmmmm, so taking the len of a NoneObject shouldn't cause a problem, it should 
just return 0.  The only reason I can think that there'd be a warning is if 
there were something like len(str(NoneObject)), in which case it's the str() 
that causes the warning, not the len.

Anyway, I've attached a patch that adds a native len function to Strings and 
_UNICODE_STRINGs.  It takes the length of the internal unicode string, rather 
than the ascii one (although there should be no difference).  Hopefully that'll 
solve the problem, lemme know how you get on please...  5:)

Original comment by mike.auty@gmail.com on 11 Apr 2012 at 9:01

Attachments:

GoogleCodeExporter commented 9 years ago
This seems to work fine, I can use the -s flag to mutantscan without issues. 
Gleeda feel free to re-open if it doesn't work for you. 

Original comment by michael.hale@gmail.com on 11 Apr 2012 at 11:44

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1622.

Original comment by michael.hale@gmail.com on 11 Apr 2012 at 11:44