-
Notifications
You must be signed in to change notification settings - Fork 648
Fix VMware layer tag reading #429
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,8 +48,7 @@ def _read_header(self) -> None: | |||||||||||||||||||||||||||
| if magic not in [b"\xD2\xBE\xD2\xBE"]: | ||||||||||||||||||||||||||||
| raise VmwareFormatException(self.name, "Wrong magic bytes for Vmware layer: {}".format(repr(magic))) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # TODO: Change certain structure sizes based on the version | ||||||||||||||||||||||||||||
| # version = magic[1] & 0xf | ||||||||||||||||||||||||||||
| version = magic[0] & 0xf | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| group_size = struct.calcsize(self.group_structure) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
@@ -81,12 +80,20 @@ def _read_header(self) -> None: | |||||||||||||||||||||||||||
| self._context.object("vmware!unsigned int", | ||||||||||||||||||||||||||||
| offset = offset + name_len + 2 + (index * index_len), | ||||||||||||||||||||||||||||
| layer_name = self._meta_layer)) | ||||||||||||||||||||||||||||
| data = self._context.object("vmware!unsigned int", | ||||||||||||||||||||||||||||
| data_len = flags & 0x3f | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # TODO: Read special data sizes (signalling a longer data stream) properly instead of skipping them | ||||||||||||||||||||||||||||
| if data_len in (62, 63): | ||||||||||||||||||||||||||||
| data_len = 4 if version == 0 else 8 | ||||||||||||||||||||||||||||
| offset += 2 + name_len + (indicies_len * index_len) + 2 * data_len | ||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this confuses me, since it looks like we'd be doing this twice? Can you walk me through what's going on here please?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to clearify this a bit more in the next commit. Most tags have a
Some tags however, have a
The 4 or 8 (which I set as I based this mostly on Volatility 2.x-code and the original parser of the same author. |
||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| data = self._context.object("vmware!unsigned int" if data_len == 4 else "vmware!unsigned long long", | ||||||||||||||||||||||||||||
| layer_name = self._meta_layer, | ||||||||||||||||||||||||||||
| offset = offset + 2 + name_len + (indicies_len * index_len)) | ||||||||||||||||||||||||||||
| tags[(name, tuple(indicies))] = (flags, data) | ||||||||||||||||||||||||||||
| offset += 2 + name_len + (indicies_len * | ||||||||||||||||||||||||||||
| index_len) + self._context.symbol_space.get_type("vmware!unsigned int").size | ||||||||||||||||||||||||||||
| index_len) + data_len | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if tags[("regionsCount", ())][1] == 0: | ||||||||||||||||||||||||||||
| raise VmwareFormatException(self.name, "VMware VMEM is not split into regions") | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.