Beispiel #1
0
 private void ShowErrorMessage(Exception e, string Title)
 {
     if (showError == true)
     {
         IgrisMessageBox.Show(e.Message, Title, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Beispiel #2
0
        ///<summary>Load the PS3 API for use with your Application .NET.</summary>
        public Assembly PS3TMAPI_NET()
        {
            AppDomain.CurrentDomain.AssemblyResolve += (s, e) =>
            {
                var filename = new AssemblyName(e.Name).Name;
                var x        = string.Format(@"C:\Program Files\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
                var x64      = string.Format(@"C:\Program Files (x64)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
                var x86      = string.Format(@"C:\Program Files (x86)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
                if (File.Exists(x))
                {
                    LoadApi = Assembly.LoadFile(x);
                }
                else
                {
                    if (File.Exists(x64))
                    {
                        LoadApi = Assembly.LoadFile(x64);
                    }

                    else
                    {
                        if (File.Exists(x86))
                        {
                            LoadApi = Assembly.LoadFile(x86);
                        }
                        else
                        {
                            IgrisMessageBox.Show($"Target Manager API cannot be founded to:\r\n\r\n{x86}", "Error with PS3 API!", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                }
                return(LoadApi);
            };
            return(LoadApi);
        }
Beispiel #3
0
        public static string ReadRegistry()
        {
            RegistryKey Key = Registry
                              .CurrentUser
                              .OpenSubKey($@"SOFTWARE\{registryName}\InstallFolder");

            if (Key != null)
            {
                string Path = Key.GetValue("path") as string;
                if (!string.IsNullOrEmpty(Path))
                {
                    string DllUrl = Path + @"\CCAPI.dll";
                    if (File.Exists(DllUrl))
                    {
                        return(DllUrl);
                    }
                    else
                    {
                        IgrisMessageBox.Show("You need to install CCAPI 2.60/2.70/2.80/+ to use this library.", "CCAPI.dll not found", MessageBoxButton.OK, MessageBoxImage.Error);
                        Environment.Exit(0);
                        return(null);
                    }
                }
                else
                {
                    IgrisMessageBox.Show("Invalid CCAPI folder, please re-install it.", "CCAPI not installed", MessageBoxButton.OK, MessageBoxImage.Error);
                    Environment.Exit(0);
                    return(null);
                }
            }
            else
            {
                IgrisMessageBox.Show("You need to install CCAPI 2.60/2.70/2.80/+ to use this library.", "CCAPI not installed", MessageBoxButton.OK, MessageBoxImage.Error);
                Environment.Exit(0);
                return(null);
            }
        }
Beispiel #4
0
        private bool Init()
        {
            RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\FrenchModdingTeam\\CCAPI\\InstallFolder");

            if (registryKey != null)
            {
                string text = registryKey.GetValue("path") as string;
                if (!string.IsNullOrEmpty(text))
                {
                    string text2 = text + "\\CCAPI.dll";
                    if (File.Exists(text2))
                    {
                        LibHandle = LoadLibrary(text2);

                        if (LibHandle == IntPtr.Zero)
                        {
                            if (GetLastError() == 193)
                            {
                            }
                            IgrisMessageBox.Show(this.resources["impossibleLoadCCAPI"].ToString(), this.resources["impossibleLoadCCAPITitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Hand);
                            return(false);
                        }

                        IntPtr pCCAPIConnectConsole      = GetProcAddress(LibHandle, "CCAPIConnectConsole");
                        IntPtr pCCAPIDisconnectConsole   = GetProcAddress(LibHandle, "CCAPIDisconnectConsole");
                        IntPtr pCCAPIGetConnectionStatus = GetProcAddress(LibHandle, "CCAPIGetConnectionStatus");
                        IntPtr pCCAPISetBootConsoleIds   = GetProcAddress(LibHandle, "CCAPISetBootConsoleIds");
                        IntPtr pCCAPISetConsoleIds       = GetProcAddress(LibHandle, "CCAPISetConsoleIds");
                        IntPtr pCCAPISetMemory           = GetProcAddress(LibHandle, "CCAPISetMemory");
                        IntPtr pCCAPIGetMemory           = GetProcAddress(LibHandle, "CCAPIGetMemory");
                        IntPtr pCCAPIGetProcessList      = GetProcAddress(LibHandle, "CCAPIGetProcessList");
                        IntPtr pCCAPIGetProcessName      = GetProcAddress(LibHandle, "CCAPIGetProcessName");
                        IntPtr pCCAPIGetTemperature      = GetProcAddress(LibHandle, "CCAPIGetTemperature");
                        IntPtr pCCAPIShutdown            = GetProcAddress(LibHandle, "CCAPIShutdown");
                        IntPtr pCCAPIRingBuzzer          = GetProcAddress(LibHandle, "CCAPIRingBuzzer");
                        IntPtr pCCAPISetConsoleLed       = GetProcAddress(LibHandle, "CCAPISetConsoleLed");
                        IntPtr pCCAPIGetFirmwareInfo     = GetProcAddress(LibHandle, "CCAPIGetFirmwareInfo");
                        IntPtr pCCAPIVshNotify           = GetProcAddress(LibHandle, "CCAPIVshNotify");
                        IntPtr pCCAPIGetNumberOfConsoles = GetProcAddress(LibHandle, "CCAPIGetNumberOfConsoles");
                        IntPtr pCCAPIGetConsoleInfo      = GetProcAddress(LibHandle, "CCAPIGetConsoleInfo");
                        IntPtr pCCAPIGetDllVersion       = GetProcAddress(LibHandle, "CCAPIGetDllVersion");

                        bool loaded = (pCCAPIConnectConsole != IntPtr.Zero) &&
                                      (pCCAPIDisconnectConsole != IntPtr.Zero) &&
                                      (pCCAPIGetConnectionStatus != IntPtr.Zero) &&
                                      (pCCAPISetBootConsoleIds != IntPtr.Zero) &&
                                      (pCCAPISetConsoleIds != IntPtr.Zero) &&
                                      (pCCAPISetMemory != IntPtr.Zero) &&
                                      (pCCAPIGetMemory != IntPtr.Zero) &&
                                      (pCCAPIGetProcessList != IntPtr.Zero) &&
                                      (pCCAPIGetProcessName != IntPtr.Zero) &&
                                      (pCCAPIGetTemperature != IntPtr.Zero) &&
                                      (pCCAPIShutdown != IntPtr.Zero) &&
                                      (pCCAPIRingBuzzer != IntPtr.Zero) &&
                                      (pCCAPISetConsoleLed != IntPtr.Zero) &&
                                      (pCCAPIGetFirmwareInfo != IntPtr.Zero) &&
                                      (pCCAPIVshNotify != IntPtr.Zero) &&
                                      (pCCAPIGetNumberOfConsoles != IntPtr.Zero) &&
                                      (pCCAPIGetConsoleInfo != IntPtr.Zero) &&
                                      (pCCAPIGetDllVersion != IntPtr.Zero);

                        if (!loaded)
                        {
                            IgrisMessageBox.Show(this.resources["impossibleLoadCCAPI"].ToString(), this.resources["ccapiIsntCompatible"].ToString(), MessageBoxButton.OK, MessageBoxImage.Hand);
                            return(false);
                        }

                        CCAPIConnectConsole      = (CCAPIConnectConsole_t)Marshal.GetDelegateForFunctionPointer(pCCAPIConnectConsole, typeof(CCAPIConnectConsole_t));
                        CCAPIDisconnectConsole   = (CCAPIDisconnectConsole_t)Marshal.GetDelegateForFunctionPointer(pCCAPIDisconnectConsole, typeof(CCAPIDisconnectConsole_t));
                        CCAPIGetConnectionStatus = (CCAPIGetConnectionStatus_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetConnectionStatus, typeof(CCAPIGetConnectionStatus_t));
                        CCAPISetBootConsoleIds   = (CCAPISetBootConsoleIds_t)Marshal.GetDelegateForFunctionPointer(pCCAPISetBootConsoleIds, typeof(CCAPISetBootConsoleIds_t));
                        CCAPISetConsoleIds       = (CCAPISetConsoleIds_t)Marshal.GetDelegateForFunctionPointer(pCCAPISetConsoleIds, typeof(CCAPISetConsoleIds_t));
                        CCAPISetMemory           = (CCAPISetMemory_t)Marshal.GetDelegateForFunctionPointer(pCCAPISetMemory, typeof(CCAPISetMemory_t));
                        CCAPIGetMemory           = (CCAPIGetMemory_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetMemory, typeof(CCAPIGetMemory_t));
                        CCAPIGetProcessList      = (CCAPIGetProcessList_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetProcessList, typeof(CCAPIGetProcessList_t));
                        CCAPIGetProcessName      = (CCAPIGetProcessName_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetProcessName, typeof(CCAPIGetProcessName_t));
                        CCAPIGetTemperature      = (CCAPIGetTemperature_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetTemperature, typeof(CCAPIGetTemperature_t));
                        CCAPIShutdown            = (CCAPIShutdown_t)Marshal.GetDelegateForFunctionPointer(pCCAPIShutdown, typeof(CCAPIShutdown_t));
                        CCAPIRingBuzzer          = (CCAPIRingBuzzer_t)Marshal.GetDelegateForFunctionPointer(pCCAPIRingBuzzer, typeof(CCAPIRingBuzzer_t));
                        CCAPISetConsoleLed       = (CCAPISetConsoleLed_t)Marshal.GetDelegateForFunctionPointer(pCCAPISetConsoleLed, typeof(CCAPISetConsoleLed_t));
                        CCAPIGetFirmwareInfo     = (CCAPIGetFirmwareInfo_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetFirmwareInfo, typeof(CCAPIGetFirmwareInfo_t));
                        CCAPIVshNotify           = (CCAPIVshNotify_t)Marshal.GetDelegateForFunctionPointer(pCCAPIVshNotify, typeof(CCAPIVshNotify_t));
                        CCAPIGetNumberOfConsoles = (CCAPIGetNumberOfConsoles_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetNumberOfConsoles, typeof(CCAPIGetNumberOfConsoles_t));
                        CCAPIGetConsoleInfo      = (CCAPIGetConsoleInfo_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetConsoleInfo, typeof(CCAPIGetConsoleInfo_t));
                        CCAPIGetDllVersion       = (CCAPIGetDllVersion_t)Marshal.GetDelegateForFunctionPointer(pCCAPIGetDllVersion, typeof(CCAPIGetDllVersion_t));

                        return(true);
                    }
                    else
                    {
                        IgrisMessageBox.Show(this.resources["ccapiNotInstalled"].ToString(), this.resources["ccapiNotFound"].ToString(), MessageBoxButton.OK, MessageBoxImage.Hand);
                    }
                }
                else
                {
                    IgrisMessageBox.Show(this.resources["invalidCCAPIFolder"].ToString(), this.resources["ccapiNotInstalledTitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Hand);
                }
            }
            else
            {
                IgrisMessageBox.Show(this.resources["ccapiNotInstalled"].ToString(), this.resources["ccapiNotInstalledTitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Hand);
            }
            return(false);
        }
Beispiel #5
0
 private void SetCustomClass()
 {
     if (!GetAttached())
     {
         return;
     }
     try
     {
         if (SelectedClass != null)
         {
             if (SelectedCustomClass == "GODMODE ACR 6.8")
             {
                 SelectedClass.Perk1                      = Perks1.SLEIGHT_OF_HAND;
                 SelectedClass.Perk2                      = Perks2.OVERKILL;
                 SelectedClass.Perk3                      = Perks3.STALKER;
                 SelectedClass.PrimaryWeapon              = WeaponIndex.BARRETT_50;
                 SelectedClass.PrimaryWeaponProficiency   = Proficiencies.NONE;
                 SelectedClass.PrimaryWeaponAttachment1   = Attachments.NONE;
                 SelectedClass.PrimaryWeaponAttachment2   = Attachments.NONE;
                 SelectedClass.PrimaryWeaponReticle       = Reticle.NONE;
                 SelectedClass.PrimaryWeaponCamo          = Camos.NONE;
                 SelectedClass.SecondaryWeapon            = WeaponIndex.ACR_68;
                 SelectedClass.SecondaryWeaponProficiency = Proficiencies.ATTACHMENTS;
                 SelectedClass.SecondaryWeaponAttachment1 = Attachments.EXTENDED_MAGS;
                 SelectedClass.SecondaryWeaponAttachment2 = Attachments.SILENCER;
                 SelectedClass.SecondaryWeaponReticle     = Reticle.NONE;
                 SelectedClass.SecondaryWeaponCamo        = Camos.GOLD;
                 SelectedClass.Lethal                     = Lethal.FRAG;
                 SelectedClass.Tactical                   = Tactical.CONCUSSION_GRENADE;
                 SelectedClass.StrikePackage              = StrikePackage.SPECIALIST;
                 SelectedClass.Assault1                   = Assault.NONE;
                 SelectedClass.Assault2                   = Assault.NONE;
                 SelectedClass.Assault3                   = Assault.NONE;
                 SelectedClass.Support1                   = Support.NONE;
                 SelectedClass.Support2                   = Support.NONE;
                 SelectedClass.Support3                   = Support.NONE;
                 SelectedClass.Specialist1                = Specialist.HARDLINE;
                 SelectedClass.Specialist2                = Specialist.SCAVENGER;
                 SelectedClass.Specialist3                = Specialist.STALKER;
                 SelectedClass.Deathstreak                = Deathstreaks.NONE;
                 SelectedClass.Godmode                    = true;
                 Status = "Godmode class with acr 6.8 is generated!";
             }
             else if (SelectedCustomClass == "GODMODE MP7")
             {
                 SelectedClass.Perk1                      = Perks1.SLEIGHT_OF_HAND;
                 SelectedClass.Perk2                      = Perks2.OVERKILL;
                 SelectedClass.Perk3                      = Perks3.STALKER;
                 SelectedClass.PrimaryWeapon              = WeaponIndex.BARRETT_50;
                 SelectedClass.PrimaryWeaponProficiency   = Proficiencies.NONE;
                 SelectedClass.PrimaryWeaponAttachment1   = Attachments.NONE;
                 SelectedClass.PrimaryWeaponAttachment2   = Attachments.NONE;
                 SelectedClass.PrimaryWeaponReticle       = Reticle.NONE;
                 SelectedClass.PrimaryWeaponCamo          = Camos.NONE;
                 SelectedClass.SecondaryWeapon            = WeaponIndex.MP7;
                 SelectedClass.SecondaryWeaponProficiency = Proficiencies.ATTACHMENTS;
                 SelectedClass.SecondaryWeaponAttachment1 = Attachments.EXTENDED_MAGS;
                 SelectedClass.SecondaryWeaponAttachment2 = Attachments.SILENCER;
                 SelectedClass.SecondaryWeaponReticle     = Reticle.NONE;
                 SelectedClass.SecondaryWeaponCamo        = Camos.GOLD;
                 SelectedClass.Lethal                     = Lethal.FRAG;
                 SelectedClass.Tactical                   = Tactical.CONCUSSION_GRENADE;
                 SelectedClass.StrikePackage              = StrikePackage.SPECIALIST;
                 SelectedClass.Assault1                   = Assault.NONE;
                 SelectedClass.Assault2                   = Assault.NONE;
                 SelectedClass.Assault3                   = Assault.NONE;
                 SelectedClass.Support1                   = Support.NONE;
                 SelectedClass.Support2                   = Support.NONE;
                 SelectedClass.Support3                   = Support.NONE;
                 SelectedClass.Specialist1                = Specialist.HARDLINE;
                 SelectedClass.Specialist2                = Specialist.SCAVENGER;
                 SelectedClass.Specialist3                = Specialist.STALKER;
                 SelectedClass.Deathstreak                = Deathstreaks.NONE;
                 SelectedClass.Godmode                    = true;
                 Status = "Godmode class with mp7 is generated!";
             }
             else
             {
                 SelectedClass.Perk1                      = Perks1.SLEIGHT_OF_HAND;
                 SelectedClass.Perk2                      = Perks2.OVERKILL;
                 SelectedClass.Perk3                      = Perks3.STALKER;
                 SelectedClass.PrimaryWeapon              = WeaponIndex.AUGH_BAR;
                 SelectedClass.PrimaryWeaponProficiency   = Proficiencies.IMPACT;
                 SelectedClass.PrimaryWeaponAttachment1   = Attachments.RAPID_FIRE;
                 SelectedClass.PrimaryWeaponAttachment2   = Attachments.NONE;
                 SelectedClass.PrimaryWeaponReticle       = Reticle.NONE;
                 SelectedClass.PrimaryWeaponCamo          = Camos.BLUE;
                 SelectedClass.SecondaryWeapon            = WeaponIndex.ACR_68;
                 SelectedClass.SecondaryWeaponProficiency = Proficiencies.ATTACHMENTS;
                 SelectedClass.SecondaryWeaponAttachment1 = Attachments.EXTENDED_MAGS;
                 SelectedClass.SecondaryWeaponAttachment2 = Attachments.SILENCER;
                 SelectedClass.SecondaryWeaponReticle     = Reticle.NONE;
                 SelectedClass.SecondaryWeaponCamo        = Camos.GOLD;
                 SelectedClass.Lethal                     = Lethal.FRAG;
                 SelectedClass.Tactical                   = Tactical.CONCUSSION_GRENADE;
                 SelectedClass.StrikePackage              = StrikePackage.ASSAULT;
                 SelectedClass.Assault1                   = Assault.UAV;
                 SelectedClass.Assault2                   = Assault.PAVE_LOW;
                 SelectedClass.Assault3                   = Assault.JUGGERNAUT;
                 SelectedClass.Support1                   = Support.NONE;
                 SelectedClass.Support2                   = Support.NONE;
                 SelectedClass.Support3                   = Support.NONE;
                 SelectedClass.Specialist1                = Specialist.NONE;
                 SelectedClass.Specialist2                = Specialist.NONE;
                 SelectedClass.Specialist3                = Specialist.NONE;
                 SelectedClass.Deathstreak                = Deathstreaks.HOLLOW_POINTS;
                 SelectedClass.Godmode                    = false;
                 Status = "Aughbar class is generated!";
             }
         }
     }
     catch (NullReferenceException)
     {
         IgrisMessageBox.Show("Select class before modify class", "Failed...", MessageBoxButton.OK, MessageBoxImage.Error);
         Status = "Custom class was not generated!";
     }
 }