ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/Win32/Sojaner.MemoryScanner/PEReader.cs
(Generate patch)

Comparing trunk/Win32/Sojaner.MemoryScanner/PEReader.cs (file contents):
Revision 160 by william, Mon May 28 05:30:14 2012 UTC vs.
Revision 161 by william, Mon May 28 05:55:59 2012 UTC

# Line 30 | Line 30 | namespace Sojaner.MemoryScanner
30                  size = Marshal.SizeOf(typeof(IMAGE_DOS_HEADER));
31                  data = br.ReadBytes(size);
32                  pinnedPacket = GCHandle.Alloc(data, GCHandleType.Pinned);
33 <                IMAGE_DOS_HEADER IMAGE_DOS_HEADER = (IMAGE_DOS_HEADER)Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), typeof(IMAGE_DOS_HEADER));
33 >                IMAGE_DOS_HEADER DOS_HEADER = (IMAGE_DOS_HEADER)Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), typeof(IMAGE_DOS_HEADER));
34                  pinnedPacket.Free();
35                  #endregion
36  
37                  // skip the old dos stub
38 <                br.BaseStream.Seek(IMAGE_DOS_HEADER.e_lfanew, SeekOrigin.Begin);
38 >                br.BaseStream.Seek(DOS_HEADER.e_lfanew, SeekOrigin.Begin);
39  
40                  #region IMAGE_NT_HEADERS
41                  size = Marshal.SizeOf(typeof(IMAGE_NT_HEADERS));
42                  data = br.ReadBytes(size);
43                  pinnedPacket = GCHandle.Alloc(data, GCHandleType.Pinned);
44 <                IMAGE_NT_HEADERS IMAGE_NT_HEADERS = (IMAGE_NT_HEADERS)Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), typeof(IMAGE_NT_HEADERS));
44 >                IMAGE_NT_HEADERS NT_HEADER = (IMAGE_NT_HEADERS)Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), typeof(IMAGE_NT_HEADERS));
45                  pinnedPacket.Free();
46                  #endregion
47  
48  
49
49                  br.Close();
50              }
51  
# Line 61 | Line 60 | namespace Sojaner.MemoryScanner
60          {
61              public UInt32 VirtualAddress;
62              public UInt32 Size;
63 +            public bool HasAddress { get { return (VirtualAddress != 0); } }
64 +            public bool HasSize { get { return (Size > 0); } }
65          }
66          #endregion
67          #region IMAGE_FILE_HEADER

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines