Ejemplo n.º 1
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     if (!char.IsDigit(i.OpCode.Name.Split('.').Last()[0]))
     {
         ab.Mov("eax", "[ebp + " + (8 + ((int)i.Operand * 4)) + "]");
         ab.Push("eax");
     }
     else
     {
         ab.Mov("eax", "[ebp + " + (8 + (int.Parse(i.OpCode.Name.Split('.').Last()) * 4)) + "]");
         ab.Push("eax");
     }
 }
Ejemplo n.º 2
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     if (!char.IsDigit(i.OpCode.Name.Split('.').Last()[0]))
     {
         ab.Mov("eax", "dword[ebp - " + (4 * (Convert.ToInt32(i.Operand.ToString().Split('_').Last()) + 1)) + "]");
         ab.Push("eax");
     }
     else
     {
         ab.Mov("eax", "dword[ebp - " + (4 * (Convert.ToInt32(i.OpCode.Name.Split('.').Last()) + 1)) + "]");
         ab.Push("eax");
     }
 }
Ejemplo n.º 3
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Pop("ebx"); //bits
     ab.Pop("eax"); //value a
     ab.Mov("ecx", "ebx");
     ab.Shl("eax", "cl");
     ab.Push("eax");
 }
Ejemplo n.º 4
0
        public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
        {
            if (md.ReturnType.ToString() != typeof(void).ToString())
            {
                ab.Pop("eax");
            }

            ab.Pop("edi");
            ab.Pop("esi");
            ab.Mov("esp", "ebp");
            ab.Pop("ebp");

            ab.Line();

            ab.Ret();
        }
Ejemplo n.º 5
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     if (!Compiler.ConstantIndex.Contains(i.Operand.ToString()))
     {
         string constant = "";
         foreach (var z in i.Operand.ToString())
         {
             constant += (byte)z + ", ";
         }
         constant = constant.Trim().TrimEnd(',');
         ab.GlobalVar(Utils.SafeName("STR" + i.Operand.ToString()), (i.Operand.ToString().Length - 1) + ",0 ,0 ,0 , " + constant, "db");
         Compiler.ConstantIndex.Add(i.Operand.ToString());
     }
     ab.Mov("eax", "dword " + Utils.SafeName("STR" + i.Operand.ToString()) + "");
     ab.Push("eax");
 }
Ejemplo n.º 6
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Pop("ebx"); //addres
     ab.Mov("al", "byte[ebx]");
     ab.Push("eax");
 }
Ejemplo n.º 7
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Mov("eax", "dword [" + Utils.SafeName(i.Operand.ToString()) + "]");
     ab.Push("eax");
 }