Detect-It-Easy/db/python
DosX 33711a0407 Add standard DiE-JS framework header to db files
Added a standard header comment to all db framework and detection rule files, indicating they are part of the Detect It Easy (DiE-JS) framework and warning against unauthorized changes. This improves consistency and clarifies file purpose for maintainers.
2025-08-27 23:21:24 +03:00

33 lines
No EOL
948 B
Text

// Detect It Easy: DiE-JS framework file
// Don't change anything unless you're sure about what you're doing
// Author: DosX
// E-Mail: collab@kay-software.ru
// GitHub: https://github.com/DosX-dev
// Telegram: @DosX_dev
function getPythonVersionByDll(dllFileName) { // python = 💩
var version = "";
var startIndex = dllFileName.indexOf("python");
if (startIndex !== -1) {
startIndex += 6;
var endIndex = dllFileName.indexOf(".", startIndex);
if (endIndex === -1) {
endIndex = dllFileName.length;
}
version = dllFileName.substring(startIndex, endIndex);
}
if (version !== "") {
if (version.length === 1) {
return version + ".0";
} else if (version.length === 2) {
return version[0] + "." + version[1];
} else {
return version[0] + "." + version.substring(1);
}
} else {
return null;
}
}