File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . ComponentModel ;
4- using System . Diagnostics ;
1+ using MemoryModule ;
2+ using System ;
53using System . IO ;
6- using System . Linq ;
74using System . Runtime . InteropServices ;
8- using System . Text ;
9- using System . Threading . Tasks ;
10-
11- using MemoryModule ;
125
136namespace DemoApp
147{
Original file line number Diff line number Diff line change 77
88namespace MemoryModule
99{
10- public static unsafe class CStyleMemory
10+ internal static unsafe class CStyleMemory
1111 {
1212 private const int magic = 0x414d_534c ;
1313
Original file line number Diff line number Diff line change 55
66namespace MemoryModule
77{
8- public enum Dll : uint
8+ internal enum Dll : uint
99 {
1010 ProcessAttach = 1 ,
1111 ThreadAttach = 2 ,
Original file line number Diff line number Diff line change 55
66namespace MemoryModule
77{
8- public enum Error : uint
8+ internal enum Error : uint
99 {
1010 InvalidData = 13 ,
1111 BadExeFormat = 193 ,
Original file line number Diff line number Diff line change 55
66namespace MemoryModule
77{
8- enum Heap : uint
8+ internal enum Heap : uint
99 {
1010 ZeroMemory = 0x00000008 ,
1111 }
Original file line number Diff line number Diff line change @@ -12,10 +12,6 @@ public static class Image
1212 public const int FileMachinei386 = 0x14c ;
1313 public const int FileMachineAMD64 = 0x8664 ;
1414 public const int FileDll = 0x2000 ;
15- public const int DirectoryEntryImport = 1 ;
16- public const int DirectoryEntryBaseReloc = 5 ;
17- public const int DirectoryEntryTls = 9 ;
18- public const int DirectoryEntryExport = 0 ;
1915 public const int SizeOfBaseRelocation = 8 ;
2016 public const ulong OrdinalFlag64 = 0x8000000000000000 ;
2117 public const uint OrdinalFlag32 = 0x80000000 ;
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Text ;
4+
5+ namespace MemoryModule
6+ {
7+ internal enum ImageDirectoryEntry
8+ {
9+ Import = 1 ,
10+ BaseReloc = 5 ,
11+ Tls = 9 ,
12+ Export = 0 ,
13+ }
14+ }
Original file line number Diff line number Diff line change 55
66namespace MemoryModule
77{
8- public enum ImageRelocation
8+ internal enum ImageRelocation
99 {
1010 BasedAbsolute = 0 ,
1111 BasedHigh = 1 ,
Original file line number Diff line number Diff line change 66namespace MemoryModule
77{
88 [ Flags ]
9- enum ImageSectionMemory : uint
9+ internal enum ImageSectionMemory : uint
1010 {
11- //#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
1211 Discardable = 0x02000000 ,
13- //#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000
1412 NotCached = 0x04000000 ,
15- //#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000
1613 NotPaged = 0x08000000 ,
17- //#define IMAGE_SCN_MEM_SHARED 0x10000000
1814 Shared = 0x10000000 ,
19- //#define IMAGE_SCN_MEM_EXECUTE 0x20000000
2015 Exectute = 0x20000000 ,
21- //#define IMAGE_SCN_MEM_READ 0x40000000
2216 Read = 0x40000000 ,
23- //#define IMAGE_SCN_MEM_WRITE 0x80000000
2417 Write = 0x80000000 ,
2518 }
2619}
Original file line number Diff line number Diff line change 66namespace MemoryModule
77{
88 [ Flags ]
9- enum Memory : uint
9+ internal enum MemoryAllocation : uint
1010 {
1111 Commit = 0x1000 ,
1212 Reserve = 0x2000 ,
You can’t perform that action at this time.
0 commit comments