Detect-It-Easy/db/python
2025-03-23 12:41:20 +03:00

32 lines
No EOL
878 B
Text

// Detect It Easy: detection rule file
// 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;
}
}