| 7 | #include <cstring> |
| 8 | |
| 9 | void decode_bdv(char *buf, size_t buffer_size) { |
| 10 | int count = 0xa0; // First key |
| 11 | for (size_t i = 0; i < buffer_size; i++) { |
| 12 | if (buf[i] == '\r' && buf[i + 1] == '\n') count++; // Increment key on each new line |
| 13 | char x = buf[i]; |
| 14 | if (!(x == '\r' || x == '\n' || !x)) x = count - x; |
| 15 | if (count > 285) count = 159; |
| 16 | buf[i] = x; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | bool BDVFile::verifyFormat(std::vector<char> &buf) { |
| 21 | return find_str_in_buf("dd:1.3?,r?-=bb", buf) || |