Detect ILP
This commit is contained in:
parent
bff92e02e7
commit
b844dbc428
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using de4dot.blocks;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.Unknown {
|
namespace de4dot.code.deobfuscators.Unknown {
|
||||||
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
||||||
|
@ -72,7 +73,7 @@ namespace de4dot.code.deobfuscators.Unknown {
|
||||||
|
|
||||||
void setName(string name) {
|
void setName(string name) {
|
||||||
if (obfuscatorName == null && name != null)
|
if (obfuscatorName == null && name != null)
|
||||||
obfuscatorName = name;
|
obfuscatorName = string.Format("{0} (not supported)", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int earlyDetect() {
|
public override int earlyDetect() {
|
||||||
|
@ -97,6 +98,8 @@ namespace de4dot.code.deobfuscators.Unknown {
|
||||||
}
|
}
|
||||||
|
|
||||||
string scanTypes() {
|
string scanTypes() {
|
||||||
|
if (checkILProtector())
|
||||||
|
return "ILProtector";
|
||||||
foreach (var type in module.Types) {
|
foreach (var type in module.Types) {
|
||||||
if (type.FullName == "ZYXDNGuarder")
|
if (type.FullName == "ZYXDNGuarder")
|
||||||
return "DNGuard HVM";
|
return "DNGuard HVM";
|
||||||
|
@ -110,6 +113,27 @@ namespace de4dot.code.deobfuscators.Unknown {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static string[] ilpLocals = new string[] {
|
||||||
|
"System.Boolean",
|
||||||
|
"System.IntPtr",
|
||||||
|
"System.Object[]",
|
||||||
|
};
|
||||||
|
bool checkILProtector() {
|
||||||
|
var cctor = DotNetUtils.getModuleTypeCctor(module);
|
||||||
|
if (cctor == null)
|
||||||
|
return false;
|
||||||
|
if (!new LocalTypes(cctor).exactly(ilpLocals))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var type = cctor.DeclaringType;
|
||||||
|
if (!DotNetUtils.hasPinvokeMethod(type, "Protect") && !DotNetUtils.hasPinvokeMethod(type, "P0"))
|
||||||
|
return false;
|
||||||
|
if (type.Fields.Count != 1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public override IEnumerable<int> getStringDecrypterMethods() {
|
public override IEnumerable<int> getStringDecrypterMethods() {
|
||||||
return new List<int>();
|
return new List<int>();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user