/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using System;
using System.ComponentModel;
using System.Diagnostics;
namespace dnSpy.Contracts.Debugger {
///
/// A module in a process
///
public abstract class DbgModule : DbgObject, INotifyPropertyChanged {
///
/// Raised when a property is changed
///
public abstract event PropertyChangedEventHandler? PropertyChanged;
///
/// Gets the runtime
///
public abstract DbgRuntime Runtime { get; }
///
/// Gets the process
///
public DbgProcess Process => Runtime.Process;
///
/// Gets the app domain or null if it's a process module
///
public abstract DbgAppDomain? AppDomain { get; }
///
/// Gets the module object created by the debug engine
///
public abstract DbgInternalModule InternalModule { get; }
///
/// true if it's an EXE file, false if it's a DLL file
///
public abstract bool IsExe { get; }
///
/// true if and are valid
///
public bool HasAddress => Address != 0 && Size != 0;
///
/// Address of module. Only valid if is true
///
public abstract ulong Address { get; }
///
/// Size of module. Only valid if is true
///
public abstract uint Size { get; }
///
/// Image layout
///
public abstract DbgImageLayout ImageLayout { get; }
///
/// Name of module
///
public abstract string Name { get; }
///
/// Filename if it exists on disk, else it could be any longer name
///
public abstract string Filename { get; }
///
/// true if it's a dynamic module (the application can add more types and members to the module at runtime)
///
public abstract bool IsDynamic { get; }
///
/// true if it's an in-memory module
///
public abstract bool IsInMemory { get; }
///
/// true if it's an optimized module, false if it's an unoptimized module, and null if it's a native module.
///
public abstract bool? IsOptimized { get; }
///
/// Load order of this module
///
public abstract int Order { get; }
///
/// Timestamp (UTC) of module (eg. as found in the PE header) or null
///
public abstract DateTime? Timestamp { get; }
///
/// Gets the version, eg. the file version, see
///
public abstract string Version { get; }
///
/// Raised when the module's memory has been updated (eg. decrypted)
///
public abstract event EventHandler? Refreshed;
///
/// Gets incremented when the module gets refreshed ()
///
public abstract int RefreshedVersion { get; }
}
}