2

If I define a flag in radare2 without a prefix, like this:

fs symbols
f myflag=0x412

Then radare will show this label on the target address:

        ╎   ;-- myflag:
       ┌──> 0x00000412      200689         jsr 0x8906                  ;[2]
       ╎╎   0x00000415      c602           dec 0x02
       └──< 0x00000417      d0f9           bne 0x000412

But will not use this label in the target of branch statements (see, e.g., bne 0x000412).

On the other hand, if I define the label with a prefix, like this:

fs symbols
f x.myflag=0x412

Then the label is also used in branch statements:

        ╎   ;-- x.myflag:
       ┌──> 0x00000412      200689         jsr 0x8906                  ;[2]
       ╎╎   0x00000415      c602           dec 0x02
       └──< 0x00000417      d0f9           bne x.myflag

The documenation on this topic doesn't seem to mention this difference in behavior. Is this expected? Is there a way to get radare2 to resolve branch destinations using unqualified flags?

larsks
  • 277,717
  • 41
  • 399
  • 399
  • Not sure if this helps but I found that the following commands `f myflag.=0x412` and `f .myflag=0x412` result in the same behavior. Also interesting, the command `f. myflag=0x412` results in `0x00000417 d0f9 bne .myflag` even though the "." is part of the command not the flagname. The `f.blah=$$+12` command is used to create local function labels. – Kuma Feb 05 '21 at 15:42

0 Answers0