Ejemplo n.º 1
0
        public int GetTargetInfo(out CCAPI.TargetInfo Info)
        {
            Info = new CCAPI.TargetInfo();
            int[] array       = new int[2];
            int   fw          = 0;
            int   ccapi       = 0;
            int   consoleType = 0;
            ulong sysTable    = 0uL;
            int   num         = CCAPI.getFirmwareInfo(CCAPI.System.connectionID, ref fw, ref ccapi, ref sysTable, ref consoleType);
            int   num2;
            int   result;

            if (num >= 0)
            {
                CCAPI.CCAPIGlobalPointer cCAPIGlobalPointer = new CCAPI.CCAPIGlobalPointer(Marshal.AllocHGlobal(8));
                num = CCAPI.getTemperature(CCAPI.System.connectionID, cCAPIGlobalPointer.GetPtr());
                if (num < 0)
                {
                    num2   = num;
                    result = num2;
                    return(result);
                }
                IntPtr unBuf = cCAPIGlobalPointer.GetPtr();
                for (uint num3 = 0u; num3 < 2u; num3 += 1u)
                {
                    unBuf = this.ReadDataFromUnBufPtr <int>(unBuf, ref array[(int)((uint)((UIntPtr)num3))]);
                }
                this.CompleteInfo(ref Info, fw, ccapi, sysTable, consoleType, array[0], array[1]);
                this.CompleteInfo(ref this.pInfo, fw, ccapi, sysTable, consoleType, array[0], array[1]);
            }
            num2   = num;
            result = num2;
            return(result);
        }
Ejemplo n.º 2
0
 // Token: 0x06000C3E RID: 3134 RVA: 0x0003F150 File Offset: 0x0003D350
 public int SetMemory(ulong offset, string hexadecimal, EndianType Type = EndianType.BigEndian)
 {
     byte[] array = CCAPI.StringToByteArray(hexadecimal);
     if (Type == EndianType.LittleEndian)
     {
         Array.Reverse(array);
     }
     return(this.setProcessMemory(CCAPI.System.processID, offset, (uint)array.Length, array));
 }
Ejemplo n.º 3
0
        // Token: 0x06000C53 RID: 3155 RVA: 0x0003F718 File Offset: 0x0003D918
        public int SetBootConsoleID(string consoleID, CCAPI.IdType Type = CCAPI.IdType.IDPS)
        {
            string text = string.Empty;

            if (consoleID.Length >= 32)
            {
                text = consoleID.Substring(0, 32);
            }
            return(this.SetBootConsoleID(CCAPI.StringToByteArray(consoleID), Type));
        }
Ejemplo n.º 4
0
        public int SetConsoleID(string consoleID)
        {
            string hex = string.Empty;

            if (consoleID.Length >= 32)
            {
                hex = consoleID.Substring(0, 32);
            }
            return(CCAPI.setConsoleID(CCAPI.System.connectionID, CCAPI.StringToByteArray(hex)));
        }
Ejemplo n.º 5
0
        public int GetProcessName(uint processId, out string name)
        {
            IntPtr intPtr      = Marshal.AllocHGlobal(529);
            int    processName = CCAPI.getProcessName(CCAPI.System.connectionID, processId, intPtr);

            name = string.Empty;
            if (this.SUCCESS(processName))
            {
                name = Marshal.PtrToStringAnsi(intPtr);
            }
            return(processName);
        }
Ejemplo n.º 6
0
        public int ConnectTarget(string targetIP)
        {
            if (this.SUCCESS(CCAPI.System.connectionID))
            {
                CCAPI.disconnectConsole(CCAPI.System.connectionID);
            }
            CCAPI.initTargetComms();
            CCAPI.System.connectionID = CCAPI.connectConsole(targetIP);
            CCAPI cCAPI = new CCAPI();

            cCAPI.Notify(CCAPI.NotifyIcon.FRIEND, "PS3Lib(4.4) [UNOFFICIAL]: By BaSs_HaXoR");
            return(CCAPI.System.connectionID);
        }
