本文整理汇总了C#中Reko.Arch.X86.IntelArchitecture类的典型用法代码示例。如果您正苦于以下问题:C# IntelArchitecture类的具体用法?C# IntelArchitecture怎么用?C# IntelArchitecture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntelArchitecture类属于Reko.Arch.X86命名空间,在下文中一共展示了IntelArchitecture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
mr = new MockRepository();
var services = mr.Stub<IServiceProvider>();
var tlSvc = mr.Stub<ITypeLibraryLoaderService>();
var configSvc = mr.StrictMock<IConfigurationService>();
var win32env = new OperatingEnvironmentElement
{
TypeLibraries =
{
new TypeLibraryElement { Name= "msvcrt.xml" },
new TypeLibraryElement { Name= "windows32.xml" },
}
};
configSvc.Stub(c => c.GetEnvironment("win32")).Return(win32env);
configSvc.Stub(c => c.GetPath(null)).IgnoreArguments()
.Do(new Func<string, string>(s => s));
services.Stub(s => s.GetService(typeof(ITypeLibraryLoaderService))).Return(tlSvc);
services.Stub(s => s.GetService(typeof(IConfigurationService))).Return(configSvc);
tlSvc.Stub(t => t.LoadLibrary(null, null)).IgnoreArguments()
.Do(new Func<IProcessorArchitecture, string, TypeLibrary>((a, n) =>
{
var lib = TypeLibrary.Load(a, Path.ChangeExtension(n, ".xml"));
return lib;
}));
services.Replay();
tlSvc.Replay();
configSvc.Replay();
arch = new IntelArchitecture(ProcessorMode.Protected32);
win32 = new Reko.Environments.Win32.Win32Platform(services, arch);
}
示例2: Setup
public void Setup()
{
mr = new MockRepository();
mockFactory = new MockFactory(mr);
arch = new IntelArchitecture(ProcessorMode.Protected32);
platform = new Win32Platform(null, arch);
}
示例3: Setup
public void Setup()
{
this.sc = new ServiceContainer();
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
arch = new IntelArchitecture(ProcessorMode.Real);
asm = new X86TextAssembler(sc, arch);
}
示例4: Setup
public void Setup()
{
repository = new MockRepository();
sc = new ServiceContainer();
arch = new IntelArchitecture(ProcessorMode.Protected32);
dcSvc = repository.StrictMock<IConfigurationService>();
}
示例5: X86TextAssembler
public X86TextAssembler(IServiceProvider services, IntelArchitecture arch)
{
this.services = services;
this.entryPoints = new List<ImageSymbol>();
this.ImageSymbols = new List<ImageSymbol>();
this.arch = arch;
}
示例6: SetUp
public void SetUp()
{
var arch = new IntelArchitecture(ProcessorMode.Real);
prog = new Program() { Architecture = arch };
asm = new X86TextAssembler(arch);
configFile = null;
}
示例7: Setup
public void Setup()
{
var arch = new IntelArchitecture(ProcessorMode.Protected32);
f = arch.CreateFrame();
liveness = new IdentifierLiveness(arch);
isLiveHelper = new RegisterLiveness.IsLiveHelper(arch);
}
示例8: MspRealModeServices
public void MspRealModeServices()
{
mr.ReplayAll();
IntelArchitecture arch = new IntelArchitecture(ProcessorMode.Real);
IPlatform platform = new MsdosPlatform(sc, arch);
var state = arch.CreateProcessorState();
state.SetRegister(Registers.ah, Constant.Byte(0x3E));
SystemService svc = platform.FindService(0x21, state);
Assert.AreEqual("msdos_close_file", svc.Name);
Assert.AreEqual(1, svc.Signature.Parameters.Length);
Assert.IsFalse(svc.Characteristics.Terminates, "close() shouldn't terminate program");
state.SetRegister(Registers.ah, Constant.Byte(0x4C));
svc = platform.FindService(0x21, state);
Assert.AreEqual("msdos_terminate", svc.Name);
Assert.AreEqual(1, svc.Signature.Parameters.Length);
Assert.IsTrue(svc.Characteristics.Terminates, "terminate() should terminate program");
state.SetRegister(Registers.ah, Constant.Byte(0x2F));
svc = platform.FindService(0x21, state);
Assert.AreEqual("msdos_get_disk_transfer_area_address", svc.Name);
Assert.AreEqual(0, svc.Signature.Parameters.Length);
SequenceStorage seq = (SequenceStorage) svc.Signature.ReturnValue.Storage;
Assert.AreEqual("es", seq.Head.Name);
Assert.AreEqual("bx", seq.Tail.Name);
}
示例9: Setup
public void Setup()
{
var sc = new ServiceContainer();
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
var arch = new IntelArchitecture(ProcessorMode.Real);
this.platform = new MsdosPlatform(sc, arch);
}
示例10: Dec_LoadCallSignatures
public void Dec_LoadCallSignatures()
{
var arch = new IntelArchitecture(ProcessorMode.Real);
Program program = new Program {
Architecture = arch,
Platform = new MsdosPlatform(null, arch)
};
decompiler.Project = new Project
{
Programs = { program },
};
List<SerializedCall_v1> al = new List<SerializedCall_v1>();
SerializedSignature sig = new SerializedSignature();
sig.Arguments = new Argument_v1[] {
new Argument_v1 {
Kind = new Register_v1("ds")
},
new Argument_v1 {
Kind = new Register_v1("bx"),
}
};
al.Add(new SerializedCall_v1(Address.SegPtr(0x0C32, 0x3200), sig));
var sigs = decompiler.LoadCallSignatures(program, al);
ProcedureSignature ps = sigs[Address.SegPtr(0x0C32, 0x3200)];
Assert.IsNotNull(ps, "Expected a call signature for address");
}
示例11: OperandRewriter
public OperandRewriter(IntelArchitecture arch, ExpressionEmitter emitter, Frame frame, IRewriterHost host)
{
this.arch = arch;
this.m = emitter;
this.frame = frame;
this.host = host;
}
示例12: Fstsw_Setup
public void Fstsw_Setup()
{
arch = new IntelArchitecture(ProcessorMode.Protected32);
asm = new X86Assembler(arch, Address.Ptr32(0x10000), new List<EntryPoint>());
Procedure proc = new Procedure("test", arch.CreateFrame());
orw = new OperandRewriter32(arch, proc.Frame, null);
emitter = new ProcedureBuilder();
}
示例13: TestGrfWithOneBit
public void TestGrfWithOneBit()
{
IProcessorArchitecture arch = new IntelArchitecture(ProcessorMode.Real);
SignatureBuilder sb = new SignatureBuilder(null, arch);
sb.AddFlagGroupReturnValue((uint) FlagM.CF, arch.CreateFrame());
ProcedureSignature sig = sb.BuildSignature();
Assert.AreEqual("bool", sig.ReturnValue.DataType.ToString());
}
示例14: Setup
public void Setup()
{
mr = new MockRepository();
this.services = mr.Stub<IServiceProvider>();
var tlSvc = new TypeLibraryLoaderServiceImpl(services);
var configSvc = mr.StrictMock<IConfigurationService>();
var win32env = new OperatingEnvironmentElement
{
TypeLibraries =
{
new TypeLibraryElement { Name= "msvcrt.xml" },
new TypeLibraryElement { Name= "windows32.xml" },
}
};
configSvc.Stub(c => c.GetEnvironment("win32")).Return(win32env);
configSvc.Stub(c => c.GetInstallationRelativePath(null)).IgnoreArguments()
.Do(new Func<string[], string>(s => string.Join("/", s)));
services.Stub(s => s.GetService(typeof(ITypeLibraryLoaderService))).Return(tlSvc);
services.Stub(s => s.GetService(typeof(IConfigurationService))).Return(configSvc);
services.Stub(s => s.GetService(typeof(DecompilerEventListener))).Return(new FakeDecompilerEventListener());
services.Stub(s => s.GetService(typeof(CancellationTokenSource))).Return(null);
services.Stub(s => s.GetService(typeof(IFileSystemService))).Return(new FileSystemServiceImpl());
services.Stub(s => s.GetService(typeof(IDiagnosticsService))).Return(new FakeDiagnosticsService());
services.Replay();
configSvc.Replay();
arch = new X86ArchitectureFlat32();
win32 = new Reko.Environments.Windows.Win32Platform(services, arch);
}
示例15: SerializedSignatureTests
public SerializedSignatureTests()
{
this.sc = new ServiceContainer();
this.sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
this.arch = new X86ArchitectureReal();
this.platform = new MsdosPlatform(sc, arch);
}