Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasco-jofra committed Apr 10, 2019
1 parent 28d584e commit ae25948
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ You can insert the target addresses as a single addr (hex or decimal) (e.g. `0x2

![usage gif](./images/out.gif)

Better quality video [here](./images/out.mp4)

# Install
To install this plugin, navigate to your Binary Ninja plugins directory, and run `git clone [email protected]:Vasco-jofra/indirect-branch-setter.git`.

Expand Down
11 changes: 5 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def append_row(self, addr_str):
return

# Avoid duplicate entries
if any([i[self.COL_ADDRESS] == addr for i in self.branches]):
if any([branch[self.COL_ADDRESS] == addr for branch in self.branches]):
return

self.insertRows(row)
self.setData(self.index(row, 0), self.default_branch[0])
self.setData(self.index(row, 1), hex(int(addr)))
self.setData(self.index(row, self.COL_ARCH), self.default_branch[self.COL_ARCH])
self.setData(self.index(row, self.COL_ADDRESS), hex(addr))

def parse_int(self, val):
try:
Expand Down Expand Up @@ -171,7 +171,7 @@ def remove_row_clicked(self):
rows_selected.add(i.row())
assert len(rows_selected) >= 1

# Hopefully this sort is enought to delete the correct rows.
# Hopefully this sort is enough to delete the correct rows.
sorted_rows_selected = sorted(list(rows_selected), reverse=True)
for row in sorted_rows_selected:
self.table_model.removeRows(row)
Expand All @@ -182,8 +182,7 @@ def set_indirect_branches_clicked(self):
branches = self.table_model.branches
log_debug("Setting 0x%x's indirect branches to: %s" % (self.indirect_jmp_addr, branches))

func = self.bv.get_functions_containing(self.indirect_jmp_addr)[0]
func.set_user_indirect_branches(self.indirect_jmp_addr, branches)
self.func.set_user_indirect_branches(self.indirect_jmp_addr, branches)

self.accept()

Expand Down

0 comments on commit ae25948

Please sign in to comment.