From d482ed88724b9dc84ee5f2b70252d4aab6b837d9 Mon Sep 17 00:00:00 2001 From: Debulois Date: Wed, 19 Oct 2022 12:43:49 +0200 Subject: Initial commit --- WinKeyRecover/NativeMethods/NativeMethods.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 WinKeyRecover/NativeMethods/NativeMethods.cs (limited to 'WinKeyRecover/NativeMethods') diff --git a/WinKeyRecover/NativeMethods/NativeMethods.cs b/WinKeyRecover/NativeMethods/NativeMethods.cs new file mode 100644 index 0000000..f0817ae --- /dev/null +++ b/WinKeyRecover/NativeMethods/NativeMethods.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace WinKeyRecover +{ + internal class NativeMethods + { + [DllImport("kernel32.dll")] + public static extern IntPtr LoadLibrary(string dllToLoad); + + [DllImport("kernel32.dll")] + public static extern bool FreeLibrary(IntPtr hModule); + + [DllImport("kernel32.dll")] + public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate int PidGenX([MarshalAs(UnmanagedType.LPWStr)] string ProductKey, [MarshalAs(UnmanagedType.LPWStr)] string PkeyPath, [MarshalAs(UnmanagedType.LPWStr)] string MSPID, int UnknownUsage, IntPtr ProductID, IntPtr DigitalProductID, IntPtr DigitalProductID4); + } +} -- cgit v1.2.3