Email or username:

Password:

Forgot your password?
Foone🏳️‍⚧️

Ghidra question:

I'm working on one main binary and I'm needing to repeatedly import binary patches over it.
The problem is that the way ghidra lets you do this (that I know of) are to manually select each instruction and enter new assembly, or to go into the binary edit and change the bytes one by one.

Is there some easy way to import a binary patch that I'm missing?

14 comments
Foone🏳️‍⚧️

I think there's a way to import a whole new binary over the existing one you were reversing, so I guess I could patch it outside of ghidra and then do a full reimport, which hopefully shouldn't lose any of my labels and such

Foone🏳️‍⚧️

note: in theory it supports copy/paste out of the binary view. in reality, I don't think I've ever gotten it to successfully paste more than one byte, as it always says the size is wrong

Foone🏳️‍⚧️

wait. paste and ctrl-v both fail, but ctrl-shift-v brings up an ARE YOU SURE? and then ignores the highlight and pastes it at the cursor?

what?!

Foone🏳️‍⚧️

fuck me, it's just a completely confused error message:
it's saying "not enough space" because it can't find enough UNDEFINED BYTES. It's stopping you from writing over code.

motherfucker.

Graham Spookyland🎃/Polynomial

@foone oh, right, yes. you have to hit C on the instructions to clear them first, then overwrite. it's rather tedious.

Foone🏳️‍⚧️

I guess I could always write a python script. It does have that. Still, it seems like this sort of thing should be easier. Maybe this is an unusual need? I dunno. I'm patching a game as I go.

Foone🏳️‍⚧️

to be clear, the clipboard-binary viewer thing does work, it's just tedious. You have to clear existing decompilation for the area you're writing to, then re-decompile it.

Jens Finkhäuser

@foone Never used ghidra, but you're describing the most basic hex editor functionality I can imagine. 🤔

Foone🏳️‍⚧️

@jens yeah. it's really that it's not a hex editor, it just has some very basic hex editing abilities in it. and they're not good.

Jens Finkhäuser

@foone Half-arsed features are the most annoying 😒

ParzivalWolfram

@foone I actually already did that for the same exact reason. My solution is utter ass, but it is marginally faster to use than Ghidra is. I couldn't figure out the Ghidra API in my blind rage, so it's standalone, and worse for it. github.com/ParzivalWolfram/Rap

Foone🏳️‍⚧️

@ben yeah but I don't want to have to for this project if I can avoid it :)

Go Up