本文整理汇总了C#中Reko.Core.Frame类的典型用法代码示例。如果您正苦于以下问题:C# Frame类的具体用法?C# Frame怎么用?C# Frame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Frame类属于Reko.Core命名空间,在下文中一共展示了Frame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
f = new Frame(PrimitiveType.Word16);
argOff = f.EnsureStackArgument(4, PrimitiveType.Word16);
argSeg = f.EnsureStackArgument(6, PrimitiveType.SegmentSelector);
arg_alias = f.EnsureStackArgument(4, PrimitiveType.Pointer32);
}
示例2: W32Mips_Trampoline
public void W32Mips_Trampoline()
{
var instrs = new List<RtlInstructionCluster>();
var frame = new Frame(PrimitiveType.Pointer32);
var r9 = frame.EnsureRegister(new RegisterStorage("r9", 9, PrimitiveType.Word32));
var rtl = new RtlTrace(0x123460)
{
m => m.Assign(r9, 0x00030000),
m => m.Assign(r9, m.LoadDw(m.IAdd(r9, 0x1234))),
m => m.Goto(r9)
};
var host = mr.Stub<IRewriterHost>();
var services = mr.Stub<IServiceProvider>();
var arch = mr.Stub<IProcessorArchitecture>();
var state = mr.Stub<ProcessorState>();
var addr = Address.Ptr32(0x00031234);
arch.Stub(a => a.CreateFrame()).Return(frame);
arch.Stub(a => a.CreateProcessorState()).Return(state);
arch.Stub(a => a.CreateRewriter(null, null, null, null)).IgnoreArguments().Return(rtl);
arch.Stub(a => a.MakeAddressFromConstant(Arg<Constant>.Is.NotNull)).Return(addr);
host.Stub(h => h.GetImportedProcedure(
Arg<Address>.Is.Equal(addr),
Arg<Address>.Is.NotNull)).Return(new ExternalProcedure("foo", new ProcedureSignature()));
mr.ReplayAll();
var platform = new Win32MipsPlatform(services, arch);
var result = platform.GetTrampolineDestination(new LeImageReader(new byte[0]), host);
Assert.IsNotNull(result);
}
示例3: Setup
public void Setup()
{
var arch = new IntelArchitecture(ProcessorMode.Protected32);
f = arch.CreateFrame();
liveness = new IdentifierLiveness(arch);
isLiveHelper = new RegisterLiveness.IsLiveHelper(arch);
}
示例4: Setup
public void Setup()
{
var arch = new X86ArchitectureFlat32();
f = arch.CreateFrame();
liveness = new IdentifierLiveness(arch);
isLiveHelper = new RegisterLiveness.IsLiveHelper(arch);
}
示例5: CreateBlockFlow
private BlockFlow CreateBlockFlow(Block block, Frame frame)
{
return new BlockFlow(
block,
prog.Architecture.CreateRegisterBitset(),
new SymbolicEvaluationContext(prog.Architecture, frame));
}
示例6: Deserialize
public override FunctionType Deserialize(SerializedSignature ss, Frame frame)
{
if (ss == null)
return new FunctionType();
if (ss == null)
return null;
var argser = new ArgumentDeserializer(this, Architecture, frame, 0, Architecture.WordWidth.Size);
Identifier ret = null;
if (ss.ReturnValue != null)
{
ret = argser.DeserializeReturnValue(ss.ReturnValue);
}
var args = new List<Identifier>();
this.gr = 0;
if (ss.Arguments != null)
{
for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
{
var sArg = ss.Arguments[iArg];
Identifier arg = DeserializeArgument(argser, sArg);
args.Add(arg);
}
}
var sig = new FunctionType(ret, args.ToArray());
return sig;
}
示例7: CreateBlockFlow
private BlockFlow CreateBlockFlow(Block block, Frame frame)
{
return new BlockFlow(
block,
new HashSet<RegisterStorage>(),
new SymbolicEvaluationContext(program.Architecture, frame));
}
示例8: RtlStatementStream
public RtlStatementStream(uint address, Frame frame)
{
this.linAddress = address;
this.arch = new FakeArchitecture();
this.frame = frame;
this.stms = new List<RtlInstructionCluster>();
}
示例9: Setup
public void Setup()
{
this.mr = new MockRepository();
this.fsSvc = mr.StrictMock<IFileSystemService>();
this.tllSvc = mr.Stub<ITypeLibraryLoaderService>();
this.services = mr.StrictMock<IServiceProvider>();
var cfgSvc = mr.Stub<IConfigurationService>();
var env = mr.Stub<OperatingEnvironment>();
this.arch = new M68kArchitecture();
this.rtls = new List<RtlInstruction>();
this.m = new RtlEmitter(rtls);
cfgSvc.Stub(c => c.GetEnvironment("amigaOS")).Return(env);
env.Stub(e => e.TypeLibraries).Return(new List<ITypeLibraryElement>());
env.Stub(e => e.CharacteristicsLibraries).Return(new List<ITypeLibraryElement>());
env.Stub(e => e.Options).Return(new Dictionary<string, object>
{
{ "versionDependentLibraries", new Dictionary<string,object>
{
{ "33", new List<object> { "exec_v33", "dos_v33" } },
{ "34", new List<object> { "exec_v34", "dos_v34" } },
}
}
});
this.services.Stub(s => s.GetService(typeof(IConfigurationService))).Return(cfgSvc);
this.services.Stub(s => s.GetService(typeof(IFileSystemService))).Return(fsSvc);
this.services.Stub(s => s.GetService(typeof(ITypeLibraryLoaderService))).Return(tllSvc);
this.frame = new Frame(arch.FramePointerType);
}
示例10: Deserialize
public override ProcedureSignature Deserialize(SerializedSignature ss, Frame frame)
{
if (ss == null)
return null;
this.argser = new ArgumentSerializer(this, Architecture, frame, ss.Convention);
Identifier ret = null;
int fpuDelta = FpuStackOffset;
FpuStackOffset = 0;
if (ss.ReturnValue != null)
{
ret = argser.DeserializeReturnValue(ss.ReturnValue);
fpuDelta += FpuStackOffset;
}
FpuStackOffset = 0;
var args = new List<Identifier>();
if (ss.Arguments != null)
{
for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
{
var sArg = ss.Arguments[iArg];
var arg = DeserializeArgument(sArg, iArg, ss.Convention);
args.Add(arg);
}
fpuDelta -= FpuStackOffset;
}
FpuStackOffset = fpuDelta;
var sig = new ProcedureSignature(ret, args.ToArray());
ApplyConvention(ss, sig);
return sig;
}
示例11: Deserialize
public override ProcedureSignature Deserialize(SerializedSignature ss, Frame frame)
{
if (ss == null)
return null;
var argser = new ArgumentSerializer(this, Architecture, frame, ss.Convention);
Identifier ret = null;
if (ss.ReturnValue != null)
{
ret = argser.DeserializeReturnValue(ss.ReturnValue);
}
var args = new List<Identifier>();
if (ss.Arguments != null)
{
for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
{
var sArg = ss.Arguments[iArg];
Identifier arg = argser.Deserialize(sArg);
args.Add(arg);
}
}
var sig = new ProcedureSignature(ret, args.ToArray());
return sig;
}
示例12: OperandRewriter
public OperandRewriter(IntelArchitecture arch, ExpressionEmitter emitter, Frame frame, IRewriterHost host)
{
this.arch = arch;
this.m = emitter;
this.frame = frame;
this.host = host;
}
示例13: OperandRewriter
public OperandRewriter(M68kArchitecture arch, RtlEmitter emitter, Frame frame, PrimitiveType dataWidth)
{
this.arch = arch;
this.m = emitter;
this.frame = frame;
this.DataWidth = dataWidth;
}
示例14: GetInstructionStream
protected override IEnumerable<RtlInstructionCluster> GetInstructionStream(Frame frame, IRewriterHost host)
{
return arch.CreateRewriter(
new LeImageReader(image, 0),
arch.CreateProcessorState(),
frame,
this.host);
}
示例15: Setup
public void Setup()
{
arch = new IntelArchitecture(ProcessorMode.Real);
f = new Frame(PrimitiveType.Word16);
argOff = f.EnsureStackArgument(4, PrimitiveType.Word16);
argSeg = f.EnsureStackArgument(6, PrimitiveType.SegmentSelector);
arg_alias = f.EnsureStackArgument(4, PrimitiveType.Pointer32);
}