Ejemplo n.º 7
0
        public int GetProcessList(out uint[] processIds)
        {
            uint num = 0u;

            CCAPI.CCAPIGlobalPointer cCAPIGlobalPointer = new CCAPI.CCAPIGlobalPointer(Marshal.AllocHGlobal(256));
            int processList = CCAPI.getProcessList(CCAPI.System.connectionID, ref num, cCAPIGlobalPointer.GetPtr());

            processIds = new uint[num];
            if (this.SUCCESS(processList))
            {
                IntPtr unBuf = cCAPIGlobalPointer.GetPtr();
                for (uint num2 = 0u; num2 < num; num2 += 1u)
                {
                    unBuf = this.ReadDataFromUnBufPtr <uint>(unBuf, ref processIds[(int)((uint)((UIntPtr)num2))]);
                }
            }
            return(processList);
        }
Ejemplo n.º 8
0
        public List <CCAPI.ConsoleInfo> GetConsoleList()
        {
            List <CCAPI.ConsoleInfo> list = new List <CCAPI.ConsoleInfo>();
            int    numberOfConsoles       = CCAPI.getNumberOfConsoles();
            IntPtr intPtr  = Marshal.AllocHGlobal(256);
            IntPtr intPtr2 = Marshal.AllocHGlobal(256);

            for (int i = 0; i < numberOfConsoles; i++)
            {
                CCAPI.ConsoleInfo consoleInfo = new CCAPI.ConsoleInfo();
                CCAPI.getConsoleInfo(i, intPtr, intPtr2);
                consoleInfo.Name = Marshal.PtrToStringAnsi(intPtr);
                consoleInfo.Ip   = Marshal.PtrToStringAnsi(intPtr2);
                list.Add(consoleInfo);
            }
            Marshal.FreeHGlobal(intPtr);
            Marshal.FreeHGlobal(intPtr2);
            return(list);
        }
