mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
Refactor IL2CPP section detection logic
Improve IL2CPP detection by introducing an isIl2cpp flag and a regex check for .rtc sections (PE.isSectionNamePresentExp(/^\.rtc\$[IT](?:AA|ZZ)$/)). Collapse and reorder the section-name checks into a smaller array and defer setting the compiler/lang result until after detection completes. This makes the detection flow clearer and handles .rtc variants more reliably.
This commit is contained in:
parent
55f957fc77
commit
25cd07ea3a
1 changed files with 20 additions and 14 deletions
|
|
@ -5927,28 +5927,34 @@ function scanForLanguagesAndCompilers_NET_and_Native() {
|
|||
// Detect IL2CPP by sections (thanks to AyukiDev)
|
||||
|
||||
if (!isCompilerDetected()) {
|
||||
const il2cppSections = [
|
||||
".text$mn",
|
||||
".rdata$zzzdbg",
|
||||
".rtc$IAA",
|
||||
".rtc$IZZ",
|
||||
".rtc$TAA",
|
||||
".rtc$TZZ",
|
||||
"il2cpp"
|
||||
];
|
||||
var isIl2cpp = false;
|
||||
|
||||
for (var i = 0; i < il2cppSections.length; i++) {
|
||||
if (PE.isSectionNamePresent(il2cppSections[i])) {
|
||||
_setResult("~compiler", "IL2CPP Technology", String(), String());
|
||||
_setLangByHeur("Native MSIL/C#");
|
||||
break;
|
||||
if (PE.isSectionNamePresentExp(/^\.rtc\$[IT](?:AA|ZZ)$/)) {
|
||||
isIl2cpp = true;
|
||||
} else {
|
||||
const il2cppSections = [
|
||||
"il2cpp",
|
||||
".text$mn",
|
||||
".rdata$zzzdbg"
|
||||
];
|
||||
|
||||
for (var i = 0; i < il2cppSections.length && !isIl2cpp; i++) {
|
||||
if (PE.isSectionNamePresent(il2cppSections[i])) {
|
||||
isIl2cpp = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isIl2cpp) {
|
||||
_setResult("~compiler", "IL2CPP Technology", String(), String());
|
||||
_setLangByHeur("Native MSIL/C#");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var isCLikeLibsNotFound = !isCLibraryPresent && !isPpLibraryPresent;
|
||||
|
||||
var majorLinkerVersion = PE.getMajorLinkerVersion(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue