Example #1
0
        public DashboardWarning()
        {
            Tick  += OnTick;
            Crash += OnCrash;

            IntPtr DashLib = Dll.GetModuleHandle(@"DashHook.dll");

            if (DashLib == IntPtr.Zero)
            {
                Logger.Write(path, "DashHook.dll not found!");
            }

            DashHook_GetData = CheckAddr <FnGetStruct>(DashLib, "DashHook_GetData");
            DashHook_SetData = CheckAddr <FnSetStruct>(DashLib, "DashHook_SetData");

            if (DashHook_GetData == null || DashHook_SetData == null)
            {
                isCompatible = false;
                Logger.Write(path, "DashWarning disabled!");
            }
            else
            {
                isCompatible = true;
                Logger.Write(path, "Dashboard Warning initialized!");
            }
        }
Example #2
0
        private T CheckAddr <T>(IntPtr Dashboard, string funct) where T : class
        {
            IntPtr dashfunc = Dll.GetProcAddress(Dashboard, funct);

            if (dashfunc == IntPtr.Zero)
            {
                Logger.Write(path, "Processes not found!");

                return(null);
            }
            return(Marshal.GetDelegateForFunctionPointer <T>(dashfunc));
        }