mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
32 lines
No EOL
878 B
Text
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;
|
|
}
|
|
} |