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); }
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"); }