public static bool Startup() { // hook GetModuleFilenameW to trick blue into thinking its in EVE directory var func = Native.GetProcAddress(Native.Kernel32, "GetModuleFileNameW"); _origGetModFile = Utility.Magic.RegisterDelegate<GetModFile>(func); var our = new GetModFile(HandleGetModFile); var fakeModuleFile = Utility.Magic.Detours.CreateAndApply(_origGetModFile, our, "GetModuleFileNameW"); using (fakeModuleFile) { // this is necessary to initialize some internal memory, ugh var getBePaths = Native.GetProcAddress(Library, "GetBePaths"); if (getBePaths != IntPtr.Zero) { _getBePaths = Utility.Magic.RegisterDelegate<GetBePaths>(getBePaths); _getBePaths(BeOS); } else Core.Log(LogSeverity.Warning, "no GetBePaths found in blue.dll, skipping (fatal on Cru)"); } func = Utility.Magic.GetObjectVtableFunction(BeOS, 7); _startup = Utility.Magic.RegisterDelegate<BeOsStartup>(func); return _startup(BeOS, 0x0D, 1); }
public static bool Startup() { // hook GetModuleFilenameW to trick blue into thinking its in EVE directory var func = Native.GetProcAddress(Native.Kernel32, "GetModuleFileNameW"); _origGetModFile = Utility.Magic.RegisterDelegate <GetModFile>(func); var our = new GetModFile(HandleGetModFile); var fakeModuleFile = Utility.Magic.Detours.CreateAndApply(_origGetModFile, our, "GetModuleFileNameW"); using (fakeModuleFile) { // this is necessary to initialize some internal memory, ugh var getBePaths = Native.GetProcAddress(Library, "GetBePaths"); if (getBePaths != IntPtr.Zero) { _getBePaths = Utility.Magic.RegisterDelegate <GetBePaths>(getBePaths); _getBePaths(BeOS); } else { Core.Log(LogSeverity.Warning, "no GetBePaths found in blue.dll, skipping (fatal on Cru)"); } } func = Utility.Magic.GetObjectVtableFunction(BeOS, 7); _startup = Utility.Magic.RegisterDelegate <BeOsStartup>(func); return(_startup(BeOS, 0x0D, 1)); }