Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handles backtrace #40

Closed
gleeda opened this issue Jul 3, 2014 · 1 comment
Closed

handles backtrace #40

gleeda opened this issue Jul 3, 2014 · 1 comment
Labels

Comments

@gleeda
Copy link
Member

gleeda commented Jul 3, 2014

Traceback (most recent call last):
  File "vol.py", line 192, in <module>
    main()
  File "vol.py", line 183, in main
    command.execute()
  File "volatility/volatility/commands.py", line 127, in execute
    func(outfd, data)
  File "volatility/volatility/plugins/handles.py", line 67, in render_text
    self.table_row(outfd, offset, pid, handle.HandleValue, handle.GrantedAccess, object_type, name)
  File "volatility/volatility/commands.py", line 217, in table_row
    result = self._elide(("{0:" + spec.to_string() + "}").format(args[index]), spec.minwidth)
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 0: ordinal not in range(128)
@gleeda
Copy link
Member Author

gleeda commented Jul 17, 2014

problem is an invalid character in object_type (encoded in utf8 so it wouldn't fail below):

0xfffffadf99d28fe0    468             0x29e0           0x100003 � 

There are a couple of things we can do, like:

diff --git a/volatility/plugins/overlays/windows/windows.py b/volatility/plugins/overlays/windows/windows.py
index 96d2ce0..0374bb9 100644
--- a/volatility/plugins/overlays/windows/windows.py
+++ b/volatility/plugins/overlays/windows/windows.py
@@ -846,7 +846,7 @@ class _OBJECT_HEADER(obj.CType):
         """Return the object's type as a string"""
         type_obj = obj.Object("_OBJECT_TYPE", self.Type, self.obj_native_vm)

-        return type_obj.Name.v()
+        return str(type_obj.Name or '') 

     def is_valid(self):
         if not obj.CType.is_valid(self):

or

diff --git a/volatility/plugins/overlays/windows/windows.py b/volatility/plugins/overlays/windows/windows.py
index 96d2ce0..0374bb9 100644
--- a/volatility/plugins/overlays/windows/windows.py
+++ b/volatility/plugins/overlays/windows/windows.py
@@ -846,7 +846,7 @@ class _OBJECT_HEADER(obj.CType):
         """Return the object's type as a string"""
         type_obj = obj.Object("_OBJECT_TYPE", self.Type, self.obj_native_vm)

-        return type_obj.Name.v()
+        return type_obj.Name.v().encode("ascii", "replace")

     def is_valid(self):
         if not obj.CType.is_valid(self):

They both give off: "?" instead of the offending character.... which do we prefer? The first method is used in a lot of other places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant