Skip to content

Commit

Permalink
feat: Define char array of correct length when using code-based heuri…
Browse files Browse the repository at this point in the history
…stic
  • Loading branch information
cxiao committed Oct 2, 2023
1 parent 6d5338e commit 05cab7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions binja_plugin/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ def recover_string_slices_from_code(bv: BinaryView) -> Optional[List[RustStringS
f"Candidate string: {candidate_string_slice_data[:candidate_string_slice_length]}"
)

bv.define_user_data_var(
addr=data_var.address,
var_type=Type.array(type=Type.char(), count=candidate_string_slice_length),
)
logger.log_info(
f"Defined string: {candidate_string_slice_data[:candidate_string_slice_length]}"
)


def action_recover_string_slices_from_code(bv: BinaryView):
RustStringSlice.create_binary_ninja_type(bv)
Expand Down

0 comments on commit 05cab7e

Please sign in to comment.