Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
839 stars 194 forks source link

Patching - show bytes and/or the length of of new instructions #5678

Open arttson opened 1 week ago

arttson commented 1 week ago

When patching, there should be a preview of bytes in currently written instruction.

I've made a small visualisation of what I mean:

patching

prev2

assembly

assem1

if doesn't fit, wrap (00 should be wrapped instead of 48, my bad)

assem2
xusheng6 commented 6 days ago

This would not be super easy to do -- would you like to let us know why you would want this?

arttson commented 6 days ago

Oh I thought it would. I've saw it i every other major RE environment and i find it very helpful to instantly see if im going out of bounds of original instruction. Also: I don't think assembly one is that important but inline edit - definitely.

xusheng6 commented 6 days ago

Thanks for the input! Right now, when you try to assemble a longer instruction, binja will remind you that the new instruction is longer and will overwrite the bytes after it. Maybe we can prompt that info in real time as people type to let them know about it.

I am personally not inclined towards showing the actual bytes -- I feel like they are less useful compared against the length info

arttson commented 6 days ago

Ah yes, I just thought about the usual implementation. You're right, I care about length not the bytes. I think macOS popup every time I go out of bound would be annoying. Maybe just a counter on the side of the old vs new instruction. But I bet You know better how to do it. Thanks!