Пример #1
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Pop("eax"); //value a
     ab.Pop("ebx"); //value b
     ab.Or("eax", "ebx");
     ab.Push("eax");
 }
Пример #2
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Pop("eax");  //value a
     ab.Pop("ebx");  //value b
     ab.Imul("ebx"); // imul ecx, eax, ebx; result in ecx
     ab.Push("EAX");
 }
Пример #3
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Pop("eax"); //value a
     ab.Pop("ebx"); //value b
     ab.Cmp("eax", "ebx");
     ab.Jl(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_1CLT");
     ab.Push("1");
     ab.Jmp(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_0CLT");
     ab.Label(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_1CLT");
     ab.Push("0");
     ab.Label(Utils.SafeName(md.FullName) + i.ToString().Split(':')[0] + "_0CLT");
 }
Пример #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();
        }
Пример #5
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     if (!char.IsDigit(i.OpCode.Name.Split('.').Last()[0]))
     {
         //pop eax
         //mov dword[esp + 4], eax
         ab.Pop("eax");
         ab.Mov("dword[ebp - " + (4 * (Convert.ToInt32(i.Operand.ToString().Split('_').Last()) + 1)) + "]", "eax");
     }
     else
     {
         //pop eax
         //mov dword[esp + 4], eax
         ab.Pop("eax");
         ab.Mov("dword[ebp - " + (4 * (Convert.ToInt32(i.OpCode.Name.Split('.').Last()) + 1)) + "]", "eax");
     }
 }
Пример #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");
 }
Пример #7
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Pop("eax"); //flag
     ab.Cmp("eax", "1");
     ab.Jmpe(Utils.SafeName(md.FullName) + i.Operand.ToString().Split(':')[0]);
 }
Пример #8
0
 public override void Compile(Instruction i, AsmBuilder ab, List <string> Offsets, MethodDefinition md)
 {
     ab.Pop("eax");
     ab.Mov("dword [" + Utils.SafeName(i.Operand.ToString()) + "]", "eax");
 }