예제 #1
0
        internal static void ExecuteInternal(ModuleVM vm, bool newTab)
        {
            if (vm == null)
            {
                return;
            }
            if (vm.Module.IsDynamic || vm.Module.IsInMemory)
            {
                return;                //TODO: Support dynamic and in-memory modules
            }
            var serAsm = vm.Module.SerializedDnModuleWithAssembly;
            var asm    = MainWindow.Instance.LoadAssembly(serAsm.Assembly, serAsm.Module);

            if (asm == null)
            {
                return;
            }
            var mod = asm.ModuleDefinition;

            if (mod == null)
            {
                return;
            }
            // The asm could've been added lazily to the list so add a short delay before we select it
            MainWindow.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => {
                if (newTab)
                {
                    MainWindow.Instance.OpenNewEmptyTab();
                }
                MainWindow.Instance.JumpToReference(mod);
            }));
        }
예제 #2
0
 public void WriteVersion(ModuleVM vm)
 {
     if (vm.Version != null)
     {
         output.Write(vm.Version);
     }
 }
예제 #3
0
		public void WriteTimestamp(ModuleVM vm) {
			var ts = vm.Timestamp;
			if (ts != null) {
				var date = Epoch.AddSeconds(ts.Value);
				var dateString = date.ToString(CultureInfo.CurrentUICulture.DateTimeFormat);
				output.Write(dateString, TextTokenType.Text);
			}
		}
예제 #4
0
 void WriteFilename(ModuleVM vm, string filename)
 {
     if (vm.Module.IsDynamic || vm.Module.IsInMemory)
     {
         filename = DebugOutputUtils.FilterName(filename, 300);
     }
     output.WriteFilename(filename);
 }
예제 #5
0
 public void WriteVersion(ModuleVM vm)
 {
     if (vm.Version == null)
     {
         output.Write("???", TextTokenType.Error);
     }
     else
     {
         output.Write(vm.Version);
     }
 }
예제 #6
0
        public void WriteTimestamp(ModuleVM vm)
        {
            var ts = vm.Timestamp;

            if (ts != null)
            {
                var date       = Epoch.AddSeconds(ts.Value);
                var dateString = date.ToString(CultureInfo.CurrentUICulture.DateTimeFormat);
                output.Write(dateString, TextTokenKind.Text);
            }
        }
예제 #7
0
		public void WriteAddress(ModuleVM vm) {
			ulong addr = vm.Module.Address;
			ulong endAddr = addr + vm.Module.Size;
			if (addr == 0)
				output.Write(dnSpy_Debugger_Resources.Module_NoAddress, TextTokenKind.Text);
			else {
				WriteAddress(addr);
				output.Write("-", TextTokenKind.Operator);
				WriteAddress(endAddr);
			}
		}
예제 #8
0
 internal static void ExecuteInternal(ModuleVM vm, bool newTab)
 {
     if (vm == null)
     {
         return;
     }
     if (ShowErrorIfDynamic(vm.Module))
     {
         GoToFile(ModuleLoader.Instance.LoadModule(vm.Module, true), newTab);
     }
 }
예제 #9
0
		public void WriteAddress(ModuleVM vm) {
			ulong addr = vm.Module.Address;
			ulong endAddr = addr + vm.Module.Size;
			if (addr == 0)
				output.Write(BoxedTextColor.Text, dnSpy_Debugger_Resources.Module_NoAddress);
			else {
				WriteAddress(addr);
				output.Write(BoxedTextColor.Operator, "-");
				WriteAddress(endAddr);
			}
		}
예제 #10
0
		public void WriteAddress(ModuleVM vm) {
			ulong addr = vm.Module.Address;
			ulong endAddr = addr + vm.Module.Size;
			if (addr == 0)
				output.Write("<no address>", TextTokenType.Text);
			else {
				WriteAddress(addr);
				output.Write('-', TextTokenType.Operator);
				WriteAddress(endAddr);
			}
		}
