[0x01012475]> / calc
Searching 4 bytes from 0x01001000 to 0x0101e960: 63 61 6c 63
# 3 [0x1001000-0x101e960]
hits: 3
0x0100161c hit1_0 "calc"
0x01015079 hit1_1 "\\u00ff\\u00ff\\u00ff\\u00ff"
0x01016679 hit1_2 "calc"
[0x01012475]> pdi 4 @ hit1_0
0x0100161c hit1_0:
0x0100161c 63616c arpl word [ecx + 0x6c], sp
0x0100161f 632e arpl word [esi], bp
0x01001621 7064 jo 0x1001687
0x01001623 6200 bound eax, qword [eax]
[0x01012475]> pdi 4 @ hit1_1
0x01015079 hit1_1:
0x01015079 ff invalid
0x0101507a ff invalid
0x0101507b ff invalid
0x0101507c ff invalid
[0x01012475]> pdi 4 @ hit1_2
0x01016679 hit1_2:
0x01016679 63616c arpl word [ecx + 0x6c], sp
0x0101667c 6322 arpl word [edx], sp
0x0101667e 0d0a202020 or eax, 0x2020200a
0x01016683 207072 and byte [eax + 0x72], dh
[0x01012475]>
or use regular expression
:>radare2 c:\WINDOWS\system32\calc.exe
-- Nothing to see here. Move along.
[0x01012475]> / calc
Searching 4 bytes from 0x01001000 to 0x0101e960: 63 61 6c 63
# 3 [0x1001000-0x101e960]
hits: 3
0x0100161c hit0_0 "calc"
0x01015079 hit0_1 "\\u00ff\\u00ff\\u00ff\\u00ff"
0x01016679 hit0_2 "calc"
[0x01012475]> pdi 4 @@ hit*
0x0100161c hit0_0:
0x0100161c 63616c arpl word [ecx + 0x6c], sp
0x0100161f 632e arpl word [esi], bp
0x01001621 7064 jo 0x1001687
0x01001623 6200 bound eax, qword [eax]
0x01015079 hit0_1:
0x01015079 ff invalid
0x0101507a ff invalid
0x0101507b ff invalid
0x0101507c ff invalid
0x01016679 hit0_2:
0x01016679 63616c arpl word [ecx + 0x6c], sp
0x0101667c 6322 arpl word [edx], sp
0x0101667e 0d0a202020 or eax, 0x2020200a
0x01016683 207072 and byte [eax + 0x72], dh
[0x01012475]>
You could also use an iterator: pid 4 @@ `/ ls`
.
Thanks jvoisin for the edit
[0x01012475]> px @@ `/ calc`
Searching 4 bytes from 0x01001000 to 0x0101e960: 63 61 6c 63
# 3 [0x1001000-0x101e960]
hits: 2
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
0x0100161c 6361 6c63 2e70 6462 0000 calc.pdb..
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
0x01016679 6361 6c63 220d 0a20 2020 calc"..
[0x01012475]>
hit6_0
will give you the address of the first match. Is that what you're looking for?