Exemplo n.º 1
0
        internal void LoadAndCallMethod(string Library, string MethodName)
        {
            PerformValidationCheck(Library);

            var LoadedLibraryPTR            = Load(Library);
            var LibraryToLoadCurrentProcPTR = NativeImport.LoadLibrary(Library);
            var PTRToMethod = NativeImport.GetProcAddress(LibraryToLoadCurrentProcPTR, MethodName);

            CallMethod(PTRToMethod, IntPtr.Zero);
        }
Exemplo n.º 2
0
        internal Loader(string ProcessName)
        {
            try { LoadedProcess = Process.GetProcessesByName(ProcessName).First(); }
            catch (Exception)
            {
                Console.WriteLine($"Could Not Find Process: {ProcessName}");
                Console.Read();
                Environment.Exit(0);
            }

            Kernel32PTR    = NativeImport.LoadLibrary("kernel32");
            LoadLibraryPTR = NativeImport.GetProcAddress(Kernel32PTR, "LoadLibraryA");
        }
Exemplo n.º 3
0
        internal static IntPtr GetFunctionAddress(string LibraryName, string FunctionName)
        {
            IntPtr HModule = NativeImport.LoadLibrary(LibraryName);

            return(NativeImport.GetProcAddress(HModule, FunctionName));
        }
Exemplo n.º 4
0
 public static nint GetFunctionAddress(string libName, string funcName) => NativeImport.GetProcAddress(NativeImport.LoadLibrary(libName), funcName);