Correct magic hit numbering and move base64 into magic

This commit is contained in:
Sylvain Pelissier 2022-10-14 11:21:00 +02:00 committed by pancake
parent 21b264024b
commit 5328afc86b
4 changed files with 20 additions and 4 deletions

View File

@ -131,6 +131,7 @@ static int r_core_magic_at(RCore *core, RSearchKeyword *kw, const char *file, ut
// We do not flag for pm command.
if (kw) {
flag = r_str_newf ("%s%d_%d", searchprefix, kw->kwidx, kw->count);
kw->count++;
r_flag_set (core->flags, flag, addr + adelta, 1);
}
// TODO: This must be a callback .. move this into RSearch?

View File

@ -3859,10 +3859,6 @@ reread:
kw = r_search_keyword_new_hexmask ("01020408102040801b366cc0ab4d9a2f5ebf63c697356ad4b37dfaefc591", NULL); // AES
r_search_kw_add (search, kw);
// base64
kw = r_search_keyword_new_str ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", NULL, NULL, false);
r_search_kw_add (search, kw);
// blowfish
if (le) {
// LE blowfish

View File

@ -0,0 +1,8 @@
#Base64 index tables
0 string ABCDEFGHIJKLMNOPQRSTUVWXYZabcde
> 31 string fghijklmnopqrstuvwxyz0123456789
> 62 string +/ Base64 standard index table
0 string ACEGIKMOQSUWYBDFHJLNPRTVXZacegi
> 31 string kmoqsuwybdfhjlnprtvxz0246813579
> 62 string \=+ Base64 SerComm index table

View File

@ -72,4 +72,15 @@ EOF
EXPECT=<<EOF
0x00000000 1 magic0_0 Binary PLIST data stream
EOF
RUN
NAME=/m on Zip
FILE=bins/zip/CDinFN.zip
CMDS=<<EOF
/m
EOF
EXPECT=<<EOF
0x00000000 1 hit0_0 ZIP Zip archive data, at least v1.0 to extract
0x00000062 1 hit0_1 End of Zip archive
EOF
RUN