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

Adds the Binary Ninja front-end plugin (MVP) + simplifies patch space 0 #240

Merged
merged 47 commits into from
Dec 2, 2022
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
de978eb
Initial schema for a plugin
Nov 12, 2022
dd5e49f
Progress on higher vars
Nov 17, 2022
bf823aa
Check supported architecture
Nov 17, 2022
bc53b8f
Comment
Nov 17, 2022
165fedd
Frame range
Nov 17, 2022
62ee9b0
Use helper function for defined vars
Nov 17, 2022
cc3621c
Identify data symbols that can be accessed via frame
Nov 17, 2022
60e2bed
Add button to refresh higher vars
Nov 17, 2022
0ff2c3e
Fixes
Nov 17, 2022
3784097
Simplify
Nov 17, 2022
70250eb
Store hvars in the class
Nov 17, 2022
ae5c835
More improvements
Nov 17, 2022
8c0712d
Reject invalid patch names
Nov 17, 2022
6257e3e
Fix
Nov 17, 2022
345a6a0
Add patch var editor, fix some bugs
Nov 21, 2022
d7d65ab
Ability to add live vars, some fixes to live vars analysis
Nov 22, 2022
20eb746
OGRE editor
Nov 22, 2022
4d620e3
Merge the OGRE editor with the patch editor
Nov 22, 2022
88b3f88
Serialize to the binja database
Nov 23, 2022
2b87b74
Fix patch name regex
Nov 23, 2022
a638946
Add ability to load a C source file
Nov 23, 2022
eba4425
Better labels for the buttons
Nov 23, 2022
f36f087
Better labels
Nov 23, 2022
6fdc09f
Allow patch size of zero
Nov 23, 2022
6b80030
Split the plugin into multiple modules
Nov 23, 2022
6668696
Default patch code is empty string
Nov 23, 2022
ec31692
Handle higher var values for "pointer" types
Nov 23, 2022
bc99fb5
Set current row if we had existing patches
Nov 23, 2022
efb45f3
Fix ogre decls formatting
Nov 30, 2022
ead854c
Import and export configs
Nov 30, 2022
488c5da
Redundant
Nov 30, 2022
6ec1fd4
Clear patch editor when we change to a different binaryview
Nov 30, 2022
a2e44d4
OGRE editor doesn't need title
Nov 30, 2022
a5e395a
Patch space editor (WIP)
Nov 30, 2022
8e14ea1
Use the `QValidator`s
Nov 30, 2022
ce00f95
Export spaces
Nov 30, 2022
5ec8d5d
Handle some cases when the LLIL isn't available
Dec 1, 2022
e6e18c3
Synchronize patch spaces with the BNDB
Dec 1, 2022
ced47be
Stretch patch and live vars widget columns
Dec 1, 2022
f9a39cc
Comment
Dec 1, 2022
4e417a6
Support `constant` higher var type
Dec 1, 2022
4c837f6
Fix size conversions
Dec 1, 2022
75c86ec
Clamp value based on size
Dec 1, 2022
fba85ed
Fix incorrect `segment` spec
Dec 1, 2022
22d89d1
Update samples
Dec 2, 2022
4230ece
Don't add the `overwritten` block if there are no overwritten instruc…
Dec 2, 2022
6b3f955
Misc
Dec 2, 2022
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
Prev Previous commit
Next Next commit
Use helper function for defined vars
  • Loading branch information
bmourad01 committed Nov 17, 2022
commit 62ee9b001562d1bfa75634e678e92b3b99c9df35
13 changes: 7 additions & 6 deletions vibes-tools/resources/binja/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,18 @@ def add(name, h):
else:
result[name].append(h)

def defined_at_patch(v):
for d in f.hlil.get_var_definitions(v):
if d.address >= self.addr or d.address <= end:
return True
return False

vars = f.hlil.vars
i = l.mlil.hlil.instr_index
for v in vars:
# Disregard this variable if it was defined within
# the patch region (or at the very end).
defined = False
for d in f.hlil.get_var_definitions(v):
if d.address >= self.addr or d.address <= end:
defined = True
break
if defined:
if defined_at_patch(v):
continue

if f.hlil.is_var_live_at(v, i):
Expand Down