I know how to write an opcode and how to increment and decrement machine code using plus and minus keys. However, how do I write a sequence of machine code at an offset?

E.g. if I want to write five 0x90, how would I do that?

  • That didn't work for you? – Ricardo Apr 24 '19 at 2:50

> w?
wx[?][fs] 9090 write two intel nops (from wxfile or wxseek)

First seek to the address you want to write, then write:

> s 0x000009d5
> wx 34313335

You can also use:

> w \x34\x31\x33\x35

This will write '4135' at the address pointed by s command

Radare2 also give you the option to point to the address that you want to write on:

> w \x34\x31\x33\x35 @0x000007b0

Write "4135" at 0x000007b0

Use the one you feel more comfortable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.