2

If I run pd I get something like this,

[0x00400540]> pd @ main + 4
            0x0040064a      4883ec20       sub rsp, 0x20
            0x0040064e      897dec         mov dword [rbp - 0x14], edi
            0x00400651      488975e0       mov qword [rbp - 0x20], rsi
            0x00400655      837dec01       cmp dword [rbp - 0x14], 1   ; [0x1:4]=-1 ; 1
        ,=< 0x00400659      7f11           jg 0x40066c
        |   0x0040065b      bf70074000     mov edi, str.Usage_echo__string ; 0x400770 ; "Usage echo <string>"
        |   0x00400660      e89bfeffff     call sym.imp.puts
        |   0x00400665      b800000000     mov eax, 0
       ,==< 0x0040066a      eb64           jmp 0x4006d0
       |`-> 0x0040066c      488b45e0       mov rax, qword [rbp - 0x20]

Generally speaking the lines that show where the jumps are going on the left are awesome. But for the purpose of copying and pasting not so much. How can I disable them? Or how can I hide those lines? I tried a few different things but no luck.

  • You may also want to try the VVV command, this is much nicer to look at. – perror Feb 22 '18 at 23:13
  • @perror I use that all the time V (and then I hit space). What's the difference between VV and VVV? Where is VV documented? – Evan Carroll Feb 22 '18 at 23:25
  • 1
    Well, I do not know the difference between VV and VVV, in fact this is a quite good question. :-) – perror Feb 22 '18 at 23:28
  • @perror I don't think VVV exists. The top shows [0x00400646]> VV @ main as it does with VVVV – Evan Carroll Feb 22 '18 at 23:30
  • 2
    Ah, so I did type an extra V for nothing for ages! – perror Feb 22 '18 at 23:30
4

Those lines can be disables via r2 option namely by:

e asm.lines=false

after that, they no longer appear in pd.

| improve this answer | |
  • Very cool! Thanks a ton. I was thinking it'd be mentioned in p? I have a lot to learn. – Evan Carroll Feb 22 '18 at 19:29
3

well pawel beat me but this shows how to strip some more noise

C:\Windows\system32>radare2  calc.exe
[0x01012d6c]> af
[0x01012d6c]> pd 10 @ $$+0x4b
|       ,=< 0x01012db7      0f8538b00100   jne 0x102ddf5
|       |   0x01012dbd      33f6           xor esi, esi
|       |   0x01012dbf      46             inc esi
|       |      ; JMP XREF from 0x0102ddfe (entry0)
|       |   0x01012dc0      a194410501     mov eax, dword [0x1054194]  ; [0x1054194:4]=0
|       |   0x01012dc5      3bc6           cmp eax, esi
|      ,==< 0x01012dc7      0f8446b00100   je 0x102de13
|      ||   0x01012dcd      a194410501     mov eax, dword [0x1054194]  ; [0x1054194:4]=0
|      ||   0x01012dd2      85c0           test eax, eax
|     ,===< 0x01012dd4      0f85e54e0000   jne 0x1017cbf
|     |||   0x01012dda      893594410501   mov dword [0x1054194], esi  ; [0x1054194:4]=0


[0x01012d6c]> e asm.lines=false <<<<<<<<<<<<<<<
[0x01012d6c]> e asm.comments =false <<<<<<<<<<<
[0x01012d6c]> e asm.cmtright =false <<<<<<<<<<<<<<
[0x01012d6c]> e asm.fcnlines =false <<<<<<<<<<<<<


[0x01012d6c]> pd 10 @ $$+0x4b
0x01012db7      0f8538b00100   jne 0x102ddf5
0x01012dbd      33f6           xor esi, esi
0x01012dbf      46             inc esi
0x01012dc0      a194410501     mov eax, dword [0x1054194]
0x01012dc5      3bc6           cmp eax, esi
0x01012dc7      0f8446b00100   je 0x102de13
0x01012dcd      a194410501     mov eax, dword [0x1054194]
0x01012dd2      85c0           test eax, eax
0x01012dd4      0f85e54e0000   jne 0x1017cbf
0x01012dda      893594410501   mov dword [0x1054194], esi
[0x01012d6c]

and to remove the bytes use e asm.bytes = false

| improve this answer | |

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.