Detect-It-Easy/db/PE/sqlite.4.sg
DosX 8f3bc4d4ce Improve SQLite version detection logic
Refactored the detect() function to extract the SQLite version dynamically from library or export function names using regex. This enhances flexibility and reduces hardcoded checks for specific versions.
2025-09-07 22:03:09 +03:00

38 lines
No EOL
932 B
JavaScript
Executable file

// Detect It Easy: detection rule file
// Author: DosX
// E-Mail: collab@kay-software.ru
// GitHub: https://github.com/DosX-dev
// Telegram: @DosX_dev
meta("library", "SQLite");
function detect() {
var sLibrary = PE.isLibraryPresentExp(/sqlite\d+/i);
if (sLibrary) {
var match = /sqlite(\d+)/i.exec(sLibrary);
if (match) {
sVersion = match[1];
}
bDetected = true;
} else {
var sExportFunction = PE.isExportFunctionPresentExp(/sqlite\d+/i);
if (sExportFunction) {
sOptions = "EAT";
var match = /sqlite(\d+)/i.exec(sExportFunction);
if (match) {
sVersion = match[1];
}
bDetected = true;
} else if (PE.isLibraryPresentExp(/sqlite|sqlmin|sqllang|sqltses|sqldk/i)) {
bDetected = true;
}
}
return result();
}