/[RomCheater]/trunk/Win32/Sojaner.MemoryScanner/PEData.cs
ViewVC logotype

Diff of /trunk/Win32/Sojaner.MemoryScanner/PEData.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 611 by william, Sat Jun 8 03:35:12 2013 UTC revision 612 by william, Sat Jun 8 03:55:09 2013 UTC
# Line 122  namespace Sojaner.MemoryScanner Line 122  namespace Sojaner.MemoryScanner
122      [StructLayout(LayoutKind.Sequential, Pack = 1)]      [StructLayout(LayoutKind.Sequential, Pack = 1)]
123      public struct IMAGE_OPTIONAL_HEADER32      public struct IMAGE_OPTIONAL_HEADER32
124      {      {
125          public UInt16 Magic;          public UInt16 _Magic;
126          public Byte MajorLinkerVersion;          public Byte _MajorLinkerVersion;
127          public Byte MinorLinkerVersion;          public Byte _MinorLinkerVersion;
128          public UInt32 SizeOfCode;          public UInt32 _SizeOfCode;
129          public UInt32 SizeOfInitializedData;          public UInt32 _SizeOfInitializedData;
130          public UInt32 SizeOfUninitializedData;          public UInt32 _SizeOfUninitializedData;
131          public UInt32 AddressOfEntryPoint;          public UInt32 _AddressOfEntryPoint;
132          public UInt32 BaseOfCode;          public UInt32 _BaseOfCode;
133          public UInt32 BaseOfData;          public UInt32 _BaseOfData;
134          public UInt32 ImageBase;          public UInt32 _ImageBase;
135          public UInt32 SectionAlignment;          public UInt32 _SectionAlignment;
136          public UInt32 FileAlignment;          public UInt32 _FileAlignment;
137          public UInt16 MajorOperatingSystemVersion;          public UInt16 _MajorOperatingSystemVersion;
138          public UInt16 MinorOperatingSystemVersion;          public UInt16 _MinorOperatingSystemVersion;
139          public UInt16 MajorImageVersion;          public UInt16 _MajorImageVersion;
140          public UInt16 MinorImageVersion;          public UInt16 _MinorImageVersion;
141          public UInt16 MajorSubsystemVersion;          public UInt16 _MajorSubsystemVersion;
142          public UInt16 MinorSubsystemVersion;          public UInt16 _MinorSubsystemVersion;
143          public UInt32 Win32VersionValue;          public UInt32 _Win32VersionValue;
144          public UInt32 SizeOfImage;          public UInt32 _SizeOfImage;
145          public UInt32 SizeOfHeaders;          public UInt32 _SizeOfHeaders;
146          public UInt32 CheckSum;          public UInt32 _CheckSum;
147          public SubSystemType Subsystem;          public SubSystemType _Subsystem;
148          public DllCharacteristicsType DllCharacteristics;          public DllCharacteristicsType _DllCharacteristics;
149          public UInt32 SizeOfStackReserve;          public UInt32 _SizeOfStackReserve;
150          public UInt32 SizeOfStackCommit;          public UInt32 _SizeOfStackCommit;
151          public UInt32 SizeOfHeapReserve;          public UInt32 _SizeOfHeapReserve;
152          public UInt32 SizeOfHeapCommit;          public UInt32 _SizeOfHeapCommit;
153          public UInt32 LoaderFlags;          public UInt32 _LoaderFlags;
154          public UInt32 NumberOfRvaAndSizes;          public UInt32 _NumberOfRvaAndSizes;
155    
156          public IMAGE_DATA_DIRECTORY ExportTable;          public IMAGE_DATA_DIRECTORY _ExportTable;
157          public IMAGE_DATA_DIRECTORY ImportTable;          public IMAGE_DATA_DIRECTORY _ImportTable;
158          public IMAGE_DATA_DIRECTORY ResourceTable;          public IMAGE_DATA_DIRECTORY _ResourceTable;
159          public IMAGE_DATA_DIRECTORY ExceptionTable;          public IMAGE_DATA_DIRECTORY _ExceptionTable;
160          public IMAGE_DATA_DIRECTORY CertificateTable;          public IMAGE_DATA_DIRECTORY _CertificateTable;
161          public IMAGE_DATA_DIRECTORY BaseRelocationTable;          public IMAGE_DATA_DIRECTORY _BaseRelocationTable;
162          public IMAGE_DATA_DIRECTORY Debug;          public IMAGE_DATA_DIRECTORY _Debug;
163          public IMAGE_DATA_DIRECTORY Architecture;          public IMAGE_DATA_DIRECTORY _Architecture;
164          public IMAGE_DATA_DIRECTORY GlobalPtr;          public IMAGE_DATA_DIRECTORY _GlobalPtr;
165          public IMAGE_DATA_DIRECTORY TLSTable;          public IMAGE_DATA_DIRECTORY _TLSTable;
166          public IMAGE_DATA_DIRECTORY LoadConfigTable;          public IMAGE_DATA_DIRECTORY _LoadConfigTable;
167          public IMAGE_DATA_DIRECTORY BoundImport;          public IMAGE_DATA_DIRECTORY _BoundImport;
168          public IMAGE_DATA_DIRECTORY IAT;          public IMAGE_DATA_DIRECTORY _IAT;
169          public IMAGE_DATA_DIRECTORY DelayImportDescriptor;          public IMAGE_DATA_DIRECTORY _DelayImportDescriptor;
170          public IMAGE_DATA_DIRECTORY CLRRuntimeHeader;          public IMAGE_DATA_DIRECTORY _CLRRuntimeHeader;
171          public IMAGE_DATA_DIRECTORY Reserved;          public IMAGE_DATA_DIRECTORY _Reserved;
172    
173            public string Magic { get { return ((MagicType)_Magic).ToString(); } }
174            public string MajorLinkerVersion { get { return string.Format("0x{0:x2}", _MajorLinkerVersion); } }
175            public string MinorLinkerVersion { get { return string.Format("0x{0:x2}", _MajorLinkerVersion); } }
176    
177            public string SizeOfCode { get { return string.Format("0x{0:x2}", _SizeOfCode); } }
178            public string SizeOfInitializedData { get { return string.Format("0x{0:x8}", _SizeOfInitializedData); } }
179            public string SizeOfUninitializedData { get { return string.Format("0x{0:x8}", _SizeOfUninitializedData); } }
180            public string AddressOfEntryPoint { get { return string.Format("0x{0:x8}", _AddressOfEntryPoint); } }
181            public string BaseOfCode { get { return string.Format("0x{0:x8}", _BaseOfCode); } }
182            public string BaseOfData { get { return string.Format("0x{0:x8}", _BaseOfData); } }
183            public string ImageBase { get { return string.Format("0x{0:x8}", _ImageBase); } }
184    
185            public string SectionAlignment { get { return string.Format("0x{0:x8}", _SectionAlignment); } }
186            public string FileAlignment { get { return string.Format("0x{0:x8}", _FileAlignment); } }
187    
188            public string MajorOperatingSystemVersion { get { return string.Format("0x{0:x4}", _MajorOperatingSystemVersion); } }
189            public string MinorOperatingSystemVersion { get { return string.Format("0x{0:x4}", _MinorOperatingSystemVersion); } }
190            public string MajorImageVersion { get { return string.Format("0x{0:x4}", _MajorImageVersion); } }
191            public string MinorImageVersion { get { return string.Format("0x{0:x4}", _MinorImageVersion); } }
192            public string MajorSubsystemVersion { get { return string.Format("0x{0:x4}", _MajorSubsystemVersion); } }
193            public string MinorSubsystemVersion { get { return string.Format("0x{0:x4}", _MinorSubsystemVersion); } }
194    
195            public string Win32VersionValue { get { return string.Format("0x{0:x8}", _Win32VersionValue); } }
196            public string SizeOfImage { get { return string.Format("0x{0:x8}", _SizeOfImage); } }
197            public string SizeOfHeaders { get { return string.Format("0x{0:x8}", _SizeOfHeaders); } }
198            public string CheckSum { get { return string.Format("0x{0:x8}", _CheckSum); } }
199    
200            public string Subsystem { get { return ((SubSystemType)_Subsystem).ToString(); } }
201            public string DllCharacteristics { get { return string.Format("0x{0:x4}", _DllCharacteristics); } }
202    
203            public string SizeOfStackReserve { get { return string.Format("0x{0:x8}", _SizeOfStackReserve); } }
204            public string SizeOfStackCommit { get { return string.Format("0x{0:x8}", _SizeOfStackCommit); } }
205            public string SizeOfHeapReserve { get { return string.Format("0x{0:x8}", _SizeOfHeapReserve); } }
206            public string SizeOfHeapCommit { get { return string.Format("0x{0:x8}", _SizeOfHeapCommit); } }
207    
208            public string LoaderFlags { get { return string.Format("0x{0:x8}", _LoaderFlags); } }
209            public string NumberOfRvaAndSizes { get { return string.Format("0x{0:x8}", _NumberOfRvaAndSizes); } }
210    
211    
212            // data directories
213            public IMAGE_DATA_DIRECTORY ExportTable { get { return _ExportTable; } }
214            public IMAGE_DATA_DIRECTORY ImportTable { get { return _ImportTable; } }
215            public IMAGE_DATA_DIRECTORY ResourceTable { get { return _ResourceTable; } }
216            public IMAGE_DATA_DIRECTORY ExceptionTable { get { return _ExceptionTable; } }
217            public IMAGE_DATA_DIRECTORY CertificateTable { get { return _CertificateTable; } }
218            public IMAGE_DATA_DIRECTORY BaseRelocationTable { get { return _BaseRelocationTable; } }
219            public IMAGE_DATA_DIRECTORY Debug { get { return _Debug; } }
220            public IMAGE_DATA_DIRECTORY Architecture { get { return _Architecture; } }
221            public IMAGE_DATA_DIRECTORY GlobalPtr { get { return _GlobalPtr; } }
222            public IMAGE_DATA_DIRECTORY TLSTable { get { return _TLSTable; } }
223            public IMAGE_DATA_DIRECTORY LoadConfigTable { get { return _LoadConfigTable; } }
224            public IMAGE_DATA_DIRECTORY BoundImport { get { return _BoundImport; } }
225            public IMAGE_DATA_DIRECTORY IAT { get { return _IAT; } }
226            public IMAGE_DATA_DIRECTORY DelayImportDescriptor { get { return _DelayImportDescriptor; } }
227            public IMAGE_DATA_DIRECTORY CLRRuntimeHeader { get { return _CLRRuntimeHeader; } }
228            public IMAGE_DATA_DIRECTORY Reserved { get { return _Reserved; } }
229    
230            public override string ToString()
231            {
232                return Magic;
233            }
234      }      }
235    
236      [StructLayout(LayoutKind.Sequential, Pack = 1)]      [StructLayout(LayoutKind.Sequential, Pack = 1)]
237      [TypeConverter(typeof(ExpandableObjectConverter))]      [TypeConverter(typeof(ExpandableObjectConverter))]
238      public struct IMAGE_OPTIONAL_HEADER64      public struct IMAGE_OPTIONAL_HEADER64
239      {      {
240          public UInt16 Magic;          public UInt16 _Magic;
241          public Byte MajorLinkerVersion;          public Byte _MajorLinkerVersion;
242          public Byte MinorLinkerVersion;          public Byte _MinorLinkerVersion;
243          public UInt32 SizeOfCode;          public UInt32 _SizeOfCode;
244          public UInt32 SizeOfInitializedData;          public UInt32 _SizeOfInitializedData;
245          public UInt32 SizeOfUninitializedData;          public UInt32 _SizeOfUninitializedData;
246          public UInt32 AddressOfEntryPoint;          public UInt32 _AddressOfEntryPoint;
247          public UInt32 BaseOfCode;          public UInt32 _BaseOfCode;
248          public UInt64 ImageBase;          public UInt64 _ImageBase;
249          public UInt32 SectionAlignment;          public UInt32 _SectionAlignment;
250          public UInt32 FileAlignment;          public UInt32 _FileAlignment;
251          public UInt16 MajorOperatingSystemVersion;          public UInt16 _MajorOperatingSystemVersion;
252          public UInt16 MinorOperatingSystemVersion;          public UInt16 _MinorOperatingSystemVersion;
253          public UInt16 MajorImageVersion;          public UInt16 _MajorImageVersion;
254          public UInt16 MinorImageVersion;          public UInt16 _MinorImageVersion;
255          public UInt16 MajorSubsystemVersion;          public UInt16 _MajorSubsystemVersion;
256          public UInt16 MinorSubsystemVersion;          public UInt16 _MinorSubsystemVersion;
257          public UInt32 Win32VersionValue;          public UInt32 _Win32VersionValue;
258          public UInt32 SizeOfImage;          public UInt32 _SizeOfImage;
259          public UInt32 SizeOfHeaders;          public UInt32 _SizeOfHeaders;
260          public UInt32 CheckSum;          public UInt32 _CheckSum;
261          public UInt16 Subsystem;          public UInt16 _Subsystem;
262          public DllCharacteristicsType DllCharacteristics;          public DllCharacteristicsType _DllCharacteristics;
263          public UInt64 SizeOfStackReserve;          public UInt64 _SizeOfStackReserve;
264          public UInt64 SizeOfStackCommit;          public UInt64 _SizeOfStackCommit;
265          public UInt64 SizeOfHeapReserve;          public UInt64 _SizeOfHeapReserve;
266          public UInt64 SizeOfHeapCommit;          public UInt64 _SizeOfHeapCommit;
267          public UInt32 LoaderFlags;          public UInt32 _LoaderFlags;
268          public UInt32 NumberOfRvaAndSizes;          public UInt32 _NumberOfRvaAndSizes;
269    
270          public IMAGE_DATA_DIRECTORY ExportTable;          public IMAGE_DATA_DIRECTORY _ExportTable;
271          public IMAGE_DATA_DIRECTORY ImportTable;          public IMAGE_DATA_DIRECTORY _ImportTable;
272          public IMAGE_DATA_DIRECTORY ResourceTable;          public IMAGE_DATA_DIRECTORY _ResourceTable;
273          public IMAGE_DATA_DIRECTORY ExceptionTable;          public IMAGE_DATA_DIRECTORY _ExceptionTable;
274          public IMAGE_DATA_DIRECTORY CertificateTable;          public IMAGE_DATA_DIRECTORY _CertificateTable;
275          public IMAGE_DATA_DIRECTORY BaseRelocationTable;          public IMAGE_DATA_DIRECTORY _BaseRelocationTable;
276          public IMAGE_DATA_DIRECTORY Debug;          public IMAGE_DATA_DIRECTORY _Debug;
277          public IMAGE_DATA_DIRECTORY Architecture;          public IMAGE_DATA_DIRECTORY _Architecture;
278          public IMAGE_DATA_DIRECTORY GlobalPtr;          public IMAGE_DATA_DIRECTORY _GlobalPtr;
279          public IMAGE_DATA_DIRECTORY TLSTable;          public IMAGE_DATA_DIRECTORY _TLSTable;
280          public IMAGE_DATA_DIRECTORY LoadConfigTable;          public IMAGE_DATA_DIRECTORY _LoadConfigTable;
281          public IMAGE_DATA_DIRECTORY BoundImport;          public IMAGE_DATA_DIRECTORY _BoundImport;
282          public IMAGE_DATA_DIRECTORY IAT;          public IMAGE_DATA_DIRECTORY _IAT;
283          public IMAGE_DATA_DIRECTORY DelayImportDescriptor;          public IMAGE_DATA_DIRECTORY _DelayImportDescriptor;
284          public IMAGE_DATA_DIRECTORY CLRRuntimeHeader;          public IMAGE_DATA_DIRECTORY _CLRRuntimeHeader;
285          public IMAGE_DATA_DIRECTORY Reserved;          public IMAGE_DATA_DIRECTORY _Reserved;
286    
287    
288            public string Magic { get { return ((MagicType)_Magic).ToString(); } }
289            public string MajorLinkerVersion { get { return string.Format("0x{0:x2}", _MajorLinkerVersion); } }
290            public string MinorLinkerVersion { get { return string.Format("0x{0:x2}", _MajorLinkerVersion); } }
291    
292            public string SizeOfCode { get { return string.Format("0x{0:x2}", _SizeOfCode); } }
293            public string SizeOfInitializedData { get { return string.Format("0x{0:x8}", _SizeOfInitializedData); } }
294            public string SizeOfUninitializedData { get { return string.Format("0x{0:x8}", _SizeOfUninitializedData); } }
295            public string AddressOfEntryPoint { get { return string.Format("0x{0:x8}", _AddressOfEntryPoint); } }
296            public string BaseOfCode { get { return string.Format("0x{0:x8}", _BaseOfCode); } }
297    
298            public string ImageBase { get { return string.Format("0x{0:x16}", _ImageBase); } }
299    
300            public string SectionAlignment { get { return string.Format("0x{0:x8}", _SectionAlignment); } }
301            public string FileAlignment { get { return string.Format("0x{0:x8}", _FileAlignment); } }
302    
303            public string MajorOperatingSystemVersion { get { return string.Format("0x{0:x4}", _MajorOperatingSystemVersion); } }
304            public string MinorOperatingSystemVersion { get { return string.Format("0x{0:x4}", _MinorOperatingSystemVersion); } }
305            public string MajorImageVersion { get { return string.Format("0x{0:x4}", _MajorImageVersion); } }
306            public string MinorImageVersion { get { return string.Format("0x{0:x4}", _MinorImageVersion); } }
307            public string MajorSubsystemVersion { get { return string.Format("0x{0:x4}", _MajorSubsystemVersion); } }
308            public string MinorSubsystemVersion { get { return string.Format("0x{0:x4}", _MinorSubsystemVersion); } }
309    
310            public string Win32VersionValue { get { return string.Format("0x{0:x8}", _Win32VersionValue); } }
311            public string SizeOfImage { get { return string.Format("0x{0:x8}", _SizeOfImage); } }
312            public string SizeOfHeaders { get { return string.Format("0x{0:x8}", _SizeOfHeaders); } }
313            public string CheckSum { get { return string.Format("0x{0:x8}", _CheckSum); } }
314    
315            public string Subsystem { get { return ((SubSystemType)_Subsystem).ToString(); } }
316            public string DllCharacteristics { get { return string.Format("0x{0:x4}", _DllCharacteristics); } }
317    
318            public string SizeOfStackReserve { get { return string.Format("0x{0:x16}", _SizeOfStackReserve); } }
319            public string SizeOfStackCommit { get { return string.Format("0x{0:x16}", _SizeOfStackCommit); } }
320            public string SizeOfHeapReserve { get { return string.Format("0x{0:x16}", _SizeOfHeapReserve); } }
321            public string SizeOfHeapCommit { get { return string.Format("0x{0:x16}", _SizeOfHeapCommit); } }
322    
323            public string LoaderFlags { get { return string.Format("0x{0:x8}", _LoaderFlags); } }
324            public string NumberOfRvaAndSizes { get { return string.Format("0x{0:x8}", _NumberOfRvaAndSizes); } }
325    
326            // data directories
327            public IMAGE_DATA_DIRECTORY ExportTable { get { return _ExportTable; } }
328            public IMAGE_DATA_DIRECTORY ImportTable { get { return _ImportTable; } }
329            public IMAGE_DATA_DIRECTORY ResourceTable { get { return _ResourceTable; } }
330            public IMAGE_DATA_DIRECTORY ExceptionTable { get { return _ExceptionTable; } }
331            public IMAGE_DATA_DIRECTORY CertificateTable { get { return _CertificateTable; } }
332            public IMAGE_DATA_DIRECTORY BaseRelocationTable { get { return _BaseRelocationTable; } }
333            public IMAGE_DATA_DIRECTORY Debug { get { return _Debug; } }
334            public IMAGE_DATA_DIRECTORY Architecture { get { return _Architecture; } }
335            public IMAGE_DATA_DIRECTORY GlobalPtr { get { return _GlobalPtr; } }
336            public IMAGE_DATA_DIRECTORY TLSTable { get { return _TLSTable; } }
337            public IMAGE_DATA_DIRECTORY LoadConfigTable { get { return _LoadConfigTable; } }
338            public IMAGE_DATA_DIRECTORY BoundImport { get { return _BoundImport; } }
339            public IMAGE_DATA_DIRECTORY IAT { get { return _IAT; } }
340            public IMAGE_DATA_DIRECTORY DelayImportDescriptor { get { return _DelayImportDescriptor; } }
341            public IMAGE_DATA_DIRECTORY CLRRuntimeHeader { get { return _CLRRuntimeHeader; } }
342            public IMAGE_DATA_DIRECTORY Reserved { get { return _Reserved; } }
343    
344            public override string ToString()
345            {
346                return Magic;
347            }
348    
349      }      }
350    
351      [StructLayout(LayoutKind.Sequential, Pack = 1)]      [StructLayout(LayoutKind.Sequential, Pack = 1)]

Legend:
Removed from v.611  
changed lines
  Added in v.612

  ViewVC Help
Powered by ViewVC 1.1.22