Ejemplo n.º 1
0
 CESDK()
 {
     delGetVersion    = GetVersion;
     delEnablePlugin  = EnablePlugin;
     delDisablePlugin = DisablePlugin;
     return;
 }
Ejemplo n.º 2
0
 public static void InitFuncs()
 {
     if (File.Exists(getSNMAPIPath()))
     {
         if (BitConverter.ToString(new SHA1CryptoServiceProvider().ComputeHash(File.ReadAllBytes(getSNMAPIPath()))).ToUpper().Replace("-", "").Equals(DLLHash))
         {
             if ((libModule = LoadLibrary(getSNMAPIPath())) != IntPtr.Zero)
             {
                 _connecttoPS3      = (delegateConnectToPS3)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIConnectToPS3"), typeof(delegateConnectToPS3));
                 _disconnectPS3     = (delegateDisconnectPS3)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIDisconnectPS3"), typeof(delegateDisconnectPS3));
                 _autoconnectPS3    = (delegateAutoconnectPS3)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIAutoconnectPS3"), typeof(delegateAutoconnectPS3));
                 _notify            = (delegateNotify)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPINotify"), typeof(delegateNotify));
                 _getversion        = (delegateGetVersion)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetVersion"), typeof(delegateGetVersion));
                 _ringbuzzer        = (delegateRingBuzzer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIRingBuzzer"), typeof(delegateRingBuzzer));
                 _getTemp           = (delegateGetTemperature)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetTemperature"), typeof(delegateGetTemperature));
                 _shutdown          = (delegateShutdown)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIShutdown"), typeof(delegateShutdown));
                 _getfirmware       = (delegateGetFirmware)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetFirmware"), typeof(delegateGetFirmware));
                 _playsound         = (delegatePlaySound)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIPlaySound"), typeof(delegatePlaySound));
                 _setidps           = (delegateSetIDPS)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPISetIDPS"), typeof(delegateSetIDPS));
                 _getmemory         = (delegateGetMemory)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetMemory"), typeof(delegateGetMemory));
                 _setmemory         = (delegateSetMemory)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPISetMemory"), typeof(delegateSetMemory));
                 _getprocesses      = (delegateGetProcesses)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetProcesses"), typeof(delegateGetProcesses));
                 _getprocessname    = (delegateGetProcessName)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetProcessName"), typeof(delegateGetProcessName));
                 _loadsprx          = (delegateLoadSPRX)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPILoadSPRX"), typeof(delegateLoadSPRX));
                 _getgamepid        = (delegateGetGamePID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetGamePID"), typeof(delegateGetGamePID));
                 _getfreememory     = (delegateGetFreeMemory)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetFreeMemory"), typeof(delegateGetFreeMemory));
                 _notifysmall       = (delegateNotifySmall)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPINotifySmall"), typeof(delegateNotifySmall));
                 _getfreespace      = (delegateGetFreeSpace)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetFreeSpace"), typeof(delegateGetFreeSpace));
                 _getconnectiontype = (delegateGetConnectionType)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGetConnectionType"), typeof(delegateGetConnectionType));
                 _gamefuncs         = (delegateGameFuncs)Marshal.GetDelegateForFunctionPointer(GetProcAddress(libModule, "SNMAPIGameFuncs"), typeof(delegateGameFuncs));
             }
             else
             {
                 Console.WriteLine("SNMAPI - Can not load SNMAPI Library");
             }
         }
         else
         {
             Console.WriteLine("SNMAPI - SNMAPI Library has wrong hash");
         }
     }
     else
     {
         Console.WriteLine("SNMAPI - The SNMAPI Library file does not exist");
     }
 }