The 'wo' write command accepts multiple kinds of operations that can be applied on the curren block. This is for example a XOR
, ADD
, SUB
, ...
[0x4A13B8C0]> wo?
Usage: wo[xrlasmd] [hexpairs]
Example: wox 90 ; xor cur block with 90
Example: woa 02 03 ; add 2, 3 to all bytes of cur block
Supported operations:
woa addition +=
wos substraction -=
wom multiply *=
wod divide /=
wox xor ^=
woo or |=
woA and &=
wor shift right >>=
wol shift left <<=
This way it is possible to implement ciphering algorithms using radare core primitives.
A sample session doing a xor(90) + addition(01 02)
[0x4A13B8C0]> x
offset 0 1 2 3 4 5 6 7 8 9 A B C D 0123456789ABCD
0x4A13B8C0, 89e0 e839 0700 0089 c7e8 e2ff ffff ...9..........
0x4A13B8CE 81c3 eea6 0100 8b83 08ff ffff 5a8d ............Z.
0x4A13B8DC, 2484 29c2 528b 8344 0000 008d 7494 $.).R..D....t.
0x4A13B8EA 088d 4c24 0489 e583 e4f0 5050 5556 ..L$......PPUV
0x4A13B8F8, 31ed e8f1 d400 008d 93a4 31ff ff8b 1.........1...
0x4A13B906 2424 ffe7 8db6 0000 0000 e8b2 4f01 $$..........O.
0x4A13B914, 0081 c1a7 a601 0055 89e5 5d8d 814c .......U..]..L
0x4A13B922 0600 ..
[0x4A13B8C0]> wox 90
[0x4A13B8C0]> x
offset 0 1 2 3 4 5 6 7 8 9 A B C D 0123456789ABCD
0x4A13B8C0, 1970 78a9 9790 9019 5778 726f 6f6f .px.....Wxrooo
0x4A13B8CE 1153 7e36 9190 1b13 986f 6f6f ca1d .S~6.....ooo..
0x4A13B8DC, b414 b952 c21b 13d4 9090 901d e404 ...R..........
0x4A13B8EA 981d dcb4 9419 7513 7460 c0c0 c5c6 ......u.t`....
0x4A13B8F8, a17d 7861 4490 901d 0334 a16f 6f1b .}xaD....4.oo.
0x4A13B906 b4b4 6f77 1d26 9090 9090 7822 df91 ..ow.&....x"..
0x4A13B914, 9011 5137 3691 90c5 1975 cd1d 11dc ..Q76....u....
0x4A13B922 9690 ..
[0x4A13B8C0]> woa 01 02
[0x4A13B8C0]> x
offset 0 1 2 3 4 5 6 7 8 9 A B C D 0123456789ABCD
0x4A13B8C0, 1a72 79ab 9892 911b 587a 7371 7071 .ry.....Xzsqpq
0x4A13B8CE 1255 7f38 9292 1c15 9971 7071 cb1f .U.8.....qpq..
0x4A13B8DC, b516 ba54 c31d 14d6 9192 911f e506 ...T..........
0x4A13B8EA 991f ddb6 951b 7615 7562 c1c2 c6c8 ......v.ub....
0x4A13B8F8, a27f 7963 4592 911f 0436 a271 701d ..ycE....6.qp.
0x4A13B906 b5b6 7079 1e28 9192 9192 7924 e093 ..py.(....y$..
0x4A13B914, 9113 5239 3793 91c7 1a77 ce1f 12de ..R97....w....
0x4A13B922 9792 ..