-
Notifications
You must be signed in to change notification settings - Fork 383
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
ValueError: negative shift count for volshell.py dt( ps()[0] ) #1065
Comments
Hello @indigo-pc - I'm quite sure that is related to this dwarf2json issue - volatilityfoundation/dwarf2json#49 I'm not sure there is a full fix for it yet unfortunately. |
Hey all! I encountered the same issue:
I've uploaded some files that could be helpful for debugging on your side (or the dwarf2json devs): Thanks a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Attempting to display_type for ps() layer returns ValueError: negative shift count.
Context
Volatility Version: Volshell (Volatility 3 Framework) 2.5.2
Operating System: MacOS 13.6
Python Version: 3.8.18
Suspected Operating System: Alpine Linux 3.17.3 (v5.15.105-virt kernel)
Command: dt( ps()[0] )
To Reproduce
Steps to reproduce the behavior:
$ python volshell.py -f /Users/indigo/Projects/alpine-mem-dump/alpine-memory-dump-padded.lime -l
>>> dt( ps()[0] )
Expected behavior
Expected a table of memory offsets, symbols and types to print to the terminal for the given layer.
Example output
(layer_name) >>> dt( ps()[0] )
symbol_table_name1!task_struct (11072 bytes)
Traceback (most recent call last):
File "", line 1, in
File "/Users/indigo/Projects/volatility3/volatility3/cli/volshell/linux.py", line 70, in display_type
return super().display_type(object, offset)
File "/Users/indigo/Projects/volatility3/volatility3/cli/volshell/generic.py", line 387, in display_type
self._display_value(getattr(volobject, member)),
File "/Users/indigo/Projects/volatility3/volatility3/framework/objects/init.py", line 964, in getattr
member = template(context=self._context, object_info=object_info)
File "/Users/indigo/Projects/volatility3/volatility3/framework/objects/templates.py", line 96, in call
return self.vol.object_class(
File "/Users/indigo/Projects/volatility3/volatility3/framework/objects/init.py", line 525, in new
return int.new(cls, ((value & ((1 << end_bit) - 1)) >> start_bit)) # type: ignore
ValueError: negative shift count
Additional information
When testing an ubuntu 16 memory dump, I see the expected behavior I describe above. I can fix the issue for the Alpine memory image by revising this module: /Users/indigo/Projects/volatility3/volatility3/framework/objects/init.py
To include the indicated lines:
But I suspect this is a hacky workaround. Perhaps worthy of further scrutiny.
The text was updated successfully, but these errors were encountered: