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

fix usage of LowLevelILFunction.get_ssa_reg_definition API #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions explain.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@ def preprocess_LLIL_FLAG(bv, llil_instruction):
return {"source": source, "address": address}


def preprocess_LLIL_REG(_bv, llil_instruction):
def preprocess_LLIL_REG(_bv, llil_instruction: LowLevelILInstruction):
"""Follow back temporary registers and append the address where they're created"""
loc = ""
source = llil_instruction.src
if llil_instruction.src.temp:
reg = llil_instruction.ssa_form.src
indx = llil_instruction.function.get_ssa_reg_definition(reg)
src = llil_instruction.function[indx]
src = llil_instruction.function.get_ssa_reg_definition(reg)
if hasattr(src, "src"):
# I've never seen it in the wild, but it's probably possible for a temporary variable to be sourced
# from a Phi function on the same instruction, which could lead to infinite recursion
Expand Down