It sounds like a stupid question but I honestly can't find the answer... I've looked at https://radare.gitbooks.io/radare2book/content/ and googled for hours but it still eludes me.

How do I modify the memory in radare2? I know if I want to modify a register value I can do:

dr eax = 0xA

But what about modifying a value in the stack or the heap at a specific address?

2 Answers 2


Take a look at the "write" section here https://github.com/pwntester/cheatsheets/blob/master/radare2.md or use w? to get help on the write commands.


To write the string "foo" into the memory address 0xdeadbeef:

w foo @ 0xdeadbeef

To write the hex 0x41414141 to the memory address 0xdeadbeef:

w \x41\x41\x41\x41 @ 0xdeadbeef

I recommend also taking a look at the various options for writing using the command w?.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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