-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AtelierWindows
authored and
AtelierWindows
committed
Jun 28, 2019
1 parent
eb9a23c
commit d562adf
Showing
41 changed files
with
42,663 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28010.2003 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GayMaker", "GayMaker\GayMaker.csproj", "{F189E983-481E-4740-81B7-13A415D68636}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F189E983-481E-4740-81B7-13A415D68636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F189E983-481E-4740-81B7-13A415D68636}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F189E983-481E-4740-81B7-13A415D68636}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F189E983-481E-4740-81B7-13A415D68636}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {2B72F881-81B5-4BB4-AE0A-2DCB6609589D} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
|
||
namespace GayMaker | ||
{ | ||
class GMAC | ||
{ | ||
public enum FileMapProtection : uint | ||
{ | ||
PageReadonly = 0x02, | ||
PageReadWrite = 0x04, | ||
PageWriteCopy = 0x08, | ||
PageExecuteRead = 0x20, | ||
PageExecuteReadWrite = 0x40, | ||
SectionCommit = 0x8000000, | ||
SectionImage = 0x1000000, | ||
SectionNoCache = 0x10000000, | ||
SectionReserve = 0x4000000, | ||
} | ||
|
||
public enum FileMapAccess : uint | ||
{ | ||
FileMapCopy = 0x0001, | ||
FileMapWrite = 0x0002, | ||
FileMapRead = 0x0004, | ||
FileMapReadWrite = 0x0006, | ||
FileMapAllAccess = 0x001f, | ||
FileMapExecute = 0x0020, | ||
} | ||
|
||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] | ||
public static extern IntPtr CreateFileMapping( | ||
IntPtr hFile, | ||
IntPtr lpFileMappingAttributes, | ||
FileMapProtection flProtect, | ||
uint dwMaximumSizeHigh, | ||
uint dwMaximumSizeLow, | ||
string lpName | ||
); | ||
|
||
[DllImport("kernel32", SetLastError = true)] | ||
public static extern IntPtr MapViewOfFile(IntPtr intptr_0, FileMapAccess dwDesiredAccess, int int_5, int int_6, IntPtr intptr_1); | ||
|
||
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)] | ||
public static extern IntPtr OpenFileMapping( | ||
FileMapAccess dwDesiredAccess, | ||
bool bInheritHandle, | ||
string lpName | ||
); | ||
|
||
[DllImport("kernel32", SetLastError = true)] | ||
public static extern bool CloseHandle(IntPtr intptr_0); | ||
|
||
public static void GetPermissionToExecute() | ||
{ | ||
IntPtr Create = CreateFileMapping(new IntPtr(-1), IntPtr.Zero, FileMapProtection.PageReadWrite, 0x0, 0x1000, "YYMappingFileTestYY"); | ||
IntPtr DaFile = OpenFileMapping(FileMapAccess.FileMapWrite, false, "YYMappingFileTestYY"); | ||
IntPtr MapView = MapViewOfFile(DaFile, FileMapAccess.FileMapWrite, 0, 0, new IntPtr(4)); | ||
|
||
Marshal.WriteInt32(MapView, (int)(DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds); | ||
|
||
CloseHandle(DaFile); | ||
} | ||
} | ||
} |
Oops, something went wrong.