forked from WarpWorld/CCPack-PC-MCCHaloCE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDllImports.cs
25 lines (18 loc) · 1012 Bytes
/
DllImports.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
using System;
using System.Runtime.InteropServices;
namespace CrowdControl.Games.Packs.MCCHaloCE;
public partial class MCCHaloCE
{
[DllImport("kernel32.dll")]
private static extern IntPtr OpenProcess(uint dwDesiredAccess, int bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll")]
private static extern int CloseHandle(IntPtr hObject);
[DllImport("kernel32.dll")]
private static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddres, int dwSize, uint flAllocationType, uint flProtect);
[DllImport("kernel32.dll")]
private static extern int WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] buffer, int size, int lpNumberOfBytesWritten);
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
private static extern bool VirtualFreeEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, int dwFreeType);
[DllImport("User32.dll")]
public static extern int SetForegroundWindow(IntPtr point);
}