Assume AVR bins have no strings

This commit is contained in:
pancake 2016-07-04 16:28:58 +02:00
parent a81d667b53
commit 04de3e657f
2 changed files with 41 additions and 35 deletions

View File

@ -120,6 +120,10 @@ static RList* symbols(RBinFile *arch) {
return ret; return ret;
} }
static RList* strings (RBinFile *arch) {
return NULL;
}
RBinPlugin r_bin_plugin_avr = { RBinPlugin r_bin_plugin_avr = {
.name = "avr", .name = "avr",
.desc = "ATmel AVR MCUs", .desc = "ATmel AVR MCUs",
@ -130,8 +134,7 @@ RBinPlugin r_bin_plugin_avr = {
.symbols = &symbols, .symbols = &symbols,
.check_bytes = &check_bytes, .check_bytes = &check_bytes,
.info = &info, .info = &info,
.minstrlen = 10, .strings = &strings,
.strfilter = 'U'
}; };
#ifndef CORELIB #ifndef CORELIB

View File

@ -201,8 +201,9 @@ static bool string_filter(RCore *core, const char *str) {
case 'a': // only alphanumeric - plain ascii case 'a': // only alphanumeric - plain ascii
for (i = 0; str[i]; i++) { for (i = 0; str[i]; i++) {
char ch = str[i]; char ch = str[i];
if (ch<0 || !IS_PRINTABLE (ch)) if (ch < 1 || !IS_PRINTABLE (ch)) {
return false; return false;
}
} }
break; break;
case 'e': // emails case 'e': // emails
@ -224,44 +225,46 @@ static bool string_filter(RCore *core, const char *str) {
return false; return false;
break; break;
case 'i': //IPV4 case 'i': //IPV4
{ {
int segment = 0; int segment = 0;
int segmentsum = 0; int segmentsum = 0;
bool prevd = false; bool prevd = false;
for (i = 0; str[i]; i++) { for (i = 0; str[i]; i++) {
char ch = str[i]; char ch = str[i];
if (ch >= '0' && ch <='9') { if (ch >= '0' && ch <= '9') {
segmentsum = segmentsum*10 + (ch - '0'); segmentsum = segmentsum*10 + (ch - '0');
if (segment == 3 ) if (segment == 3) {
return true; return true;
prevd = true; }
} else if (ch == '.') { prevd = true;
if (prevd == true && segmentsum < 256){ } else if (ch == '.') {
segment++; if (prevd == true && segmentsum < 256){
segmentsum = 0; segment++;
} else { segmentsum = 0;
segmentsum = 0; } else {
segment = 0; segmentsum = 0;
} segment = 0;
prevd = false; }
} else { prevd = false;
segmentsum = 0; } else {
prevd = false; segmentsum = 0;
segment = 0; prevd = false;
} segment = 0;
} }
return false; }
}
case 'p': // path
if (str[0] != '/')
return false; return false;
}
case 'p': // path
if (str[0] != '/') {
return false;
}
break; break;
case '8': // utf8 case '8': // utf8
for (i = 0; str[i]; i++) { for (i = 0; str[i]; i++) {
char ch = str[i]; char ch = str[i];
if (ch<0) if (ch < 0) {
return true; return true;
}
} }
return false; return false;
break; break;