예제 #1
0
        public void Df_FormatString()
        {
            var list = new List<TextSpan>();
            var df = new DisassemblyFormatter(program, null, list);
            df.Write("Hello");
            df.NewLine();

            Assert.AreEqual(1, list.Count);
        }
예제 #2
0
        public void Df_FormatAddress()
        {
            var list = new List<TextSpan>();
            var df = new DisassemblyFormatter(program, null, list);
            df.WriteAddress("foo", Address.Ptr32(0x1234));
            df.NewLine();

            Assert.AreEqual("foo", list[0].GetText());
            Assert.IsInstanceOf<Address>(list[0].Tag);
        }
예제 #3
0
        public void Df_FormatAddress_ScannedProcedure()
        {
            var list = new List<TextSpan>();
            program.Procedures.Add(Address.Ptr32(0x1234), new Procedure("fn_renamed", new Frame(PrimitiveType.Word32)));
            var df = new DisassemblyFormatter(program, null, list);
            df.WriteAddress("foo", Address.Ptr32(0x1234));
            df.NewLine();

            Assert.AreEqual("fn_renamed", list[0].GetText());
            Assert.IsInstanceOf<Address>(list[0].Tag);
        }