9

I was following this video at the end it shows how to do basic stuff with Radare2 (r2).

When I try to set a break point with:

db 0x004005bd

Where 0x004005bd is the first address of the main function that just does:

push rbp

But after I run the db command it tells me:

Cannot place a breakpoint on 0x004005bd unmapped memory. See dbg.bpinmaps

I understand what it says, but how do I fix it ?

1
  • 1
    do you use r2 from git ?
    – u185619
    Commented Oct 10, 2016 at 21:17

6 Answers 6

8

Run radare2 in debug mode. r2 -d

3

You are probably using an obsolete version of radare2.

Uninstall your current radare2 version then run:

git clone https://github.com/radare/radare2 && cd radare2 && ./sys/install.sh

If you are using ArchLinux use radare2-git

If you are using windows or another platform (like iOS or Android), please use the git link on rada.re or build it.

Lastly if you encounter an issue related to radare2 itself, I strongly suggest you come say hi on IRC or Telegram, you can also report issue on github.

1

you can check the exexcutable file using "file" command. then you can find the file is an "elf shared object" NOT an "elf executable". however you can execute it directly.

so you need to recomplie it using "gcc xxx.c -no-pie -o xxx" then debug it using "radare2 -d xxx" and you're good to go

1

If you have and e io.cache set to true, then breakpoints don't work

0

You can also do e dbg.bpinmaps=0 so Radare2 allows you to set breakpoint without that restriction.

1
  • it could be helpful to explain what this flag does in r2. Commented Aug 6, 2019 at 5:31
0

I'm using a Debian based OS(Kali / Parrot OS) and I got the same error. When you run radare2 in a Mac OS and try to add a breakpoint using the same method, it will work properly. But when it comes to Linux OS, it will probably give you this error.

I tried everything. Then I saw this when I was trying to execute ood inside radare2 console:

WARNING: bin_strings buffer is too big (0xffffffffa9a2552c). Use -zzz or set bin.maxstrbuf (RABIN2_MAXSTRBUF) in r2 (rabin2)

First, you have to compile the C code using the following command,

gcc <name>.c -no-pie -o <any_name>

Then open it with -zzz option, as an example, let's say my compiled code name is "tool", then execute this command,

radare2 -zzz tool3

And continue with the process. Now you'll be able to add a breakpoint.

0

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.