예제 #11
0
        static void ExecuteInternal(ModuleVM vm, bool newTab)
        {
            if (vm == null)
            {
                return;
            }

            if (GoToModuleModulesCtxMenuCommand.ShowErrorIfDynamic(vm.Module))
            {
                GoToModuleModulesCtxMenuCommand.GoToFile(InMemoryModuleManager.Instance.LoadFile(vm.Module, true), newTab);
            }
        }
예제 #12
0
        public void WriteAddress(ModuleVM vm)
        {
            ulong addr    = vm.Module.Address;
            ulong endAddr = addr + vm.Module.Size;

            if (addr == 0)
            {
                output.Write("<no address>", TextTokenType.Text);
            }
            else
            {
                WriteAddress(addr);
                output.Write('-', TextTokenType.Operator);
                WriteAddress(endAddr);
            }
        }
예제 #13
0
        public void WriteAddress(ModuleVM vm)
        {
            ulong addr    = vm.Module.Address;
            ulong endAddr = addr + vm.Module.Size;

            if (addr == 0)
            {
                output.Write(BoxedTextColor.Text, dnSpy_Debugger_Resources.Module_NoAddress);
            }
            else
            {
                WriteAddress(addr);
                output.Write(BoxedTextColor.Operator, "-");
                WriteAddress(endAddr);
            }
        }
예제 #14
0
        public void WriteAddress(ModuleVM vm)
        {
            ulong addr    = vm.Module.Address;
            ulong endAddr = addr + vm.Module.Size;

            if (addr == 0)
            {
                output.Write(dnSpy_Debugger_Resources.Module_NoAddress, TextTokenKind.Text);
            }
            else
            {
                WriteAddress(addr);
                output.Write("-", TextTokenKind.Operator);
                WriteAddress(endAddr);
            }
        }
예제 #15
0
		void WriteFilename(ModuleVM vm, string filename) {
			if (vm.Module.IsDynamic || vm.Module.IsInMemory)
				filename = DebugOutputUtils.FilterName(filename, 300);
			output.WriteFilename(filename);
		}
예제 #16
0
        static void ExecuteInternal(IDocumentTabService documentTabService, Lazy <IInMemoryModuleService> inMemoryModuleService, ModuleVM vm, bool newTab)
        {
            if (vm == null)
            {
                return;
            }

            if (GoToModuleModulesCtxMenuCommand.ShowErrorIfDynamic(inMemoryModuleService, vm.Module))
            {
                GoToModuleModulesCtxMenuCommand.GoToFile(documentTabService, inMemoryModuleService.Value.LoadDocument(vm.Module, true), newTab);
            }
        }
예제 #17
0
		public void WriteVersion(ModuleVM vm) {
			if (vm.Version != null)
				output.Write(vm.Version);
		}
예제 #18
0
		public void WriteOrder(ModuleVM vm) {
			output.Write(string.Format("{0}", vm.Module.ModuleOrder), TextTokenType.Number);
		}
예제 #19
0
		public void WriteVersion(ModuleVM vm) {
			if (vm.Version == null)
				output.Write("???", TextTokenType.Error);
			else
				output.Write(vm.Version);
		}
예제 #20
0
파일: Commands.cs 프로젝트: rdavydov/dnSpy
 internal static void ExecuteInternal(IFileTabManager fileTabManager, Lazy <IInMemoryModuleManager> inMemoryModuleManager, Lazy <IModuleLoader> moduleLoader, ModuleVM vm, bool newTab)
 {
     if (vm == null)
     {
         return;
     }
     if (ShowErrorIfDynamic(inMemoryModuleManager, vm.Module))
     {
         GoToFile(fileTabManager, moduleLoader.Value.LoadModule(vm.Module, canLoadDynFile: true, isAutoLoaded: false), newTab);
     }
 }
예제 #21
0
 public void WriteAppDomain(ModuleVM vm)
 {
     output.Write(vm.Module.AppDomain.CorAppDomain, dbg);
 }
