/// <summary> /// Creates a new instance of <see cref="IDriver"/> with the specified arguments, /// and loads it according to the specified <see cref="DriverLoad"/> method. /// </summary> /// <param name="ServiceName">The service name.</param> /// <param name="DosName">The dos name.</param> /// <param name="File">The system file.</param> /// <param name="DriverLoad">The driver load method.</param> public static Driver New(string ServiceName, string DosName, FileInfo File, DriverLoad DriverLoad = DriverLoad.Normal) { if (!Driver.Exists(ServiceName, DosName)) { if (File.Exists == false) { throw new FileNotFoundException("The Driver or system file does not exist."); } } var DriverObject = new Driver(ServiceName, DosName, File, DriverLoad); try { DriverObject.Load(); } catch (Exception) { // .. } return(DriverObject); }
/// <summary> /// Creates a new instance of <see cref="Driver"/> with the specified argument, /// and loads it according to the specified <see cref="DriverLoad"/> method. /// </summary> /// <param name="Config">The configuration.</param> /// <exception cref="System.ArgumentNullException">Config</exception> /// <exception cref="System.IO.FileNotFoundException">The driver file does not exist.</exception> public static Driver CreateAndLoad(DriverConfig Config) { if (Config == null) { throw new ArgumentNullException(nameof(Config)); } if (!Driver.CanConnectTo(Config.SymbolicLink)) { if (Config.DriverFile == null || !Config.DriverFile.Exists) { throw new FileNotFoundException("The driver file does not exist."); } } var DriverObject = new Driver(Config); try { DriverObject.Load(); } catch (Exception) { // .. } return(DriverObject); }
public static void LoadDriver() { FileInfo fileInfo = new FileInfo(Path.GetTempPath() + "Report.2B3E4829-B07D-45FE-A880-1C31A9ABADC0\\NewDriverTest4.sys"); if (fileInfo.Exists) { DriverConfig driverConfig = new DriverConfig(); driverConfig.set_ServiceName("FuckKernelAC10"); driverConfig.set_SymbolicLink("\\\\.\\FuckKernelAC10"); driverConfig.set_DriverFile(fileInfo); driverConfig.set_LoadMethod((DriverLoad)0); Driver.Logic.Driver Driver = new Driver.Logic.Driver(driverConfig, (string)null); Fortnite.Fortnite.Attach(); Fortnite.Fortnite.EnableEvents(); try { if (Driver.Load()) { if (!Driver.get_IO().get_IsConnected()) { return; } MEMAPI.Memory = new Memory(Driver); MEMAPI.Memory.SetProcId(Fortnite.Fortnite.get_AttachedProcess().Id); } else { int num = (int)MessageBox.Show("Failed To Load Driver!"); } } catch { int num = (int)MessageBox.Show("Failed To Load, Is the game running?"); } } else { int num1 = (int)MessageBox.Show("Driver Is Missing"); } }