public override Program Load(Address addrLoad) { // First load the file as a PE Executable. This gives us a (writeable) image and // the packed entry point. var pe = CreatePeImageLoader(); var program = pe.Load(pe.PreferredBaseAddress); var rr = pe.Relocate(program, pe.PreferredBaseAddress); this.ImageMap = program.SegmentMap; this.Architecture = (IntelArchitecture)program.Architecture; IPlatformEmulator win32 = program.Platform.CreateEmulator(program.SegmentMap, program.ImportReferences); var wxin32 = new Win32Emulator(program.SegmentMap, program.Platform, program.ImportReferences); var emu = new X86Emulator((IntelArchitecture)program.Architecture, program.SegmentMap, win32); this.debugger = new Debugger(emu); this.scriptInterpreter = new OllyLang(Services); this.scriptInterpreter.Host = new Host(this, program.SegmentMap); this.scriptInterpreter.Debugger = this.debugger; emu.InstructionPointer = rr.EntryPoints[0].Address; emu.BeforeStart += emu_BeforeStart; emu.ExceptionRaised += emu_ExceptionRaised; var stackSeg = InitializeStack(emu); LoadScript(Argument, scriptInterpreter.script); emu.Start(); TearDownStack(stackSeg); foreach (var ic in win32.InterceptedCalls) { program.InterceptedCalls.Add(ic.Key, ic.Value); } return(program); }
public X86Emulator(IntelArchitecture arch, LoadedImage loadedImage, IPlatformEmulator envEmulator) { this.arch = arch; this.img = loadedImage; this.Registers = new ulong[40]; this.Valid = new bool[40]; this.envEmulator = envEmulator; }
public X86Emulator(IntelArchitecture arch, ImageMap imageMap, IPlatformEmulator envEmulator) { this.arch = arch; this.map = imageMap; this.Registers = new ulong[40]; this.Valid = new bool[40]; this.envEmulator = envEmulator; }
public Mos6502Emulator(Mos6502Architecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) : base(segmentMap) { this.arch = arch; this.map = segmentMap; this.envEmulator = envEmulator; this.regs = new ushort[12]; }
public X86Emulator(IntelArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) { this.arch = arch; this.map = segmentMap; this.Registers = new ulong[40]; this.Valid = new bool[40]; this.envEmulator = envEmulator; }
public PowerPcEmulator(PowerPcArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) : base(segmentMap) { this.arch = arch; this.map = segmentMap; this.envEmulator = envEmulator; this.registerFile = new ulong[32]; }
public override IProcessorEmulator CreateEmulator(SegmentMap segmentMap, IPlatformEmulator envEmulator) { throw new NotImplementedException(); }
public X86Protected32Emulator(IntelArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) : base(arch, segmentMap, envEmulator, X86.Registers.eip, X86.Registers.ecx) { }
public override IProcessorEmulator CreateEmulator(SegmentMap segmentMap, IPlatformEmulator envEmulator) { return(mode.CreateEmulator(this, segmentMap, envEmulator)); }
public override IProcessorEmulator CreateEmulator(SegmentMap segmentMap, IPlatformEmulator envEmulator) => ProcessorModel.CreateEmulator(this, segmentMap, envEmulator);
/// <summary> /// Creates an emulator for the target processor. /// </summary> /// <param name="arch">The architecture of the processor.</param> /// <param name="segmentMap">The memory of the program to be emulated.</param> /// <param name="envEmulator">Emulated environment.</param> /// <returns>The created emulator.</returns> public virtual IProcessorEmulator CreateEmulator(PICArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) => throw new NotImplementedException();
public X86RealModeEmulator(IntelArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) : base(arch, segmentMap, envEmulator, X86.Registers.ip, X86.Registers.cx) { }
public abstract IProcessorEmulator CreateEmulator(IntelArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator);
public override IProcessorEmulator CreateEmulator(IntelArchitecture arch, SegmentMap segmentMap, IPlatformEmulator envEmulator) { return(new X86Protected32Emulator(arch, segmentMap, envEmulator)); }
public abstract IProcessorEmulator CreateEmulator(SegmentMap segmentMap, IPlatformEmulator envEmulator);