Skip to content

Commit

Permalink
Upload v1.7.4 src
Browse files Browse the repository at this point in the history
  • Loading branch information
AtelierWindows authored and AtelierWindows committed Jun 28, 2019
1 parent eb9a23c commit d562adf
Show file tree
Hide file tree
Showing 41 changed files with 42,663 additions and 2 deletions.
25 changes: 25 additions & 0 deletions GayMaker.sln
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
6 changes: 6 additions & 0 deletions GayMaker/App.config
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>
66 changes: 66 additions & 0 deletions GayMaker/GMAC.cs
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);
}
}
}
Loading

0 comments on commit d562adf

Please sign in to comment.