-
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
ProcessHeaps access problems #1128
Comments
So, from the error message alone, (and looking up what Here's the definition I took from a random windows symbol table, for _PEB.ProcessHeaps:
At the moment, we don't have plugins that make use of |
Thanks for your time and answer.
Length of the array is _PEB.NumberofHeaps With Volshell: (layer_name) >>> process_heaps = peb.ProcessHeaps.dereference() I don't know how to continue. (layer_name) >>> dt("_HEAP") Thank you |
Is it possible that the available attributes are not defined in the ProcessHeaps object? (layer_name) >>> print(dir(process_heaps_dereference)) Thank you |
You can use I found the So once you have your
|
Wow, thanks for your time and help. Yes. ProcessHeap is pointer to primary heap of a process and ProcessHeaps: An array of pointers to process heaps. The first entry in this list always points to the same location as ProcessHeap because it is the primary. So I have first tried with ProcessHeap, (Primary Heap). peb = proc.get_peb() Result ''' :( Again? ''' (layer_name) >>> dt("_HEAP") How could it continue? Thanks you so much. |
So the |
Thanks ikelos for your help and time. "heap_array = process_heaps_dereference.cast('array', count=_PEB.NumberofHeaps, subtype='_HEAP') But I have problems;
The error: heap_array = process_heaps_pointer.cast('array', count=number_of_heaps, subtype='_HEAP'). AttributeError: ObjectTemplate object has no attribute size If I use: This error: heap_type = symbol_table.get_type('_HEAP') What's wrong? How Can I continue? Thank you |
Sorry, the symbol_table doesn't exist in volshell by default, it was more a stand in for people that use volshell often. You need to know the name of the symbol table you want, and then look it up in the context's symbol space using its name. You'd want to do:
As to why the earlier one didn't work, that's stranger, I thought all |
Ok, so subtypes need to be actual subtypes rather than just names of subtypes. I'll look into whether we can improve this. In the rest of our code we tend to be inside an object (so self already points to an object) and then do:
|
Hi ikelos, Thanks for your time. I will tell you the tests I am doing, (comparing results with volatility2 and volatility3) To be sure that I am really getting the right value. With Vol2:
In the loop, after the first test, add those lines:
Basically, when I set the HEAP flag and the PID, it lists the info of the vads that belong to a HEAP. But, Vol3: ` def list_vads(
The result is that only the main HEAP 0x400000 is done correctly, the rest do not give me the correct values (Below you can see the Decimal address and how it always shows the resulting VadInfo from the Main Heap, Address: 4194304 is 0x400000). `PID Process Offset Start VPN End VPN Tag Protection CommitCharge PrivateMemory Parent File File output Heap 1 Entry Address: 4194616 Heap 2 Entry Address: 4194928 Heap 3 Entry Address: 4195240 So it makes me suspect that something is not working as expected. The correct are (0x240000, 0x30000, 0x400000 and 0x6b0000 ) Thank you |
Hi Ikelos, Nothing, I am not able to find where the bug is and how I could solve it, with volatility2 I can get the Heaps (Modifying the VadInfo plugin and comparing If VAD start belongs to ProcessHeap) at: 0x240000 Now, if I look with Volatility3 using ProcessHeap as follows: `
` I get the following addresses: 0x400000 Only 0x400000 matches, which is the Main Heap that is created when the Process is created. Thank you |
I am trying to access the content of ProcessHeaps without success, I am using volatility3 Framework 2.5.2, and to test and be sure that all the code works and that only the ProcessHeaps part fails me, what I do is to modify the vadinfo plugin for volatility3 (in particular def list_vads, so that it should only show me the info of the vads that correspond to heaps), I indicate the variants that I am using, the error in all "TypeError: argument of type 'Pointer' is not iterable".
How should I access to ProcessHeaps? Where is the error/problem?
Volatility Version: volatility3 Framework 2.5.2
Operating System: Running volatility (Ubuntu 22.04-1)
Python Version: python 3 --version --> Python 3.10.12
Suspected Operating System: (Windows 7 32 bits)
Command: python3 vol.py -f ../TestHeap.mem windows.VadInfo_mod.HeapInfo --pid 1484
To Reproduce
Modify vadinfo plugin, (def list_vads)
Some of the ways I am doing it is the following:
Similar logic in Volatility2 works fine:
def list_vads(
cls,
proc: interfaces.objects.ObjectInterface,
filter_func: Callable[
[interfaces.objects.ObjectInterface], bool
] = lambda _: False,
) -> Generator[interfaces.objects.ObjectInterface, None, None]:
...
...
heaps_list = proc.get_peb().ProcessHeaps
...
...
heaps = proc.get_peb().ProcessHeaps.dereference()
...
...
peb = proc.get_peb()
heaps_array_pointer = peb.ProcessHeaps
number_of_heaps = peb.NumberOfHeaps
Expected behavior
It should show the vadinfo info only about the heaps of the indicated process
Example output
For example, for case 1:
if not vad_start in heaps:
TypeError: argument of type 'Pointer' is not iterable
The text was updated successfully, but these errors were encountered: