private NashaMethodBody DisassembleMethodBody(NashaMethod method) { var body = new NashaMethodBody(method); body.Instructions = InstructionDisassembler.DisassembleAllInstructions(method); return(body); }
public CilMethodBody RecompileCilMethodBody(NashaMethodBody nashaMethodBody) { var body = new CilMethodBody(nashaMethodBody.NashaMethod.Parent.Method); foreach (var instruction in nashaMethodBody.Instructions) { var cilInstruction = RecompileInstruction(instruction); body.Instructions.Add(cilInstruction); Context.Logger.Info($"Recompiled Nasha Instruction {instruction} Into Cil Instruction {cilInstruction}"); } //After converting Nasha instruction to cil some instructions will need to be edited after. //Ex: Br - 30 => // Br - (Cil Label of Instruction with index 30) ReplaceOperands(body); return(body); }