Skip to content

Commit

Permalink
Convert one-line CMDS=<<EOF to single-line CMDS= (radareorg#16150)
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored Mar 5, 2020
1 parent d5fe33b commit dde3f0c
Show file tree
Hide file tree
Showing 440 changed files with 1,321 additions and 3,963 deletions.
84 changes: 21 additions & 63 deletions test/new/db/anal/8051
Original file line number Diff line number Diff line change
Expand Up @@ -40,207 +40,165 @@ FILE=malloc://32
EXPECT=<<EOF
size: 2
EOF
CMDS=<<EOF
e asm.arch=8051 ; wx d8fc ; ao 1~size
EOF
CMDS=e asm.arch=8051 ; wx d8fc ; ao 1~size
RUN

NAME=8051: [ACALL addr11] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001723
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx f123 ; ao 1~jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx f123 ; ao 1~jump
RUN

NAME=8051: [AJMP addr11] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001723
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx e123 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx e123 ; ao 1~^jump
RUN

NAME=8051: [CJNE a,imm,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001216
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx b4ab13 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx b4ab13 ; ao 1~^jump
RUN

NAME=8051: [CJNE a,dir,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x0000121b
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx b56018 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx b56018 ; ao 1~^jump
RUN

NAME=8051: [CJNE @r1,imm,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001235
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx b72432 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx b72432 ; ao 1~^jump
RUN

NAME=8051: [CJNE r7,imm,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001208
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx bf0205 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx bf0205 ; ao 1~^jump
RUN

NAME=8051: [DJNZ dir,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x0000118b
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx d54088 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx d54088 ; ao 1~^jump
RUN

NAME=8051: [DJNZ r0,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x000011fe
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx d8fc ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx d8fc ; ao 1~^jump
RUN

NAME=8051: [DJNZ r0,offs] - length check
FILE=malloc://32
EXPECT=<<EOF
size: 2
EOF
CMDS=<<EOF
e asm.arch=8051 ; wx d8fc ; ao 1~size
EOF
CMDS=e asm.arch=8051 ; wx d8fc ; ao 1~size
RUN

NAME=8051: [DJNZ r7,offs] - length check
FILE=malloc://32
EXPECT=<<EOF
size: 2
EOF
CMDS=<<EOF
e asm.arch=8051 ; wx dffa ; ao 1~size
EOF
CMDS=e asm.arch=8051 ; wx dffa ; ao 1~size
RUN

NAME=8051: [JB bit,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001206
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 207d03 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 207d03 ; ao 1~^jump
RUN

NAME=8051: [JBC bit,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x0000120b
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 101508 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 101508 ; ao 1~^jump
RUN

NAME=8051: [JC offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001205
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 4003 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 4003 ; ao 1~^jump
RUN

NAME=8051: [JNB bit,offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x0000120b
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 305108 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 305108 ; ao 1~^jump
RUN

NAME=8051: [JNC offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001209
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 5007 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 5007 ; ao 1~^jump
RUN

NAME=8051: [JNZ offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001215
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 7013 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 7013 ; ao 1~^jump
RUN

NAME=8051: [JZ offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001217
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 6015 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 6015 ; ao 1~^jump
RUN

NAME=8051: [LCALL add16] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x0000b6cf
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 12b6cf ; ao 1~jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 12b6cf ; ao 1~jump
RUN

NAME=8051: [LJMP addr16] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00002c0d
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 022c0d ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 022c0d ; ao 1~^jump
RUN

NAME=8051: [SJMP offs] - jump check
FILE=malloc://10000
EXPECT=<<EOF
jump: 0x00001216
EOF
CMDS=<<EOF
e asm.arch=8051 ; s 0x1200 ; wx 8014 ; ao 1~^jump
EOF
CMDS=e asm.arch=8051 ; s 0x1200 ; wx 8014 ; ao 1~^jump
RUN
4 changes: 1 addition & 3 deletions test/new/db/anal/arm
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,7 @@ RUN
NAME=arm thumb basic block detection with ITTE
BROKEN=1
FILE=../../bins/elf/analysis/bug-it-bb
CMDS=<<EOF
aaa ; s 0x00010074 ; afb
EOF
CMDS=aaa ; s 0x00010074 ; afb
EXPECT=<<EOF
0x00010074 0x0001007a 00:0000 6 j 0x0001007a f 0x0001007e 0x0001007a 0x0001007e 00:0000 4 j 0x00010080 0x0001007e 0x00010080 00:0000 2 j 0x00010080 0x00010080 0x00010082 00:0000 2
EOF
Expand Down
16 changes: 4 additions & 12 deletions test/new/db/anal/avr
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ FILE=../bins/firmware/arduino_avr.bin
EXPECT=<<EOF
1
EOF
CMDS=<<EOF
pd 1 @ 0x00000170~?IO
EOF
CMDS=pd 1 @ 0x00000170~?IO
RUN

NAME=avr br - forward branch
Expand Down Expand Up @@ -374,9 +372,7 @@ EXPECT=<<EOF
0x00000276 # 2: ldi r22, 0x6d
EOF
ARGS=-a avr
CMDS=<<EOF
/ad ldi~0x6d
EOF
CMDS=/ad ldi~0x6d
RUN

NAME=search asm commands with filter
Expand All @@ -386,9 +382,7 @@ EXPECT=<<EOF
0x000019a4 # 2: ldi r18, 0x18
EOF
ARGS=-a avr
CMDS=<<EOF
/ad ldi ~ 0x18
EOF
CMDS=/ad ldi ~ 0x18
RUN

NAME=search asm commands with filter and align = 2
Expand Down Expand Up @@ -595,7 +589,5 @@ EXPECT=<<EOF
0x0000002e 0x00000032 00:0000 4 j 0x00000032
0x00000032 0x00000040 00:0000 14
EOF
CMDS=<<EOF
[email protected];[email protected]
EOF
[email protected];[email protected]
RUN
12 changes: 3 additions & 9 deletions test/new/db/anal/dalvik
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,21 @@ EXPECT=<<EOF
0x000002f4 1 20 method.public.constructor.LWorld.LWorld.method._init___V
0x00000318 1 68 method.public.LWorld.LWorld.method.foo_I_V
EOF
CMDS=<<EOF
e io.va=0; aa; afl
EOF
CMDS=e io.va=0; aa; afl
RUN

NAME=Dalvik HelloWorld string xref
FILE=../bins/dex/HelloWorld.dex
EXPECT=<<EOF
entry0 0x260 [DATA] const-string v1, str.Findus
EOF
CMDS=<<EOF
aa; axt @ str.Findus
EOF
CMDS=aa; axt @ str.Findus
RUN

NAME=Dalvik HelloWorld func xref
FILE=../bins/dex/HelloWorld.dex
EXPECT=<<EOF
entry0 0x26e [CALL] invoke-direct {v0}, LHello.<init>()V ; 0x0
EOF
CMDS=<<EOF
e io.va=0; aa; axt @ sym.LHello.method._init___V
EOF
CMDS=e io.va=0; aa; axt @ sym.LHello.method._init___V
RUN
28 changes: 7 additions & 21 deletions test/new/db/anal/java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ FILE=../bins/java/jdwpexeccmd.class
EXPECT=<<EOF
{"access_flags":33,"is_public":1,"is_final":0,"is_super":1,"is_interface":0,"is_abstract":0,"is_synthetic":0,"is_annotation":0,"is_enum":0,"name":"JDWPExecCmd","super":"java/lang/Object","interfaces":[],"methods":[],"fields":[],"imports":[]}
EOF
CMDS=<<EOF
java prototypes j
EOF
CMDS=java prototypes j
RUN

NAME=java prototypes in ascii
FILE=../bins/java/jdwpexeccmd.class
CMDS=<<EOF
java prototypes a
EOF
CMDS=java prototypes a
EXPECT=<<EOF
import java.lang.StringBuilder;
import java.io.BufferedReader;
Expand All @@ -39,18 +35,14 @@ RUN

NAME=java huge switch case crash
FILE=../../bins/java/sjybq.class
CMDS=<<EOF
e asm.arch=java e scr.null=true pd 200
EOF
CMDS=e asm.arch=java e scr.null=true pd 200
EXPECT=<<EOF
EOF
RUN

NAME=use java prototypes command to print methods and fields
FILE=malloc://4096
CMDS=<<EOF
e asm.comments=false ; e asm.cmt.flgrefs=false ; e scr.color=false ; e asm.lines.bb=false ; e asm.xrefs=false ; wx cafebabe0000002f004008002208003a08003c0700310700360700370700380700390900040019090004001c090004001d0a000400170a000400180a0006001e0a0006001f0a000600200a000700160a0007001a0a0007001b0a000700210a000800160c002e00250c0031002b0c0031002c0c003100300c003200260c0032002a0c003300300c003400300c003500270c003b00230c003d00280c003e002401000001000328294901001428294c6a6176612f6c616e672f537472696e673b01000328295601001b2843294c6a6176612f6c616e672f537472696e674275666665723b01000428492943010016284949294c6a6176612f6c616e672f537472696e673b010026284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e673b01002c284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e674275666665723b010038284c6a6176612f6c616e672f537472696e673b4c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e673b01004a284c6a6176612f6c616e672f537472696e673b4c6a6176612f6c616e672f537472696e673b4c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e673b0100083c636c696e69743e0100063c696e69743e010004436f64650100124c6a6176612f6c616e672f537472696e673b01000161010006617070656e6401000162010001630100066368617241740100136a6176612f6c616e672f457863657074696f6e0100106a6176612f6c616e672f537472696e670100166a6176612f6c616e672f537472696e674275666665720100106a6176612f7574696c2f566563746f720100086b77696373356a650100066c656e6774680100086f736d666e73656e010009737562737472696e67010008746f537472696e67010008537461636b4d617000310004000800000003000a003100300000000a003300300000000a00340030000000050001002e00250001002f0000001100010001000000052ab70015b1000000000009003100290001002f0000002300030001000000172ab20009b2000ab8000db3000b2ab2000bb8000c594bb000000000000a0031002c0001002f000000dc00040005000000572ab6000f3b12014e04360415049900442db6000f1aa20036bb000759b700112db600132bb600132cb60013b600144cbb000759b700112db600132b031008b60010b60013b600144ea7ffc8033604a7ffbda70004572db00001000b0051005400050001003f0000006b0006000b0005010700060700060700060100000010000501070006070006070006010000004b000501070006070006070006010000005100050107000607000607000601000000540005010700060700060700060100010700050055000501070006070006070006010000000a0031002b0001002f000000bc000400040000003dbb000759b700114d043e1d990029033e1d2ab6000fa2001a2c2a1db6000e2b1db6000e8292b6001257840301a7ffe4033ea7ffd9a70004572cb60014b00001000a0034003700050001003f000000650006000a000407000607000607000701000000100004070006070006070007010000002f00040700060700060700070100000034000407000607000607000701000000370004070006070006070007010001070005003800040700060700060700070100000008002d00250001002f0000001c00010000000000101202b300091203b3000a1201b3000bb1000000000000 ; ib ; af ; java prototypes m ; java prototypes f
EOF
CMDS=e asm.comments=false ; e asm.cmt.flgrefs=false ; e scr.color=false ; e asm.lines.bb=false ; e asm.xrefs=false ; wx cafebabe0000002f004008002208003a08003c0700310700360700370700380700390900040019090004001c090004001d0a000400170a000400180a0006001e0a0006001f0a000600200a000700160a0007001a0a0007001b0a000700210a000800160c002e00250c0031002b0c0031002c0c003100300c003200260c0032002a0c003300300c003400300c003500270c003b00230c003d00280c003e002401000001000328294901001428294c6a6176612f6c616e672f537472696e673b01000328295601001b2843294c6a6176612f6c616e672f537472696e674275666665723b01000428492943010016284949294c6a6176612f6c616e672f537472696e673b010026284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e673b01002c284c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e674275666665723b010038284c6a6176612f6c616e672f537472696e673b4c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e673b01004a284c6a6176612f6c616e672f537472696e673b4c6a6176612f6c616e672f537472696e673b4c6a6176612f6c616e672f537472696e673b294c6a6176612f6c616e672f537472696e673b0100083c636c696e69743e0100063c696e69743e010004436f64650100124c6a6176612f6c616e672f537472696e673b01000161010006617070656e6401000162010001630100066368617241740100136a6176612f6c616e672f457863657074696f6e0100106a6176612f6c616e672f537472696e670100166a6176612f6c616e672f537472696e674275666665720100106a6176612f7574696c2f566563746f720100086b77696373356a650100066c656e6774680100086f736d666e73656e010009737562737472696e67010008746f537472696e67010008537461636b4d617000310004000800000003000a003100300000000a003300300000000a00340030000000050001002e00250001002f0000001100010001000000052ab70015b1000000000009003100290001002f0000002300030001000000172ab20009b2000ab8000db3000b2ab2000bb8000c594bb000000000000a0031002c0001002f000000dc00040005000000572ab6000f3b12014e04360415049900442db6000f1aa20036bb000759b700112db600132bb600132cb60013b600144cbb000759b700112db600132b031008b60010b60013b600144ea7ffc8033604a7ffbda70004572db00001000b0051005400050001003f0000006b0006000b0005010700060700060700060100000010000501070006070006070006010000004b000501070006070006070006010000005100050107000607000607000601000000540005010700060700060700060100010700050055000501070006070006070006010000000a0031002b0001002f000000bc000400040000003dbb000759b700114d043e1d990029033e1d2ab6000fa2001a2c2a1db6000e2b1db6000e8292b6001257840301a7ffe4033ea7ffd9a70004572cb60014b00001000a0034003700050001003f000000650006000a000407000607000607000701000000100004070006070006070007010000002f00040700060700060700070100000034000407000607000607000701000000370004070006070006070007010001070005003800040700060700060700070100000008002d00250001002f0000001c00010000000000101202b300091203b3000a1201b3000bb1000000000000 ; ib ; af ; java prototypes m ; java prototypes f
EXPECT=<<EOF
public void <init> (); // @0x02eb
public static java.lang.String a (java.lang.String); // @0x030a
Expand Down Expand Up @@ -356,9 +348,7 @@ RUN

NAME=java summary
FILE=zip://../bins/java/example.zip::0
CMDS=<<EOF
java summary
EOF
CMDS=java summary
EXPECT=<<EOF
Summary for zip://../bins/java/example.zip::0:
Size 0x0:
Expand All @@ -372,9 +362,7 @@ RUN

NAME=java prototypes a
FILE=zip://../bins/java/example.zip::0
CMDS=<<EOF
java prototypes a
EOF
CMDS=java prototypes a
EXPECT=<<EOF
import java.lang.Object;
import java.lang.String;
Expand Down Expand Up @@ -446,9 +434,7 @@ RUN

NAME=java f_info s
FILE=zip://../bins/java/example.zip::0
CMDS=<<EOF
java f_info s
EOF
CMDS=java f_info s
EXPECT=<<EOF
Field Summary Information:
File Offset: 0x00000287
Expand Down
4 changes: 1 addition & 3 deletions test/new/db/anal/m68k
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ FILE=../bins/smd/LiquidSpaceDodgerV3.bin
EXPECT=<<EOF
0x000009f2
EOF
CMDS=<<EOF
ao @ 0x00000230~jump[1]
EOF
CMDS=ao @ 0x00000230~jump[1]
RUN
Loading

0 comments on commit dde3f0c

Please sign in to comment.