mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
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.
38 lines
No EOL
932 B
JavaScript
Executable file
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();
|
|
} |