コード例 #1
0
 private void memindex_emit(BinaryWriter writer, Byte r, X86Register32 basereg, Int32 disp, X86Register32 indexreg, Byte shift)
 {
     if (basereg == X86Register32.None)
     {
         address_byte(writer, 0, (byte)r, 4);
         address_byte(writer, (byte)shift, (byte)indexreg, 5);
         writer.Write((Int32)disp);
     }
     else if (disp == 0 && basereg == X86Register32.EBP)
     {
         address_byte(writer, 0, (byte)r, 4);
         address_byte(writer, (byte)shift, (byte)indexreg, (byte)basereg);
     }
     else if (X86Writer.is_imm8(disp))
     {
         address_byte(writer, 1, (byte)r, 4);
         address_byte(writer, (byte)shift, (byte)indexreg, (byte)basereg);
         writer.Write((Byte)disp);
     }
     else
     {
         address_byte(writer, 2, (byte)r, 4);
         address_byte(writer, (byte)shift, (byte)indexreg, 5);
         writer.Write((Int32)disp);
     }
 }
コード例 #2
0
ファイル: X86Asm.cs プロジェクト: inrg/X86.Interop
        internal static byte[] GetAsmBytes(IntPtr address, Action <X86Writer> writeAction)
        {
            //write asm to memory stream
            MemoryStream stream = new MemoryStream();
            X86Writer    writer = new X86Writer(stream, address);

            writeAction.Invoke(writer);
            return(stream.ToArray());
        }
コード例 #3
0
 private void membase_emit(BinaryWriter writer, Byte r, X86Register32 basereg, Int32 disp)
 {
     do
     {
         if ((basereg) == X86Register32.ESP)
         {
             if ((disp) == 0)
             {
                 address_byte(writer, 0, (byte)r, (byte)X86Register32.ESP);
                 address_byte(writer, 0, (byte)X86Register32.ESP, (byte)X86Register32.ESP);
             }
             else if (X86Writer.is_imm8(disp))
             {
                 address_byte(writer, 1, (byte)r, (byte)X86Register32.ESP);
                 address_byte(writer, 0, (byte)X86Register32.ESP, (byte)X86Register32.ESP);
                 writer.Write((byte)(disp));
             }
             else
             {
                 address_byte(writer, 2, (byte)r, (byte)X86Register32.ESP);
                 address_byte(writer, 0, (byte)X86Register32.ESP, (byte)X86Register32.ESP);
                 writer.Write(disp);
             }
             break;
         }
         else if (disp == 0 && basereg != X86Register32.EBP)
         {
             address_byte(writer, 0, (byte)r, (byte)basereg);
         }
         else if (X86Writer.is_imm8(disp))
         {
             address_byte(writer, 1, (byte)r, (byte)basereg);
             writer.Write((byte)(disp));
         }
         else
         {
             address_byte(writer, 2, (byte)r, (byte)basereg);
             writer.Write(disp);
         }
     } while (false);
 }
コード例 #4
0
ファイル: X86Label.cs プロジェクト: inrg/X86.Interop
 internal X86Label(X86Writer writer, IntPtr position)
 {
     this.writer = writer;
     mark        = position;
 }
コード例 #5
0
ファイル: X86Label.cs プロジェクト: inrg/X86.Interop
 internal X86Label(X86Writer writer)
 {
     this.writer = writer;
 }