Skip to content

Commit

Permalink
[Lifter] Complex Type Lifting (#445)
Browse files Browse the repository at this point in the history
* Create draft PR for #444

* Switch Error fix and already lifted

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Spartak Ehrlich <[email protected]>
Co-authored-by: Niklas Bergmann <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2024
1 parent 43f49d1 commit 54a3ed8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions decompiler/frontend/binaryninja/handlers/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ def lift_global_variable(
if not self._view:
self._view = view

# BNinja error cases: nullptr/small numbers (0, -12...)
if not addr_in_section(view, variable.address):
return Constant(variable.address, vartype=Integer(view.address_size * BYTE_SIZE, False))

# If addr was already lifted: Return lifted GlobalVariable with updated SSA
variable_identifier = (variable.address, self._lifter.lift(variable.type))
if variable_identifier in self._lifted_globals.keys():
Expand All @@ -167,10 +171,6 @@ def lift_global_variable(
else self._lifted_globals[variable_identifier]
)

# BNinja error cases: nullptr/small numbers (0, -12...)
if not addr_in_section(view, variable.address):
return Constant(variable.address, vartype=Integer(view.address_size * BYTE_SIZE, False))

# Check if there is a cycle between GlobalVariables initial_value
if callers and variable.address in callers:
return (
Expand Down

0 comments on commit 54a3ed8

Please sign in to comment.