Skip to content

Commit

Permalink
enum fix for #214
Browse files Browse the repository at this point in the history
  • Loading branch information
blattm committed Jun 18, 2024
1 parent fffb1b4 commit b0fb77a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions decompiler/frontend/binaryninja/handlers/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,19 @@ def _lift_named_type_ref(self, variable: DataVariable, parent: Optional[MediumLe
)

case NamedTypeReferenceClass.EnumNamedTypeClass:
value = Constant(variable.value, self._lifter.lift(variable.type))
return self._build_global_variable(
variable.name,
value.type,
variable.address,
value,
parent.ssa_memory_version if parent else 0,
)
try:
value = Constant(variable.value, self._lifter.lift(variable.type))
return self._build_global_variable(
variable.name,
value.type,
variable.address,
value,
parent.ssa_memory_version if parent else 0,
)
except Exception:
return Constant(
"Unknown value", self._lifter.lift(variable.type)
) # BNinja error
case _:
raise NotImplementedError(f"No handler for '{variable.type.named_type_class}' in lifter")

Expand Down

0 comments on commit b0fb77a

Please sign in to comment.