-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathhash
More file actions
188 lines (175 loc) · 9.72 KB
/
hash
File metadata and controls
188 lines (175 loc) · 9.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
NAME=t/md5sha1
FILE=-
CMDS=<<EOF
b 100
ph md5 64
ph md5 99
w hello world
ph md5 11
ph md5 @!11
ph sha1 11
ph pcprint
EOF
EXPECT=<<EOF
3b5d3c7d207e37dceeedd301e35e2e58
fa8715078d45101200a6e2bf7321aa04
5eb63bbbe01eeed093cb22bb8f5acdc3
5eb63bbbe01eeed093cb22bb8f5acdc3
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
0b
EOF
RUN
NAME=ph crc32
FILE=-
CMDS=<<EOF
b 12
w hello world
!rahash2 -qa crc16 -s "hello world"
ph crc16 11
!rahash2 -qa crc32 -s "hello world"
ph crc32 11
EOF
EXPECT=<<EOF
39c1
39c1
0d4a1185
0d4a1185
EOF
RUN
NAME=ph strhash
FILE=-
CMDS=<<EOF
b 9
w 123456789
ph strhash 9
EOF
EXPECT=<<EOF
94b4004c
EOF
RUN
NAME=ph sip
FILE=-
CMDS=<<EOF
w radare2
ph sip 7
EOF
EXPECT=<<EOF
9298f8d38e8f1b10
EOF
RUN
NAME=ph entropy
FILE=-
CMDS=<<EOF
w "hello world Shannon entropy"
ph entropy 0x1b
EOF
EXPECT=<<EOF
3.58785880
EOF
RUN
NAME=ph entropy
FILE=-
CMDS=<<EOF
w syscall
ph elf 7
EOF
EXPECT=<<EOF
5c98090b
EOF
RUN
NAME=crca 'hello world'
FILE=-
CMDS=<<EOF
b 12
w hello world
!rahash2 -qa rahash2 -a crc8smbus,crc15can,crc16hdlc,crc16usb,crc16citt,crc24,crc32c,crc32ecma267 -s "hello world"
ph crc8smbus 11
ph crc15can 11
ph crc16hdlc 11
ph crc16usb 11
ph crc16citt 11
ph crc24 11
ph crc32c 11
ph crc32ecma267 11
EOF
EXPECT=<<EOF
a8
727a
ae06
2238
efeb
b03cb7
c99465aa
ac86f845
a8
727a
ae06
2238
efeb
b03cb7
c99465aa
ac86f845
EOF
RUN
NAME=search count
FILE=bins/elf/analysis/x86-helloworld-gcc
CMDS=<<EOF
ph crc32 @ $$+10
/h crc32 83618b8a
EOF
EXPECT=<<EOF
83618b8a
0x804830a: crc32.83618b8a : 83618b8a
EOF
RUN
NAME=cmd.hit for /h*
FILE=malloc://1024
BROKEN=1
CMDS=<<EOF
e cmd.hit=p8 1
/h* md5 348a9791dc41b89796ec3808b5b5262f
EOF
EXPECT=<<EOF
f hash.md5.348a9791dc41b89796ec3808b5b5262f = 0x0
00
EOF
RUN
NAME=hit for /h*
FILE=malloc://1024
CMDS=<<EOF
/h* md5 348a9791dc41b89796ec3808b5b5262f
EOF
EXPECT=<<EOF
f hash.md5.348a9791dc41b89796ec3808b5b5262f = 0x0
EOF
RUN
NAME=hit for /h sha256
FILE=bins/firmware/main.bin
CMDS=<<EOF
e search.in =raw
/h sha256 83264abaf298b9238ca63cb2fd9ff0f41a7a1520ee2a17c56df459fc806de1d6 512
EOF
EXPECT=<<EOF
0x64: sha256.83264aba : 83264abaf298b9238ca63cb2fd9ff0f41a7a1520ee2a17c56df459fc806de1d6
EOF
RUN
NAME=hit for /h sip
FILE=bins/elf/true
CMDS=<<EOF
/h sip 0e227c61e887f956 500
f~sip
EOF
EXPECT=<<EOF
0x21fe: sip.0e227c61 : 0e227c61e887f956
0x000021fe 500 sip.0e227c61
EOF
RUN
NAME=phj
FILE=-
CMDS=<<EOF
phj
EOF
EXPECT=<<EOF
[{"name":"add","type":"hash","name":"add","desc":"Add checksum used by Tar (sum all bytes into ut32)","author":"pancake","license":"MIT"},{"name":"aes-ecb","type":"crypto","name":"aes-ecb","desc":"Rijndael block cipher with Electronic Code Book mode","author":"pancake","license":"MIT"},{"name":"aes-cbc","type":"crypto","name":"aes-cbc","desc":"Rijndael block cipher with Cipher Block Chaining mode","author":"pancake","license":"LGPL-3.0-only"},{"name":"aes-wrap","type":"crypto","name":"aes-wrap","desc":"Rijndael block cipher with Key Wrap Algorithm (RFC 3394)","author":"Sylvain Pelissier","license":"LGPL-3.0-only"},{"name":"base64","type":"crypto","name":"base64","desc":"Binary to text encoding scheme using 64 ascii characters","author":"rakholiyajenish.07","license":"LGPL-3.0-only"},{"name":"base91","type":"base","name":"base91","desc":"Binary to text encoding scheme using 91 ascii characters","author":"rakholiyajenish.07","license":"MIT"},{"name":"bech32","type":"base","name":"bech32","author":"W0nda","license":"BSD-3-Clause"},{"name":"blowfish","type":"crypto","name":"blowfish","desc":"Bruce Schneier's symetric-key block cipher","author":"pancake","license":"LGPL-3.0-only"},{"name":"arabic_iso","type":"charset","name":"arabic_iso","desc":"arabic ISO stub","license":"MIT"},{"name":"arabic_windows","type":"charset","name":"arabic_windows","desc":"arabic Windows stub","license":"MIT"},{"name":"ascii","type":"charset","name":"ascii","desc":"ASCII character set encoding/decoding","license":"MIT"},{"name":"ascii_ansi","type":"charset","name":"ascii_ansi","desc":"ASCII ANSI stub","license":"MIT"},{"name":"ascii_oem","type":"charset","name":"ascii_oem","desc":"ASCII OEM stub","license":"MIT"},{"name":"big5","type":"charset","name":"big5","desc":"Big5 stub","license":"MIT"},{"name":"cyrillic_iso","type":"charset","name":"cyrillic_iso","desc":"Cyrillic ISO stub","license":"MIT"},{"name":"cyrillic_windows","type":"charset","name":"cyrillic_windows","desc":"Windows-1251 (partial)","license":"MIT"},{"name":"ebcdic37","type":"charset","name":"ebcdic37","desc":"EBCDIC CP37 charset","license":"MIT"},{"name":"greek_iso","type":"charset","name":"greek_iso","desc":"Greek ISO stub","license":"MIT"},{"name":"greek_windows","type":"charset","name":"greek_windows","desc":"Windows-1253 (partial)","license":"MIT"},{"name":"hebrew_iso","type":"charset","name":"hebrew_iso","desc":"Hebrew ISO stub","license":"MIT"},{"name":"hebrew_windows","type":"charset","name":"hebrew_windows","desc":"Hebrew Windows stub","license":"MIT"},{"name":"hiragana","type":"charset","name":"hiragana","desc":"Hiragana stub","license":"MIT"},{"name":"iso8859_1","type":"charset","name":"iso8859_1","desc":"ISO-8859-1 charset","license":"MIT"},{"name":"iso_646","type":"charset","name":"iso_646","desc":"ISO 646 (IRV)","license":"MIT"},{"name":"jis7","type":"charset","name":"jis7","desc":"JIS 7-bit Roman (ASCII-like)","license":"MIT"},{"name":"katakana","type":"charset","name":"katakana","desc":"Katakana mapping (legacy-compatible)","license":"MIT"},{"name":"macintosh","type":"charset","name":"macintosh","desc":"Macintosh Roman (partial)","license":"MIT"},{"name":"pokemon","type":"charset","name":"pokemon","desc":"Transcode from/to Pokémon charset used in Gen 1 games","license":"MIT"},{"name":"pokered","type":"charset","name":"pokered","desc":"Pokemon Red charset","license":"MIT"},{"name":"cps2","type":"crypto","name":"cps2","desc":"Capcom Play System 2","author":"pof,esanfelix","license":"LGPL-3.0-only"},{"name":"des-ecb","type":"crypto","name":"des-ecb","desc":"DES with with Electronic Code Book mode","author":"deroad","license":"LGPL-3.0-only"},{"name":"ed25519","type":"sign","name":"ed25519","desc":"Elliptic curve pubkey cryptographic algorithm used for signing and verification","author":"Sylvain Pelissier","license":"Zlib"},{"name":"entropy","type":"hash","name":"entropy","desc":"Shannon entropy","author":"pancake","license":"MIT"},{"name":"md5","type":"hash","name":"md5","desc":"MD5 hash","author":"pancake","license":"MIT"},{"name":"null","type":"hash","name":"null","desc":"mutate nothing","author":"pancake","license":"MIT"},{"name":"punycode","type":"charset","name":"punycode","desc":"Unicoded represented in plain ascii","author":"pancake","license":"LGPL-3.0-only"},{"name":"rc2","type":"crypto","name":"rc2","desc":"Ron Rivest's Code symmetric key encryption also known as ARC2","author":"pancake","license":"LGPL-3.0-only"},{"name":"rc4","type":"crypto","name":"rc4","desc":"Rivest Cipher 4","author":"pancake","license":"LGPL-3.0-only"},{"name":"rc6","type":"crypto","name":"rc6","desc":"Rivest's Cipher 6","author":"pancake","license":"LGPL-3.0-only"},{"name":"rol","type":"crypto","name":"rol","desc":"Rotate Left N bits","author":"pancake","license":"LGPL-3.0-only"},{"name":"ror","type":"crypto","name":"ror","desc":"Rotate Right N bits","author":"pancake","license":"LGPL-3.0-only"},{"name":"rot","type":"crypto","name":"rot","desc":"Rotate Encryption","author":"pancake","license":"MIT"},{"name":"serpent-ecb","type":"crypto","name":"serpent-ecb","desc":"Serpent block cipher with Electronic Code Book mode","author":"pancake","license":"LGPL-3.0-only"},{"name":"sha1","type":"hash","name":"sha1","desc":"SHA1 hash","author":"pancake","license":"MIT"},{"name":"sha256","type":"hash","name":"sha256","desc":"SHA256 hash","author":"pancake","license":"MIT"},{"name":"sha384","type":"hash","name":"sha384","desc":"SHA384 hash","author":"pancake","license":"MIT"},{"name":"sha512","type":"hash","name":"sha512","desc":"SHA512 hash","author":"pancake","license":"MIT"},{"name":"sip","type":"hash","name":"sip","desc":"SipHash-2-4","author":"pancake","license":"MIT"},{"name":"sm4-ecb","type":"crypto","name":"sm4-ecb","desc":"ShāngMì4 block cipher with Electronic Code Book mode","author":"Sylvain Pelissier","license":"LGPL-3.0-only"},{"name":"strhash","type":"hash","name":"strhash","desc":"String hash using a modified DJB2 xor","author":"pancake","license":"MIT"},{"name":"xor","type":"crypto","name":"xor","desc":"Byte level Exclusive Or","author":"pancake","license":"MIT"},{"type":"hash","name":"md5"},{"type":"hash","name":"sha1"},{"type":"hash","name":"sha256"},{"type":"hash","name":"sha384"},{"type":"hash","name":"sha512"},{"type":"hash","name":"md4"},{"type":"hash","name":"xor"},{"type":"hash","name":"xorpair"},{"type":"hash","name":"parity"},{"type":"hash","name":"entropy"},{"type":"hash","name":"hamdist"},{"type":"hash","name":"pcprint"},{"type":"hash","name":"mod255"},{"type":"hash","name":"xxhash"},{"type":"hash","name":"adler32"},{"type":"hash","name":"luhn"},{"type":"hash","name":"ssdeep"},{"type":"hash","name":"crc8smbus"},{"type":"hash","name":"crc15can"},{"type":"hash","name":"crc16"},{"type":"hash","name":"crc16hdlc"},{"type":"hash","name":"crc16usb"},{"type":"hash","name":"crc16citt"},{"type":"hash","name":"crc24"},{"type":"hash","name":"crc32"},{"type":"hash","name":"crc32c"},{"type":"hash","name":"crc32ecma267"},{"type":"hash","name":"crc32bzip2"},{"type":"hash","name":"crc32d"},{"type":"hash","name":"crc32mpeg2"},{"type":"hash","name":"crc32posix"},{"type":"hash","name":"crc32q"},{"type":"hash","name":"crc32jamcrc"},{"type":"hash","name":"crc32xfer"},{"type":"hash","name":"crc64"},{"type":"hash","name":"crc64ecma"},{"type":"hash","name":"crc64we"},{"type":"hash","name":"crc64xz"},{"type":"hash","name":"crc64iso"},{"type":"hash","name":"fletcher8"},{"type":"hash","name":"fletcher16"},{"type":"hash","name":"fletcher32"},{"type":"hash","name":"fletcher64"},{"type":"hash","name":"elf"}]
EOF
RUN