Skip to content

Commit fcd103e

Browse files
committed
style: Code cleanup
1 parent d2cbe4b commit fcd103e

12 files changed

Lines changed: 65 additions & 68 deletions

DemoApp/Program.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.ComponentModel;
4-
using System.Diagnostics;
1+
using MemoryModule;
2+
using System;
53
using System.IO;
6-
using System.Linq;
74
using System.Runtime.InteropServices;
8-
using System.Text;
9-
using System.Threading.Tasks;
10-
11-
using MemoryModule;
125

136
namespace DemoApp
147
{

MemoryModule/CStyleMemory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace MemoryModule
99
{
10-
public static unsafe class CStyleMemory
10+
internal static unsafe class CStyleMemory
1111
{
1212
private const int magic = 0x414d_534c;
1313

MemoryModule/Dll.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace MemoryModule
77
{
8-
public enum Dll : uint
8+
internal enum Dll : uint
99
{
1010
ProcessAttach = 1,
1111
ThreadAttach = 2,

MemoryModule/Error.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace MemoryModule
77
{
8-
public enum Error : uint
8+
internal enum Error : uint
99
{
1010
InvalidData = 13,
1111
BadExeFormat = 193,

MemoryModule/Heap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace MemoryModule
77
{
8-
enum Heap : uint
8+
internal enum Heap : uint
99
{
1010
ZeroMemory = 0x00000008,
1111
}

MemoryModule/Image.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
}

MemoryModule/ImageRelocation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace MemoryModule
77
{
8-
public enum ImageRelocation
8+
internal enum ImageRelocation
99
{
1010
BasedAbsolute = 0,
1111
BasedHigh = 1,

MemoryModule/ImageSectionMemory.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,14 @@
66
namespace 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
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace MemoryModule
77
{
88
[Flags]
9-
enum Memory : uint
9+
internal enum MemoryAllocation : uint
1010
{
1111
Commit = 0x1000,
1212
Reserve = 0x2000,

0 commit comments

Comments
 (0)