Example #1
0
        private UserCallData LoadUserCall(SerializedCall_v1 call, Program program)
        {
            Address addr;

            if (!program.Platform.TryParseAddress(call.InstructionAddress, out addr))
            {
                return(null);
            }

            var          procSer = program.CreateProcedureSerializer();
            FunctionType sig     = null;

            if (call.Signature != null)
            {
                sig = procSer.Deserialize(
                    call.Signature,
                    program.Architecture.CreateFrame());
            }
            return(new UserCallData
            {
                Address = addr,
                Comment = call.Comment,
                NoReturn = call.NoReturn,
                Signature = sig,
            });
        }
		public void SerializedCall_Create()
		{
            SerializedSignature sig = new SerializedSignature
            {
                Arguments = new Argument_v1[] 
                {
			        new Argument_v1
                    {
			            Kind = new Register_v1("bx"),
                    }
                }
            };
			SerializedCall_v1 sc = new SerializedCall_v1(Address.Ptr32(0x01004000), sig);
			Assert.AreEqual("01004000", sc.InstructionAddress);
			Assert.AreEqual("bx", ((Register_v1) sc.Signature.Arguments[0].Kind).Name);
		}