예제 #22
0
 public void WriteOrder(ModuleVM vm) => output.Write(BoxedTextColor.Number, string.Format("{0}", vm.Module.UniqueId));
예제 #23
0
		public void WriteProcess(ModuleVM vm) {
			output.Write(vm.Module.Process, useHex);
		}
예제 #24
0
		public void WriteAppDomain(ModuleVM vm) {
			output.Write(vm.Module.AppDomain.CorAppDomain);
		}
예제 #25
0
파일: Commands.cs 프로젝트: rdavydov/dnSpy
        static void ExecuteInternal(IFileTabManager fileTabManager, Lazy <IInMemoryModuleManager> inMemoryModuleManager, ModuleVM vm, bool newTab)
        {
            if (vm == null)
            {
                return;
            }

            if (GoToModuleModulesCtxMenuCommand.ShowErrorIfDynamic(inMemoryModuleManager, vm.Module))
            {
                GoToModuleModulesCtxMenuCommand.GoToFile(fileTabManager, inMemoryModuleManager.Value.LoadFile(vm.Module, true), newTab);
            }
        }
예제 #26
0
 internal static void ExecuteInternal(IDocumentTabService documentTabService, Lazy <IInMemoryModuleService> inMemoryModuleService, Lazy <IModuleLoader> moduleLoader, ModuleVM vm, bool newTab)
 {
     if (vm == null)
     {
         return;
     }
     if (ShowErrorIfDynamic(inMemoryModuleService, vm.Module))
     {
         GoToFile(documentTabService, moduleLoader.Value.LoadModule(vm.Module, canLoadDynFile: true, isAutoLoaded: false), newTab);
     }
 }
예제 #27
0
 public void WriteName(ModuleVM vm)
 {
     WriteFilename(vm, DebugOutputUtils.GetFilename(vm.Module.Name));
 }
예제 #28
0
 public void WriteOptimized(ModuleVM vm)
 {
     output.WriteYesNo(vm.IsOptimized);
 }
예제 #29
0
 public void WriteInMemory(ModuleVM vm)
 {
     output.WriteYesNo(vm.Module.IsInMemory);
 }
예제 #30
0
 public void WriteProcess(ModuleVM vm)
 {
     output.Write(vm.Module.Process, useHex);
 }
예제 #31
0
		public void WriteOrder(ModuleVM vm) => output.Write(BoxedTextColor.Number, string.Format("{0}", vm.Module.UniqueId));
예제 #32
0
		public void WriteName(ModuleVM vm) {
			WriteFilename(vm, DebugOutputUtils.GetFilename(vm.Module.Name));
		}
예제 #33
0
		public void WriteAppDomain(ModuleVM vm) => output.Write(vm.Module.AppDomain.CorAppDomain, dbg);
예제 #34
0
 public void WritePath(ModuleVM vm)
 {
     WriteFilename(vm, vm.Module.Name);
 }
예제 #35
0
		public void WritePath(ModuleVM vm) {
			WriteFilename(vm, vm.Module.Name);
		}
예제 #36
0
 public void WriteDynamic(ModuleVM vm)
 {
     output.WriteYesNo(vm.Module.IsDynamic);
 }
예제 #37
0
		public void WriteOptimized(ModuleVM vm) {
			output.WriteYesNo(vm.IsOptimized);
		}
예제 #38
0
 public void WriteOrder(ModuleVM vm)
 {
     output.Write(string.Format("{0}", vm.Module.ModuleOrder), TextTokenKind.Number);
 }
예제 #39
0
		public void WriteDynamic(ModuleVM vm) {
			output.WriteYesNo(vm.Module.IsDynamic);
		}
예제 #40
0
		public void WriteInMemory(ModuleVM vm) {
			output.WriteYesNo(vm.Module.IsInMemory);
		}
예제 #41
0
		public void WriteOrder(ModuleVM vm) {
			output.Write(string.Format("{0}", vm.Module.UniqueId), TextTokenKind.Number);
		}