0

I'm a little confused about the behaviour of the omb command in Radare2. Sometimes when I give it what I believe is a valid segment number and offset, it doesn't change it. (This is usually after I have changed it once, though I believe I've seen situations where I could change it more than once.) Here's an example session, loading a 64 KB ROM image:

$ r2 A2C-27512-FF04.bin 
 -- scp ~/.idapro/ida.key radare.org:/var/www/radare.org/pub/losers/
[0x00000000]> om
 1 fd: 3 +0x00000000 0x00000000 - 0x0000ffff r-x 
[0x00000000]> omb1 0xc000
[0x00000000]> om
 1 fd: 3 +0x00000000 0x00000000 - 0x0000ffff r-x 
[0x00000000]> omb. 0xc000
[0x00000000]> om
 1 fd: 3 +0x00000000 0x0000c000 - 0x0001bfff r-x 
[0x00000000]> omb. 0xd000
[0x00000000]> om
 1 fd: 3 +0x00000000 0x0000c000 - 0x0001bfff r-x 
[0x00000000]> omb1 0xd000
[0x00000000]> om
 1 fd: 3 +0x00000000 0x0000c000 - 0x0001bfff r-x 
[0x00000000]> omb1 0
[0x00000000]> om
 1 fd: 3 +0x00000000 0x0000c000 - 0x0001bfff r-x 
[0x00000000]> 

What I see here is:

  1. Startup and show map; map 1 offset is 0x0000.
  2. Request relocation of map 1 to 0xc000; it's still at 0x0000.
  3. Request relocation of current map to 0xc000; now it changes.
  4. Request relocation of current map to 0xd000; it does not change.
  5. Request relocation of map 1 to 0xd000; it does not change.
  6. Request relocation of map 1 to 0x0000; it does not change.

What am I misunderstanding about the behaviour of this command?

  • Hey! Did you try to use omb 1 0xc000 with space before the map ID? (instead of omb1). Also, what version of radare2 are you using? I tried on the latest version from git and I can't reproduce the issue you describe. omb. <addr> worked as well – Megabeets Jun 4 at 5:25

Your Answer

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

Browse other questions tagged or ask your own question.