diff --git a/Editor/EncryptionVM/Instructions/AddInstruction.cs b/Editor/EncryptionVM/Instructions/AddInstruction.cs index 2681fff..7a93633 100644 --- a/Editor/EncryptionVM/Instructions/AddInstruction.cs +++ b/Editor/EncryptionVM/Instructions/AddInstruction.cs @@ -29,7 +29,7 @@ namespace Obfuz.EncryptionVM.Instructions public override void GenerateDecryptCode(List lines, string indent) { - lines.Add(indent + $"value = ((value - {_addValue}) ^ salt) - _secretKey[{_opKeyIndex}];"); + lines.Add(indent + $"value = ((value - {_addValue}) ^ salt) - _secretKey[{_opKeyIndex}];"); } } } diff --git a/Editor/EncryptionVM/Instructions/MultipleInstruction.cs b/Editor/EncryptionVM/Instructions/MultipleInstruction.cs index a788a67..e7f6cd7 100644 --- a/Editor/EncryptionVM/Instructions/MultipleInstruction.cs +++ b/Editor/EncryptionVM/Instructions/MultipleInstruction.cs @@ -35,7 +35,7 @@ namespace Obfuz.EncryptionVM.Instructions public override void GenerateEncryptCode(List lines, string indent) { - lines.Add(indent + $"value = value * {_multiValue} + _secretKey[{_opKeyIndex}] + salt;"); + lines.Add(indent + $"value = value * {_multiValue} + _secretKey[{_opKeyIndex}] + salt;"); } public override void GenerateDecryptCode(List lines, string indent) diff --git a/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs b/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs index f12d368..1662570 100644 --- a/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs +++ b/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs @@ -73,7 +73,7 @@ namespace Obfuz.EncryptionVM {"); foreach (var opCode in _vm.opCodes) { - lines.Add($@" case {opCode.code}: + lines.Add($@" case {opCode.code}: {{ // {opCode.function.GetType().Name}"); AppendEncryptCode(lines, opCode.function); @@ -82,8 +82,7 @@ namespace Obfuz.EncryptionVM } lines.Add(@" - default: - throw new System.Exception($""Invalid opCode:{opCode}""); + default: throw new System.Exception($""Invalid opCode:{opCode}""); } }"); } @@ -97,7 +96,7 @@ namespace Obfuz.EncryptionVM {"); foreach (var opCode in _vm.opCodes) { - lines.Add($@" case {opCode.code}: + lines.Add($@" case {opCode.code}: {{ // {opCode.function.GetType().Name}"); AppendDecryptCode(lines, opCode.function); @@ -106,8 +105,7 @@ namespace Obfuz.EncryptionVM } lines.Add(@" - default: - throw new System.Exception($""Invalid opCode:{opCode}""); + default: throw new System.Exception($""Invalid opCode:{opCode}""); } }"); }