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

[Lifter] Fix pointer size in globals.py #410

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions decompiler/frontend/binaryninja/handlers/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ def _get_unknown_value(self, variable: DataVariable):
type = PseudoArrayType(self._lifter.lift(data[1]), len(data[0]))
data = ConstantComposition([Constant(x, type.type) for x in data[0]], type)
else:
data, type = get_raw_bytes(variable.address, self._view), Pointer(CustomType.void())
data, type = get_raw_bytes(variable.address, self._view), Pointer(CustomType.void(), self._view.address_size * BYTE_SIZE)
return data, type

def _get_unknown_pointer_value(self, variable: DataVariable, callers: list[int] = None):
"""Return symbol, datavariable, address, string or raw bytes for a value of a datavariable(!) (dv should be a pointer)."""
if not addr_in_section(self._view, variable.value):
type = Pointer(CustomType.void())
type = Pointer(CustomType.void(), self._view.address_size * BYTE_SIZE)
return Constant(variable.value, type), type

if datavariable := self._view.get_data_var_at(variable.value):
Expand Down Expand Up @@ -288,7 +288,7 @@ def _get_unknown_pointer_value(self, variable: DataVariable, callers: list[int]
type,
)
else:
data, type = get_raw_bytes(variable.value, self._view), Pointer(CustomType.void())
data, type = get_raw_bytes(variable.value, self._view), Pointer(CustomType.void(), self._view.address_size * BYTE_SIZE)
return data, type


Expand Down
Loading