-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathModuleData.cs
More file actions
75 lines (68 loc) · 3.1 KB
/
ModuleData.cs
File metadata and controls
75 lines (68 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Diagnostics;
using System.IO;
namespace PSExt
{
[DebuggerDisplay("{ModuleName}")]
public class ModuleData
{
public ModuleData(string moduleName, string imageName, string loadedImageName, string loadedPdbName, ulong baseOfImage, uint imageSize, uint timeDateStamp, uint checkSum, uint numSyms, uint symType, Guid pdbSig70, uint pdbAge, bool pdbUnmatched, bool lineNumbers, bool globalSymbols, bool typeInfo, bool sourceIndexed, bool publics, uint machineType, ModuleVersionInfo versionInfo)
{
ModuleName = moduleName;
ImageName = imageName;
LoadedImageName = loadedImageName;
LoadedPdbName = loadedPdbName;
BaseOfImage = baseOfImage;
ImageSize = imageSize;
TimeDateStamp = timeDateStamp;
CheckSum = checkSum;
NumSyms = numSyms;
SymType = (SymType) symType;
PdbSig70 = pdbSig70;
PdbAge = pdbAge;
PdbUnmatched = pdbUnmatched;
LineNumbers = lineNumbers;
GlobalSymbols = globalSymbols;
TypeInfo = typeInfo;
SourceIndexed = sourceIndexed;
Publics = publics;
MachineType = (ImageFileMachineType) machineType;
FileVersion = versionInfo.FileVersion;
ProductVersion = versionInfo.ProductVersion;
ProductName = versionInfo.ProductName;
Comments = versionInfo.Comments;
Description = versionInfo.Description;
Company = versionInfo.Company;
}
public string ModuleName { get; } // module name
public string ImageName { get; } // image name
public string LoadedImageName { get; } // symbol file name
public string LoadedPdbName { get; } // pdb file name
public ulong BaseOfImage { get; } // base load address of module
public uint ImageSize { get; } // virtual size of the loaded module
public uint TimeDateStamp { get; } // date/time stamp from pe header
public uint CheckSum { get; } // checksum from the pe header
public uint NumSyms { get; } // number of symbols in the symbol table
public SymType SymType { get; } // type of symbols loaded
public Guid PdbSig70 { get; } // Signature of PDB (VC 7 and up)
public uint PdbAge { get; } // DBI age of pdb
public bool PdbUnmatched { get; } // loaded an unmatched pdb
public bool LineNumbers { get; } // we have line number information
public bool GlobalSymbols { get; } // we have internal symbol information
public bool TypeInfo { get; } // we have type information
public bool SourceIndexed { get; } // pdb supports source server
public bool Publics { get; } // contains public symbols
public ImageFileMachineType MachineType { get; } // IMAGE_FILE_MACHINE_XXX from ntimage.h and winnt.h
public DateTime Built => new DateTime((62135600400 + TimeDateStamp)*10000000, DateTimeKind.Utc);
public ulong EndOfImage => BaseOfImage + ImageSize;
public FileVersionInfo VersionInfo
=> File.Exists(LoadedImageName) ? FileVersionInfo.GetVersionInfo(LoadedImageName) : null;
public string FileVersion { get; }
public string ProductVersion { get; }
public string Description { get; }
public string Company { get; }
public string ProductName { get; }
public string Comments { get; }
public override string ToString() => ModuleName;
}
}