-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDep_aslr.cs
68 lines (61 loc) · 1.48 KB
/
Dep_aslr.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace MBST_Lab_1
{
public enum Process_Mitigation_Policy
{
ProcessDEPPolicy = 0,
ProcessASLRPolicy = 1
}
[StructLayout(LayoutKind.Explicit)]
public struct union
{
[FieldOffset(0)]
uint EnableBottomUpRandomization;
[FieldOffset(0)]
uint EnableForceRelocateImages;
[FieldOffset(0)]
uint EnableHighEntropy;
[FieldOffset(0)]
uint DisallowStrippedImages;
[FieldOffset(0)]
uint ReservedFlags;
}
public struct Process_Mitigation_Type_Policy
{
public uint Flags;
public bool EnableBottomUpRandomization
{
get { return (Flags & 1) > 0; }
}
public bool EnableForceRelocateImage
{
get{ return (Flags & 2) > 0; }
}
public bool EnableHighEntropy
{
get { return (Flags & 4) > 0; }
}
public bool DisallowStrippedImages
{
get { return (Flags & 8) > 0; }
}
}
public struct Process_Mitigation_DEP_Policy
{
public uint Flags;
public bool Permanent;
public bool Enable
{
get { return (Flags & 1) > 0; }
}
public bool DisableAtlThunkEmulation
{
get { return (Flags & 2) > 0; }
}
}
}