Improve iClass SIO and legacy credential detection to improve

reliability. Now relies on the legacy config block for SR detection
and the end-of-SIO detection no longer partially cuts off the SIO
for any dumps I have.
This commit is contained in:
nvx committed 2023-08-23 09:27:05 +10:00
1 parent 4547a1beba
commit a2a3142355
5 files changed
+85 -47

No files matched your search

+19
View File
@@ -1289,6 +1289,25 @@ int byte_strstr(const uint8_t *src, size_t srclen, const uint8_t *pattern, size_
return -1;
}
int byte_strrstr(const uint8_t *src, size_t srclen, const uint8_t *pattern, size_t plen) {
for (int i = srclen - plen; i >= 0; i--) {
// compare only first byte
if (src[i] != pattern[0])
continue;
// try to match rest of the pattern
for (int j = plen - 1; j >= 1; j--) {
if (src[i + j] != pattern[j])
break;
if (j == 1)
return i;
}
}
return -1;
}
void sb_append_char(smartbuf *sb, unsigned char c) {
if (sb->idx >= sb->size) {
sb->size *= 2;