Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 63607a6

Browse files
committed
Fix string decryption for Eazfuscator.NET 5.1
v5.1 changes a few instructions in , other than it's almost the same
1 parent 4c684bb commit 63607a6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

de4dot.code/deobfuscators/Eazfuscator_NET/StringDecrypter.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class StringDecrypter : IDisposable {
4747
EfConstantsReader stringMethodConsts;
4848
bool isV32OrLater;
4949
bool isV50OrLater;
50+
bool isV51OrLater;
5051
int? validStringDecrypterValue;
5152
DynamicDynocodeIterator dynocode;
5253
MethodDef realMethod;
@@ -429,11 +430,7 @@ static Local GetFlagsLocal(MethodDef method, int index) {
429430
return null;
430431
if (instrs[index++].OpCode.Code != Code.Ldc_I4_0)
431432
return null;
432-
if (instrs[index++].OpCode.Code != Code.Ceq)
433-
return null;
434-
if (instrs[index++].OpCode.Code != Code.Ldc_I4_0)
435-
return null;
436-
if (instrs[index++].OpCode.Code != Code.Ceq)
433+
if (instrs[index++].OpCode.Code != Code.Cgt_Un)
437434
return null;
438435
var stloc = instrs[index++];
439436
if (!stloc.IsStloc())
@@ -720,8 +717,8 @@ bool EmulateDynocode(InstructionEmulator emu, ref int index) {
720717

721718
if (index + 4 >= instrs.Count)
722719
return false;
723-
var ldloc = instrs[index + 3];
724-
var stfld = instrs[index + 4];
720+
var ldloc = instrs[index + 2];
721+
var stfld = instrs[index + 3];
725722
if (!ldloc.IsLdloc() || stfld.OpCode.Code != Code.Stfld)
726723
return false;
727724
var enumerableField = stfld.Operand as FieldDef;

0 commit comments

Comments
 (0)