Пример #1
0
 public void X86St_SetAhRegisterFileValue()
 {
     var state = new X86State(new X86ArchitectureFlat64());
     state.SetRegister(Registers.ah, Constant.Byte(0x3A));
     Assert.IsFalse(state.IsValid(Registers.ax));
     Assert.IsTrue(state.IsValid(Registers.ah));
 }
Пример #2
0
 public void X86St_SetBp()
 {
     var state = new X86State(new X86ArchitectureFlat64());
     state.SetRegister(Registers.bp, Constant.Word16(0x1234));
     Assert.IsFalse(state.IsValid(Registers.ebp));
     Assert.IsTrue(state.IsValid(Registers.bp));
 }
Пример #3
0
 public void X86St_SetAhThenAl()
 {
     var state = new X86State(new X86ArchitectureFlat64());
     state.SetRegister(Registers.ah, Constant.Byte(0x12));
     state.SetRegister(Registers.al, Constant.Byte(0x34));
     Assert.IsTrue(state.IsValid(Registers.ax));
     Assert.IsTrue(state.IsValid(Registers.al));
     Assert.IsTrue(state.IsValid(Registers.ah));
 }
Пример #4
0
 public void X86St_SetDhSymbolic_Invalid()
 {
     var ctx = new Dictionary<Storage, Expression> {
         { Registers.dl, Constant.Byte(3) }
     };
     var state = new X86State(new X86ArchitectureFlat64());
     state.SetRegister(Registers.dh, Constant.Invalid);
     Assert.IsFalse(state.IsValid(Registers.dh));
     Assert.IsFalse(state.IsValid(Registers.dx));
     Assert.IsFalse(state.IsValid(Registers.edx));
     Assert.AreEqual("0x03", ctx[Registers.dl].ToString());
 }
Пример #5
0
 public void X86St_SetCxSymbolic_Invalid()
 {
     var ctx = new Dictionary<Storage, Expression> {
         { Registers.cl, Constant.Byte(0) }
     };
     var state = new X86State(new X86ArchitectureFlat64());
     state.SetRegister(Registers.cx, Constant.Invalid);
     Assert.IsFalse(state.IsValid(Registers.cx));
     Assert.IsFalse(state.IsValid(Registers.cl));
     Assert.IsFalse(state.IsValid(Registers.ch));
     Assert.IsFalse(state.IsValid(Registers.ecx));
 }
Пример #6
0
 public void X86St_SetCx()
 {
     var state = new X86State(new X86ArchitectureFlat64());
     state.SetRegister(Registers.cx, Constant.Word16(0x1234));
     Assert.AreEqual(0x1234, (int)state.GetRegister(Registers.cx).ToUInt16());
     Assert.AreEqual(0x34, (int)state.GetRegister(Registers.cl).ToByte());
     Assert.AreEqual(0x12, (int)state.GetRegister(Registers.ch).ToByte());
     Assert.IsTrue(state.IsValid(Registers.cx));
     Assert.IsTrue(state.IsValid(Registers.cl));
     Assert.IsTrue(state.IsValid(Registers.ch));
 }