修复 VirtualMachineCodeGenerator生成的加密解密代码缩进不正确的问题

before-split
walon 2025-05-30 13:37:21 +08:00
parent cad7fff2d1
commit 10e6c0d914
1 changed files with 12 additions and 12 deletions

View File

@ -74,12 +74,12 @@ namespace Obfuz.EncryptionVM
{"); {");
foreach (var opCode in _vm.opCodes) foreach (var opCode in _vm.opCodes)
{ {
lines.Add($@" case {opCode.code}: lines.Add($@" case {opCode.code}:
{{ {{
// {opCode.function.GetType().Name}"); // {opCode.function.GetType().Name}");
AppendEncryptCode(lines, opCode.function); AppendEncryptCode(lines, opCode.function);
lines.Add(@" return value; lines.Add(@" return value;
}"); }");
} }
lines.Add(@" lines.Add(@"
@ -98,12 +98,12 @@ namespace Obfuz.EncryptionVM
{"); {");
foreach (var opCode in _vm.opCodes) foreach (var opCode in _vm.opCodes)
{ {
lines.Add($@" case {opCode.code}: lines.Add($@" case {opCode.code}:
{{ {{
// {opCode.function.GetType().Name}"); // {opCode.function.GetType().Name}");
AppendDecryptCode(lines, opCode.function); AppendDecryptCode(lines, opCode.function);
lines.Add(@" return value; lines.Add(@" return value;
}"); }");
} }
lines.Add(@" lines.Add(@"
@ -193,12 +193,12 @@ namespace Obfuz.EncryptionVM
private void AppendEncryptCode(List<string> lines, IEncryptionInstruction instruction) private void AppendEncryptCode(List<string> lines, IEncryptionInstruction instruction)
{ {
instruction.GenerateEncryptCode(lines, " "); instruction.GenerateEncryptCode(lines, " ");
} }
private void AppendDecryptCode(List<string> lines, IEncryptionInstruction instruction) private void AppendDecryptCode(List<string> lines, IEncryptionInstruction instruction)
{ {
instruction.GenerateDecryptCode(lines, " "); instruction.GenerateDecryptCode(lines, " ");
} }
} }
} }