本文整理汇总了C#中SharpOS.AOT.X86.Assembly.Encode方法的典型用法代码示例。如果您正苦于以下问题:C# Assembly.Encode方法的具体用法?C# Assembly.Encode怎么用?C# Assembly.Encode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpOS.AOT.X86.Assembly
的用法示例。
在下文中一共展示了Assembly.Encode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AAD_imm8
public void AAD_imm8 ()
{
// AAD 0xd
// AAD (0xd)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.AAD (0xd);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0xd5, 0xd };
Assert.IsTrue (CompareData (memoryStream, target), "'AAD 0xd' failed.");
}
示例2: AAA
public void AAA ()
{
// AAA
// AAA ()
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.AAA ();
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x37 };
Assert.IsTrue (CompareData (memoryStream, target), "'AAA' failed.");
}
示例3: OR_mem32_imm32
public void OR_mem32_imm32 ()
{
// OR DWord [CS:EBP + EAX*8], 0xbeab706
// OR (new DWordMemory(Seg.CS, R32.EBP, R32.EAX, 3), 0xbeab706)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.OR (new DWordMemory (Seg.CS, R32.EBP, R32.EAX, 3), 0xbeab706);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x2e, 0x81, 0x4c, 0xc5, 0x0, 0x6, 0xb7, 0xea, 0xb };
Assert.IsTrue (CompareData (memoryStream, target), "'OR DWord [CS:EBP + EAX*8], 0xbeab706' failed.");
}
示例4: OR_mem8_imm8
public void OR_mem8_imm8 ()
{
// OR Byte [SS:0x12345678], 0x7
// OR (new ByteMemory(Seg.SS, null, null, 0, 0x12345678), 0x7)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.OR (new ByteMemory (Seg.SS, null, null, 0, 0x12345678), 0x7);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x36, 0x80, 0xd, 0x78, 0x56, 0x34, 0x12, 0x7 };
Assert.IsTrue (CompareData (memoryStream, target), "'OR Byte [SS:0x12345678], 0x7' failed.");
}
示例5: OR_reg16_mem16
public void OR_reg16_mem16 ()
{
// OR DX, [EDI + 0x12345678]
// OR (R16.DX, new WordMemory(null, R32.EDI, null, 0, 0x12345678))
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.OR (R16.DX, new WordMemory (null, R32.EDI, null, 0, 0x12345678));
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x66, 0xb, 0x97, 0x78, 0x56, 0x34, 0x12 };
Assert.IsTrue (CompareData (memoryStream, target), "'OR DX, [EDI + 0x12345678]' failed.");
}
示例6: OR_mem32_reg32
public void OR_mem32_reg32 ()
{
// OR [CS:EAX + EBX*2], EDI
// OR (new DWordMemory(Seg.CS, R32.EAX, R32.EBX, 1), R32.EDI)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.OR (new DWordMemory (Seg.CS, R32.EAX, R32.EBX, 1), R32.EDI);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x2e, 0x9, 0x3c, 0x58 };
Assert.IsTrue (CompareData (memoryStream, target), "'OR [CS:EAX + EBX*2], EDI' failed.");
}
示例7: OR_mem16_reg16
public void OR_mem16_reg16 ()
{
// OR [ES:EDI*2], DX
// OR (new WordMemory(Seg.ES, null, R32.EDI, 1), R16.DX)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.OR (new WordMemory (Seg.ES, null, R32.EDI, 1), R16.DX);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x26, 0x66, 0x9, 0x14, 0x3f };
Assert.IsTrue (CompareData (memoryStream, target), "'OR [ES:EDI*2], DX' failed.");
}
示例8: NOT_rmreg32
public void NOT_rmreg32 ()
{
// NOT EDX
// NOT (R32.EDX)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.NOT (R32.EDX);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0xf7, 0xd2 };
Assert.IsTrue (CompareData (memoryStream, target), "'NOT EDX' failed.");
}
示例9: NEG_rmreg8
public void NEG_rmreg8 ()
{
// NEG AH
// NEG (R8.AH)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.NEG (R8.AH);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0xf6, 0xdc };
Assert.IsTrue (CompareData (memoryStream, target), "'NEG AH' failed.");
}
示例10: NEG_mem32
public void NEG_mem32 ()
{
// NEG DWord [CS:0x12345678]
// NEG (new DWordMemory(Seg.CS, null, null, 0, 0x12345678))
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.NEG (new DWordMemory (Seg.CS, null, null, 0, 0x12345678));
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x2e, 0xf7, 0x1d, 0x78, 0x56, 0x34, 0x12 };
Assert.IsTrue (CompareData (memoryStream, target), "'NEG DWord [CS:0x12345678]' failed.");
}
示例11: NEG_mem16
public void NEG_mem16 ()
{
// NEG Word [EDX + EAX*4 + 0x12345678]
// NEG (new WordMemory(null, R32.EDX, R32.EAX, 2, 0x12345678))
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.NEG (new WordMemory (null, R32.EDX, R32.EAX, 2, 0x12345678));
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x66, 0xf7, 0x9c, 0x82, 0x78, 0x56, 0x34, 0x12 };
Assert.IsTrue (CompareData (memoryStream, target), "'NEG Word [EDX + EAX*4 + 0x12345678]' failed.");
}
示例12: MUL_rmreg32
public void MUL_rmreg32 ()
{
// MUL ECX
// MUL (R32.ECX)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.MUL (R32.ECX);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0xf7, 0xe1 };
Assert.IsTrue (CompareData (memoryStream, target), "'MUL ECX' failed.");
}
示例13: MUL_rmreg16
public void MUL_rmreg16 ()
{
// MUL SI
// MUL (R16.SI)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.MUL (R16.SI);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x66, 0xf7, 0xe6 };
Assert.IsTrue (CompareData (memoryStream, target), "'MUL SI' failed.");
}
示例14: MUL_rmreg8
public void MUL_rmreg8 ()
{
// MUL AH
// MUL (R8.AH)
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.MUL (R8.AH);
asm.Encode (memoryStream);
byte [] target = new byte [] { 0xf6, 0xe4 };
Assert.IsTrue (CompareData (memoryStream, target), "'MUL AH' failed.");
}
示例15: MUL_mem32
public void MUL_mem32 ()
{
// MUL DWord [FS:ESI + ESI*8]
// MUL (new DWordMemory(Seg.FS, R32.ESI, R32.ESI, 3))
MemoryStream memoryStream = new MemoryStream ();
Assembly asm = new Assembly ();
asm.MUL (new DWordMemory (Seg.FS, R32.ESI, R32.ESI, 3));
asm.Encode (memoryStream);
byte [] target = new byte [] { 0x64, 0xf7, 0x24, 0xf6 };
Assert.IsTrue (CompareData (memoryStream, target), "'MUL DWord [FS:ESI + ESI*8]' failed.");
}