CreateAssemblyCommand(IUndoCommandService undoCommandService, IDocumentTreeView documentTreeView, ModuleDef newModule, AssemblyOptions options) { this.undoCommandService = undoCommandService; var module = Module.ModuleUtils.CreateModule(options.Name, Guid.NewGuid(), options.ClrVersion, ModuleKind.Dll, newModule); options.CreateAssemblyDef(module).Modules.Add(module); var file = DsDotNetDocument.CreateAssembly(DsDocumentInfo.CreateDocument(string.Empty), module, true); fileNodeCreator = RootDocumentNodeCreator.CreateAssembly(documentTreeView, file); }
protected AddNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode, bool modNodeWasCreated) { this.undoCommandService = undoCommandService; if (!(asmNode is AssemblyDocumentNode)) { asmNode = (AssemblyDocumentNode)asmNode.TreeNode.Parent.Data; } this.asmNode = (AssemblyDocumentNode)asmNode; this.modNode = modNode; this.modNodeWasCreated = modNodeWasCreated; }
public static void AddAndExecute(IUndoCommandService undoCommandService, HexDocument doc, ulong offset, byte[] data, string descr = null) { if (doc == null) { throw new ArgumentNullException(nameof(doc)); } if (data == null || data.Length == 0) { return; } undoCommandService.Add(new WriteHexUndoCommand(doc, offset, data, descr)); }
static IEnumerable <UndoRedoInfo> GetUndoRedoInfo(IUndoCommandService undoCommandService, IEnumerable <DsDocumentNode> nodes) { var modifiedUndoAsms = new HashSet <IUndoObject>(undoCommandService.UndoObjects); var modifiedRedoAsms = new HashSet <IUndoObject>(undoCommandService.RedoObjects); foreach (var node in nodes) { var uo = undoCommandService.GetUndoObject(node.Document); bool isInUndo = modifiedUndoAsms.Contains(uo); bool isInRedo = modifiedRedoAsms.Contains(uo); yield return(new UndoRedoInfo(node, isInUndo, isInRedo)); } }
public static void AddAndExecute(IUndoCommandService undoCommandService, IHexDocumentService hexDocumentService, string filename, ulong offset, byte[] data, string descr = null) { if (string.IsNullOrEmpty(filename)) { throw new ArgumentException(); } var doc = hexDocumentService.GetOrCreate(filename); if (doc == null) { return; } AddAndExecute(undoCommandService, doc, offset, data, descr); }
AddExistingNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode) : base(undoCommandService, asmNode, modNode, false) { }
AddNewNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode) : base(undoCommandService, asmNode, modNode, true) { }
HexBufferService(IUndoCommandService undoCommandService, HexBufferFactoryService hexBufferFactoryService, [ImportMany] IEnumerable <Lazy <IHexBufferServiceListener> > hexBufferServiceListeners) { this.hexBufferFactoryService = hexBufferFactoryService; this.hexBufferServiceListeners = hexBufferServiceListeners.ToArray(); undoCommandService.OnEvent += UndoCommandService_OnEvent; }
HexBufferUndoRedo(IUndoCommandService undoCommandService) => this.undoCommandService = undoCommandService;
HexDocumentService(IUndoCommandService undoCommandService) { this.undoCommandService = undoCommandService; undoCommandService.OnEvent += UndoCommandService_OnEvent; }
AddNewNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode) : base(undoCommandService, asmNode, modNode, true) { }
static IEnumerable<UndoRedoInfo> GetUndoRedoInfo(IUndoCommandService undoCommandService, IEnumerable<DsDocumentNode> nodes) { var modifiedUndoAsms = new HashSet<IUndoObject>(undoCommandService.UndoObjects); var modifiedRedoAsms = new HashSet<IUndoObject>(undoCommandService.RedoObjects); foreach (var node in nodes) { var uo = undoCommandService.GetUndoObject(node.Document); bool isInUndo = modifiedUndoAsms.Contains(uo); bool isInRedo = modifiedRedoAsms.Contains(uo); yield return new UndoRedoInfo(node, isInUndo, isInRedo); } }
public AsmEdHexDocument(IUndoCommandService undoCommandService, byte[] data, string filename) : base(data, filename) { this.undoCommandService = undoCommandService; this.undoObject = new UndoObject(this); }
HexBoxUndoService(IUndoCommandService undoCommandService) { this.undoCommandService = undoCommandService; undoCommandService.OnEvent += UndoCommandService_OnEvent; }
HexBufferService(IUndoCommandService undoCommandService, HexBufferFactoryService hexBufferFactoryService, [ImportMany] IEnumerable<Lazy<IHexBufferServiceListener>> hexBufferServiceListeners) { this.hexBufferFactoryService = hexBufferFactoryService; this.hexBufferServiceListeners = hexBufferServiceListeners.ToArray(); undoCommandService.OnEvent += UndoCommandService_OnEvent; }
AddExistingNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode) : base(undoCommandService, asmNode, modNode, false) { }
CreateAssemblyCommand(IUndoCommandService undoCommandService, IDocumentTreeView documentTreeView, ModuleDef newModule, AssemblyOptions options) { this.undoCommandService = undoCommandService; var module = Module.ModuleUtils.CreateModule(options.Name, Guid.NewGuid(), options.ClrVersion, ModuleKind.Dll, newModule); options.CreateAssemblyDef(module).Modules.Add(module); var file = DsDotNetDocument.CreateAssembly(DsDocumentInfo.CreateDocument(string.Empty), module, true); fileNodeCreator = RootDocumentNodeCreator.CreateAssembly(documentTreeView, file); }
protected AddNetModuleToAssemblyCommand(IUndoCommandService undoCommandService, DsDocumentNode asmNode, ModuleDocumentNode modNode, bool modNodeWasCreated) { this.undoCommandService = undoCommandService; if (!(asmNode is AssemblyDocumentNode)) asmNode = (AssemblyDocumentNode)asmNode.TreeNode.Parent.Data; this.asmNode = (AssemblyDocumentNode)asmNode; this.modNode = modNode; this.modNodeWasCreated = modNodeWasCreated; }