Skip to content
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: 4 additions & 1 deletion utils/leafblower.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def find_functions(self):

register_used = instruction.getOpObjects(
reference.getOperandIndex())
register_index = registers.index(register_used[0].toString())
try:
register_index = registers.index(register_used[0].toString())
except ValueError:
print("List does not contain value")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sparrow-labz Thanks for submitting the pull request. I don't think I've ever run across this error so I'm wondering if it's an architecture problem? (arm vs x86 vs etc) Could you give a little background on how you ran across this and maybe provide the binary? Regardless, this looks like it should still throw an exception since the ValueError exception would result in register_index not being declared but is used in the FormatFunction instantiation a few lines below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran leafblower on an arm bootloader binary for an older Samsung phone, from the A series. I'll try to find the binary, and add it.


self.format_functions.append(FormatFunction(function,
register_index))
Expand Down