mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 04:48:53 +00:00
24 lines
770 B
C#
24 lines
770 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using Indy.IL2CPU.IL;
|
|
using Mono.Cecil;
|
|
using Mono.Cecil.Cil;
|
|
|
|
namespace Indy.IL2CPU {
|
|
public class Engine {
|
|
private OpCodeMap mMap = new OpCodeMap();
|
|
public void Execute(string aAssembly, string opAssembly) {
|
|
mMap.LoadOpMapFromAssembly(opAssembly);
|
|
AssemblyDefinition xAD = AssemblyFactory.GetAssembly(aAssembly);
|
|
if (xAD.EntryPoint == null)
|
|
throw new NotSupportedException("Libraries are not yet supported!");
|
|
foreach (Instruction xInstruction in xAD.EntryPoint.Body.Instructions) {
|
|
mMap.GetOpForOpCode(xInstruction.OpCode.Code).Assemble(xInstruction);
|
|
}
|
|
}
|
|
}
|
|
}
|