Ejemplo n.º 9
0
        // Token: 0x06000C51 RID: 3153 RVA: 0x0003F668 File Offset: 0x0003D868
        public int SetPSID(string PSID)
        {
            int result;

            if (string.IsNullOrEmpty(PSID))
            {
                MessageBox.Show("Cannot send an empty value", "Empty or null psid", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                result = -1;
            }
            else
            {
                string hex = string.Empty;
                if (PSID.Length >= 32)
                {
                    hex = PSID.Substring(0, 32);
                }
                result = this.SetPSID(CCAPI.StringToByteArray(hex));
            }
            return(result);
        }
Ejemplo n.º 10
0
        // Token: 0x06000C2C RID: 3116 RVA: 0x0003E638 File Offset: 0x0003C838
        public CCAPI()
        {
            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))
                    {
                        if (this.libModule == IntPtr.Zero)
                        {
                            this.libModule = CCAPI.LoadLibrary(text2);
                        }
                        if (this.libModule != IntPtr.Zero)
                        {
                            this.CCAPIFunctionsList.Clear();
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIConnectConsole"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIDisconnectConsole"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetConnectionStatus"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetConsoleInfo"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetDllVersion"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetFirmwareInfo"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetNumberOfConsoles"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetProcessList"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetMemory"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetProcessName"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIGetTemperature"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIVshNotify"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIRingBuzzer"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPISetBootConsoleIds"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPISetConsoleIds"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPISetConsoleLed"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPISetMemory"));
                            this.CCAPIFunctionsList.Add(CCAPI.GetProcAddress(this.libModule, "CCAPIShutdown"));
                            if (this.IsCCAPILoaded())
                            {
                                this.connectConsole      = (CCAPI.connectConsoleDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.ConnectConsole), typeof(CCAPI.connectConsoleDelegate));
                                this.disconnectConsole   = (CCAPI.disconnectConsoleDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.DisconnectConsole), typeof(CCAPI.disconnectConsoleDelegate));
                                this.getConnectionStatus = (CCAPI.getConnectionStatusDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetConnectionStatus), typeof(CCAPI.getConnectionStatusDelegate));
                                this.getConsoleInfo      = (CCAPI.getConsoleInfoDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetConsoleInfo), typeof(CCAPI.getConsoleInfoDelegate));
                                this.getDllVersion       = (CCAPI.getDllVersionDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetDllVersion), typeof(CCAPI.getDllVersionDelegate));
                                this.getFirmwareInfo     = (CCAPI.getFirmwareInfoDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetFirmwareInfo), typeof(CCAPI.getFirmwareInfoDelegate));
                                this.getNumberOfConsoles = (CCAPI.getNumberOfConsolesDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetNumberOfConsoles), typeof(CCAPI.getNumberOfConsolesDelegate));
                                this.getProcessList      = (CCAPI.getProcessListDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetProcessList), typeof(CCAPI.getProcessListDelegate));
                                this.getProcessMemory    = (CCAPI.getProcessMemoryDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetMemory), typeof(CCAPI.getProcessMemoryDelegate));
                                this.getProcessName      = (CCAPI.getProcessNameDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetProcessName), typeof(CCAPI.getProcessNameDelegate));
                                this.getTemperature      = (CCAPI.getTemperatureDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.GetTemperature), typeof(CCAPI.getTemperatureDelegate));
                                this.notify            = (CCAPI.notifyDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.VshNotify), typeof(CCAPI.notifyDelegate));
                                this.ringBuzzer        = (CCAPI.ringBuzzerDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.RingBuzzer), typeof(CCAPI.ringBuzzerDelegate));
                                this.setBootConsoleIds = (CCAPI.setBootConsoleIdsDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.SetBootConsoleIds), typeof(CCAPI.setBootConsoleIdsDelegate));
                                this.setConsoleIds     = (CCAPI.setConsoleIdsDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.SetConsoleIds), typeof(CCAPI.setConsoleIdsDelegate));
                                this.setConsoleLed     = (CCAPI.setConsoleLedDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.SetConsoleLed), typeof(CCAPI.setConsoleLedDelegate));
                                this.setProcessMemory  = (CCAPI.setProcessMemoryDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.SetMemory), typeof(CCAPI.setProcessMemoryDelegate));
                                this.shutdown          = (CCAPI.shutdownDelegate)Marshal.GetDelegateForFunctionPointer(this.GetCCAPIFunctionPtr(CCAPI.CCAPIFunctions.ShutDown), typeof(CCAPI.shutdownDelegate));
                            }
                            else
                            {
                                MessageBox.Show("Impossible to load CCAPI 2.60+", "This CCAPI.dll is not compatible", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Impossible to load CCAPI 2.60+", "CCAPI.dll cannot be loaded", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        }
                    }
                    else
                    {
                        MessageBox.Show("You need to install CCAPI 2.60+ to use this library.", "CCAPI.dll not found", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                }
                else
                {
                    MessageBox.Show("Invalid CCAPI folder, please re-install it.", "CCAPI not installed", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
            else
            {
                MessageBox.Show("You need to install CCAPI 2.60+ to use this library.", "CCAPI not installed", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Ejemplo n.º 11
0
 public int Notify(CCAPI.NotifyIcon icon, string message)
 {
     return(CCAPI.notify(CCAPI.System.connectionID, (int)icon, message));
 }
Ejemplo n.º 12
0
 public int SetConsoleID(byte[] consoleID)
 {
     return(CCAPI.setConsoleID(CCAPI.System.connectionID, consoleID));
 }
Ejemplo n.º 13
0
 public int GetMemory(ulong offset, byte[] buffer)
 {
     return(CCAPI.getProcessMemory(CCAPI.System.connectionID, CCAPI.System.processID, offset, (uint)buffer.Length, buffer));
 }
Ejemplo n.º 14
0
 public int DisconnectTarget()
 {
     return(CCAPI.disconnectConsole(CCAPI.System.connectionID));
 }
Ejemplo n.º 15
0
 public int SetLv2Memory(ulong offset, byte[] buffer)
 {
     return(CCAPI.setLv2Memory(CCAPI.System.connectionID, offset, (uint)buffer.Length, buffer));
 }
Ejemplo n.º 16
0
 public int GetLv1Memory(uint offset, byte[] buffer)
 {
     return(CCAPI.getLv1Memory(CCAPI.System.connectionID, (ulong)offset, (uint)buffer.Length, buffer));
 }
Ejemplo n.º 17
0
 public int ShutDown(CCAPI.RebootFlags flag)
 {
     return(CCAPI.shutdown(CCAPI.System.connectionID, (int)flag));
 }
Ejemplo n.º 18
0
 public int SetConsoleLed(CCAPI.LedColor color, CCAPI.LedMode mode)
 {
     return(CCAPI.setConsoleLed(CCAPI.System.connectionID, (int)color, (int)mode));
 }
Ejemplo n.º 19
0
 public int GetDllVersion()
 {
     return(CCAPI.getDllVersion());
 }
Ejemplo n.º 20
0
 public int RingBuzzer(CCAPI.BuzzerMode flag)
 {
     return(CCAPI.ringBuzzer(CCAPI.System.connectionID, (int)flag));
 }