mirror of
https://github.com/ricardojoserf/NativeDump
synced 2026-06-06 16:34:38 +00:00
32 lines
994 B
C#
32 lines
994 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Decoder
|
|
{
|
|
internal class Win32
|
|
{
|
|
// Constants
|
|
public const uint GENERIC_ALL = 0x10000000;
|
|
public const uint FILE_SHARE_WRITE = 0x00000002;
|
|
public const uint CREATE_ALWAYS = 2;
|
|
public const uint FILE_ATTRIBUTE_NORMAL = 128;
|
|
|
|
// Functions
|
|
[DllImport("kernel32.dll")]
|
|
public static extern bool WriteFile(
|
|
IntPtr hFile,
|
|
byte[] lpBuffer,
|
|
uint nNumberOfBytesToWrite,
|
|
out uint lpNumberOfBytesWritten,
|
|
IntPtr lpOverlapped);
|
|
|
|
[DllImport("kernel32.dll", SetLastError = true)]
|
|
public static extern IntPtr CreateFileA(
|
|
string lpFileName, uint dwDesiredAccess,
|
|
uint dwShareMode, IntPtr lpSecurityAttributes,
|
|
uint dwCreationDisposition,
|
|
uint dwFlagsAndAttributes,
|
|
IntPtr hTemplateFile);
|
|
}
|
|
}
|