├── bin ├── PS3Lib.dll └── PS3Lib.XML ├── demo ├── CCAPI-Demo │ ├── CCAPI-Demo │ │ ├── obj │ │ │ ├── Debug │ │ │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ │ │ ├── CCAPI-Demo.exe │ │ │ │ ├── CCAPI-Demo.pdb │ │ │ │ ├── CCAPI_Demo.Form1.resources │ │ │ │ ├── CCAPI-Demo.csproj.GenerateResource.Cache │ │ │ │ ├── CCAPI_Demo.Properties.Resources.resources │ │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ │ ├── TempPE │ │ │ │ │ └── Properties.Resources.Designer.cs.dll │ │ │ │ ├── CCAPI-Demo.csprojResolveAssemblyReference.cache │ │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ │ └── CCAPI-Demo.csproj.FileListAbsolute.txt │ │ │ └── Release │ │ │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ │ │ ├── CCAPI-Demo.exe │ │ │ │ ├── CCAPI-Demo.pdb │ │ │ │ ├── CCAPI_Demo.Form1.resources │ │ │ │ ├── CCAPI-Demo.csproj.GenerateResource.Cache │ │ │ │ ├── CCAPI_Demo.Properties.Resources.resources │ │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ │ ├── TempPE │ │ │ │ └── Properties.Resources.Designer.cs.dll │ │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ │ ├── CCAPI-Demo.csprojResolveAssemblyReference.cache │ │ │ │ └── CCAPI-Demo.csproj.FileListAbsolute.txt │ │ ├── Resources │ │ │ └── ps3.ico │ │ ├── App.config │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── Program.cs │ │ ├── CCAPI-Demo.csproj │ │ ├── Form1.resx │ │ └── Form1.cs │ ├── CCAPI-Demo.v11.suo │ └── CCAPI-Demo.sln └── PS3API-Demo │ ├── PS3API-Demo │ ├── obj │ │ ├── Debug │ │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ │ ├── PS3API-Demo.exe │ │ │ ├── PS3API-Demo.pdb │ │ │ ├── PS3API_Demo.Main.resources │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ ├── PS3API-Demo.csproj.GenerateResource.Cache │ │ │ ├── PS3API_Demo.Properties.Resources.resources │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ ├── PS3API-Demo.csprojResolveAssemblyReference.cache │ │ │ └── PS3API-Demo.csproj.FileListAbsolute.txt │ │ └── Release │ │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ │ ├── PS3API-Demo.exe │ │ │ ├── PS3API-Demo.pdb │ │ │ ├── PS3API_Demo.Main.resources │ │ │ ├── PS3API-Demo.csproj.GenerateResource.Cache │ │ │ ├── PS3API_Demo.Properties.Resources.resources │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ └── PS3API-Demo.csproj.FileListAbsolute.txt │ ├── bin │ │ └── Debug │ │ │ ├── PS3Lib.dll │ │ │ ├── PS3API-Demo.exe │ │ │ ├── PS3API-Demo.pdb │ │ │ ├── PS3API-Demo.vshost.exe │ │ │ ├── PS3API-Demo.exe.config │ │ │ ├── PS3API-Demo.vshost.exe.config │ │ │ └── PS3API-Demo.vshost.exe.manifest │ ├── App.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Program.cs │ ├── PS3API-Demo.csproj │ ├── Main.cs │ ├── Main.resx │ └── Main.Designer.cs │ ├── PS3API-Demo.v11.suo │ └── PS3API-Demo.sln ├── LICENSE ├── README.md └── src ├── extra ├── ArrayBuilder.cs └── Extensions.cs └── api ├── TMAPI.cs ├── PS3API.cs └── TMAPI_NET.cs /bin/PS3Lib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/bin/PS3Lib.dll -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo.v11.suo -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo.v11.suo -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Resources/ps3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/Resources/ps3.ico -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3Lib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3Lib.dll -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.exe -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.pdb -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.exe -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.pdb -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.exe -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.pdb -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.exe -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.pdb -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API-Demo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API-Demo.exe -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API-Demo.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API-Demo.pdb -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.vshost.exe -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI_Demo.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI_Demo.Form1.resources -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI_Demo.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI_Demo.Form1.resources -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API_Demo.Main.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API_Demo.Main.resources -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API_Demo.Main.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API_Demo.Main.resources -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI_Demo.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI_Demo.Properties.Resources.resources -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI_Demo.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI_Demo.Properties.Resources.resources -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/TempPE/Properties.Resources.Designer.cs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/TempPE/Properties.Resources.Designer.cs.dll -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API_Demo.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API_Demo.Properties.Resources.resources -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API-Demo.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API-Demo.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API_Demo.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API_Demo.Properties.Resources.resources -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iMCSx/PS3Lib/HEAD/demo/PS3API-Demo/PS3API-Demo/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/bin/Debug/PS3API-Demo.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace CCAPI_Demo 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// Point d'entrée principal de l'application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace PS3API_Demo 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// Point d'entrée principal de l'application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Main()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CCAPI-Demo", "CCAPI-Demo\CCAPI-Demo.csproj", "{808DDD4E-65CB-495E-9007-34B69FD60937}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {808DDD4E-65CB-495E-9007-34B69FD60937}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {808DDD4E-65CB-495E-9007-34B69FD60937}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {808DDD4E-65CB-495E-9007-34B69FD60937}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {808DDD4E-65CB-495E-9007-34B69FD60937}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PS3API-Demo", "PS3API-Demo\PS3API-Demo.csproj", "{E8B7EC0F-C467-43CE-9755-2B64851B77F1}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {E8B7EC0F-C467-43CE-9755-2B64851B77F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {E8B7EC0F-C467-43CE-9755-2B64851B77F1}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {E8B7EC0F-C467-43CE-9755-2B64851B77F1}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {E8B7EC0F-C467-43CE-9755-2B64851B77F1}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Release/CCAPI-Demo.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Release\CCAPI-Demo.exe.config 2 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Release\CCAPI-Demo.exe 3 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Release\CCAPI-Demo.pdb 4 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Release\PS3Lib.dll 5 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Release\CCAPI_Demo.Form1.resources 6 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Release\CCAPI_Demo.Properties.Resources.resources 7 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Release\CCAPI-Demo.csproj.GenerateResource.Cache 8 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Release\CCAPI-Demo.exe 9 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Release\CCAPI-Demo.pdb 10 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Release\CCAPI-Demo.csprojResolveAssemblyReference.cache 11 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18052 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCAPI_Demo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.18052 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PS3API_Demo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Release/PS3API-Demo.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Release\PS3API-Demo.exe.config 2 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Release\PS3API-Demo.exe 3 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Release\PS3API-Demo.pdb 4 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Release\PS3Lib.dll 5 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Release\PS3Lib.pdb 6 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Release\PS3Lib.xml 7 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Release\PS3API_Demo.Main.resources 8 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Release\PS3API_Demo.Properties.Resources.resources 9 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Release\PS3API-Demo.csproj.GenerateResource.Cache 10 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Release\PS3API-Demo.exe 11 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Release\PS3API-Demo.pdb 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PS3 Library for .NET 2 | 3 | This will allow you to communicate with your PS3 DEX/CEX 4 | Connection with targets , read/write memory and more... 5 | 6 | # Last changes: 7 | - Support CCAPI v2.60+. 8 | - Read/Write memory as 'double'. 9 | - Read/Write memory as 'float' array. 10 | - ArrayBuilder constructor overload. 11 | - Some functions fixes. 12 | 13 | # Functions list : 14 | 15 | - Support CCAPI v2.60+ C#. 16 | - Set boot console Ids 17 | - No need to give CCAPI.dll 18 | - Function ReadString is now very fast. 19 | - Extension class support both API's. 20 | - ArrayBuilder for build arrays easily. 21 | - IO Removed (Few people used it). 22 | - Set API to switch when you want. 23 | - Use both API's with same function names. 24 | - Dialog CCAPI for ip implemented. 25 | - Connect & Attach function returns bool. 26 | - Fixed some bugs TMAPI. 27 | 28 | # MD5 Hash 29 | 30 | - v4.5.1: 0B35CC2DF877C881469094FE47D2E825 31 | 32 | # Information 33 | 34 | - Don't forget to INSTALL the latest version of CCAPI (v2.60 (or higher)) in your PS3 if you want develop applications with CCAPI C# 35 | - http://www.frenchmoddingteam.com/shop/application/20-control-console-api-2-60-rte-cex-dex 36 | 37 | 38 | More informations about all PS3Lib functions here : 39 | 40 | - http://www.nextgenupdate.com/forums/ps3-cheats-customization/697273-release-ps3lib-v4-4-dex-cex.html 41 | 42 | - http://www.frenchmoddingteam.com/news/article/9-release-ps3lib-v4-4-dex-cex 43 | 44 | # Contributing 45 | 46 | Feel free to do a PR. :) 47 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("CCAPI-Demo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CCAPI-Demo")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("90e4ea06-eaa4-4eb6-8c64-ca1fec0c197e")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("PS3API-Demo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PS3API-Demo")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("4ffb7df6-04cc-4c55-89fc-3baef92da587")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.18052 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PS3API_Demo.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PS3API_Demo.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 56 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/obj/Debug/PS3API-Demo.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.exe.config 2 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.exe 3 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.pdb 4 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API_Demo.Main.resources 5 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API_Demo.Properties.Resources.resources 6 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.csproj.GenerateResource.Cache 7 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.exe 8 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.pdb 9 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.csprojResolveAssemblyReference.cache 10 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3Lib.dll 11 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.exe.config 12 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.exe 13 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.pdb 14 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.exe 15 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.pdb 16 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3Lib.dll 17 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API_Demo.Main.resources 18 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API_Demo.Properties.Resources.resources 19 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.csproj.GenerateResource.Cache 20 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.exe.config 21 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.exe 22 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.pdb 23 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API_Demo.Main.resources 24 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API_Demo.Properties.Resources.resources 25 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.csproj.GenerateResource.Cache 26 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.exe 27 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3API-Demo.pdb 28 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\bin\Debug\PS3Lib.dll 29 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\PS3API-Demo\PS3API-Demo\obj\Debug\PS3API-Demo.csprojResolveAssemblyReference.cache 30 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/obj/Debug/CCAPI-Demo.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.csprojResolveAssemblyReference.cache 2 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI_Demo.Form1.resources 3 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI_Demo.Properties.Resources.resources 4 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.csproj.GenerateResource.Cache 5 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.exe.config 6 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.exe 7 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.pdb 8 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\PS3Lib.dll 9 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.exe 10 | C:\Users\Alienware\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.pdb 11 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.exe.config 12 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.exe 13 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.pdb 14 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.exe 15 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.pdb 16 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\PS3Lib.dll 17 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.csprojResolveAssemblyReference.cache 18 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI_Demo.Form1.resources 19 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI_Demo.Properties.Resources.resources 20 | E:\Users\ALIENWARE\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.csproj.GenerateResource.Cache 21 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.exe.config 22 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.exe 23 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.pdb 24 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.exe 25 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\CCAPI-Demo.pdb 26 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI_Demo.Form1.resources 27 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI_Demo.Properties.Resources.resources 28 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.csproj.GenerateResource.Cache 29 | D:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\bin\Debug\PS3Lib.dll 30 | d:\Users\iMCSx\Documents\Visual Studio 2012\Projects\CCAPI-Demo\CCAPI-Demo\obj\Debug\CCAPI-Demo.csprojResolveAssemblyReference.cache 31 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.34014 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CCAPI_Demo.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CCAPI_Demo.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 51 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Recherche une ressource localisée de type System.Drawing.Icon semblable à (Icône). 65 | /// 66 | internal static System.Drawing.Icon ps3 { 67 | get { 68 | object obj = ResourceManager.GetObject("ps3", resourceCulture); 69 | return ((System.Drawing.Icon)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/PS3API-Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E8B7EC0F-C467-43CE-9755-2B64851B77F1} 8 | WinExe 9 | Properties 10 | PS3API_Demo 11 | PS3API-Demo 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | E:\Dev\DLL\PS3Lib.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Form 52 | 53 | 54 | Main.cs 55 | 56 | 57 | 58 | 59 | Main.cs 60 | 61 | 62 | ResXFileCodeGenerator 63 | Resources.Designer.cs 64 | Designer 65 | 66 | 67 | True 68 | Resources.resx 69 | 70 | 71 | SettingsSingleFileGenerator 72 | Settings.Designer.cs 73 | 74 | 75 | True 76 | Settings.settings 77 | True 78 | 79 | 80 | 81 | 82 | 83 | 84 | 91 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/CCAPI-Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {808DDD4E-65CB-495E-9007-34B69FD60937} 8 | WinExe 9 | Properties 10 | CCAPI_Demo 11 | CCAPI-Demo 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | False 37 | E:\Dev\DLL\PS3Lib.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | Form 53 | 54 | 55 | Form1.cs 56 | 57 | 58 | 59 | 60 | Form1.cs 61 | 62 | 63 | ResXFileCodeGenerator 64 | Resources.Designer.cs 65 | Designer 66 | 67 | 68 | True 69 | Resources.resx 70 | True 71 | 72 | 73 | SettingsSingleFileGenerator 74 | Settings.Designer.cs 75 | 76 | 77 | True 78 | Settings.settings 79 | True 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 96 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using PS3Lib; 11 | 12 | namespace PS3API_Demo 13 | { 14 | public partial class Main : Form 15 | { 16 | private PS3API PS3 = new PS3API(); 17 | private Random rand = new Random(); 18 | 19 | public Main() 20 | { 21 | InitializeComponent(); 22 | } 23 | 24 | private void Main_Load(object sender, EventArgs e) 25 | { 26 | EnableOthersBox(false); 27 | if (PS3.GetCurrentAPI() == SelectAPI.TargetManager) 28 | PS3.PS3TMAPI_NET(); 29 | } 30 | 31 | public void EnableOthersBox(bool active) 32 | { 33 | groupAttach.Enabled = active; 34 | groupMem.Enabled = active; 35 | groupArray.Enabled = active; 36 | } 37 | 38 | private void radioTM_CheckedChanged(object sender, EventArgs e) 39 | { 40 | EnableOthersBox(false); 41 | PS3.ChangeAPI(SelectAPI.TargetManager); 42 | } 43 | 44 | private void radioCC_CheckedChanged(object sender, EventArgs e) 45 | { 46 | EnableOthersBox(false); 47 | PS3.ChangeAPI(SelectAPI.ControlConsole); 48 | } 49 | 50 | private void btnConnect_Click(object sender, EventArgs e) 51 | { 52 | if (PS3.ConnectTarget()) 53 | { 54 | EnableOthersBox(true); 55 | string Message = "You are now connected with this API : " + PS3.GetCurrentAPIName(); 56 | MessageBox.Show(Message, "Connected!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); 57 | } 58 | else 59 | { 60 | EnableOthersBox(false); 61 | string Message = "Impossible to connect :/"; 62 | MessageBox.Show(Message, "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error); 63 | } 64 | } 65 | 66 | private void btnAttach_Click(object sender, EventArgs e) 67 | { 68 | if(PS3.AttachProcess()) 69 | MessageBox.Show("Current game is attached successfully.", "Success.", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); 70 | else MessageBox.Show("No game process found!", "Error.", MessageBoxButtons.OK, MessageBoxIcon.Error); 71 | } 72 | 73 | private void btnSetRand_Click(object sender, EventArgs e) 74 | { 75 | byte[] buffer = new byte[4]; 76 | for (int i = 0; i < 4; i++) 77 | buffer[i] = (byte)rand.Next(0x10, 0x7E); 78 | PS3.SetMemory(0x10045000, buffer); 79 | } 80 | 81 | private void btnReadRand_Click(object sender, EventArgs e) 82 | { 83 | uint randBuff = PS3.Extension.ReadUInt32(0x10045000); 84 | MessageBox.Show("Value in memory is now : " + randBuff.ToString("X8")); 85 | } 86 | 87 | private void btnJump_Click(object sender, EventArgs e) 88 | { 89 | PS3.Extension.WriteFloat(0x000019780, 1000 * 2); 90 | } 91 | 92 | private void btnSpeed_Click(object sender, EventArgs e) 93 | { 94 | PS3.Extension.WriteInt16(0x00173BB0 + 2, 500); 95 | } 96 | 97 | private void btnCrArr_Click(object sender, EventArgs e) 98 | { 99 | // With the v4.5 feature, you can directly put the size of the array that you want, instead of to allocate a buffer yourself, the ctor do it for you. 100 | ArrayBuilder Build = new ArrayBuilder(0x50); 101 | Build.Write.SetBool(3, true); 102 | Build.Write.SetFloat(4, 1000); 103 | Build.Write.SetInt32(8, 1337); 104 | Build.Write.SetString(20, "iMCSx ArrayBuilder !"); 105 | PS3.SetMemory(0x10060000, Build.ToArray()); 106 | MessageBox.Show("Done, try to read now !"); 107 | } 108 | 109 | private void btnReadArr_Click(object sender, EventArgs e) 110 | { 111 | byte[] buffer = PS3.Extension.ReadBytes(0x10060000, 0x50); 112 | ArrayBuilder Build = new ArrayBuilder(buffer); 113 | bool var1 = Build.Read.GetBool(3); 114 | float var2 = Build.Read.GetFloat(4); 115 | int var3 = Build.Read.GetInt32(8); 116 | string var4 = Build.Read.GetString(20); 117 | MessageBox.Show("Result from the array sent to memory is :\n\nPosition 3 - Bool - " + var1.ToString() + "\n\nPosition 4 - Float - " + var2.ToString() + "\n\nPosition 8 - Int32 - " + var3.ToString() + "\n\nPosition 20 - String - " + var4); 118 | 119 | string ok = PS3.Extension.ReadString(0x10060000 + 20); 120 | MessageBox.Show(ok); 121 | } 122 | 123 | private void Main_FormClosing(object sender, FormClosingEventArgs e) 124 | { 125 | PS3.DisconnectTarget(); 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Main.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\ps3.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | -------------------------------------------------------------------------------- /demo/CCAPI-Demo/CCAPI-Demo/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using PS3Lib; 12 | 13 | namespace CCAPI_Demo 14 | { 15 | public partial class Form1 : Form 16 | { 17 | private Random Rand; 18 | private CCAPI PS3 = new CCAPI(); 19 | private Thread TargetInfo; 20 | 21 | private bool threadIsRunning = false; 22 | private bool currentGame = false; 23 | private uint[] procs; 24 | public Form1() 25 | { 26 | Rand = new Random(); 27 | TargetInfo = new Thread(new ThreadStart(InfoWorker)); 28 | InitializeComponent(); 29 | } 30 | 31 | private void Form1_Load(object sender, EventArgs e) 32 | { 33 | EnableBoxes(false); 34 | comboBuzzer.SelectedIndex = 1; 35 | } 36 | 37 | private void Form1_FormClosing(object sender, FormClosingEventArgs e) 38 | { 39 | threadIsRunning = false; 40 | TargetInfo.Abort(); 41 | PS3.DisconnectTarget(); 42 | } 43 | 44 | private void InfoWorker() 45 | { 46 | lblFW.Invoke((MethodInvoker)(() => { lblFW.Text = PS3.GetFirmwareVersion(); })); 47 | lblLV2.Invoke((MethodInvoker)(() => { lblLV2.Text = PS3.GetFirmwareType(); })); 48 | while (threadIsRunning) 49 | { 50 | string temp1 = PS3.GetTemperatureCELL(); 51 | string temp2 = PS3.GetTemperatureRSX(); 52 | lblCELL.Invoke((MethodInvoker)(() => { lblCELL.Text = temp1; })); 53 | lblRSX.Invoke((MethodInvoker)(() => { lblRSX.Text = temp2; })); 54 | PS3.ClearTargetInfo(); 55 | Thread.Sleep(500); 56 | } 57 | TargetInfo.Abort(); 58 | } 59 | 60 | private void EnableBoxes(bool active) 61 | { 62 | groupProc.Enabled = active; 63 | groupCID.Enabled = active; 64 | groupBuzz.Enabled = active; 65 | groupCID.Enabled = active; 66 | groupInfo.Enabled = active; 67 | groupLedColor.Enabled = active; 68 | groupLedMode.Enabled = active; 69 | groupNotify.Enabled = active; 70 | groupDefaultProc.Enabled = active; 71 | btnLed.Enabled = active; 72 | } 73 | 74 | private void btnConnect_Click(object sender, EventArgs e) 75 | { 76 | if (PS3.SUCCESS(PS3.ConnectTarget(BoxIP.Text))) 77 | { 78 | if (!TargetInfo.IsAlive) 79 | { 80 | threadIsRunning = true; 81 | TargetInfo.Start(); 82 | } 83 | EnableBoxes(true); 84 | MessageBox.Show("Connected !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); 85 | } 86 | else 87 | { 88 | EnableBoxes(false); 89 | MessageBox.Show("Impossible to connect", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 90 | } 91 | } 92 | 93 | private void btnRefresh_Click(object sender, EventArgs e) 94 | { 95 | procs = new uint[64]; 96 | PS3.GetProcessList(out procs); 97 | comboProcs.Items.Clear(); 98 | for(int i = 0; i < procs.Length; i++) 99 | { 100 | string name = String.Empty; 101 | PS3.GetProcessName(procs[i], out name); 102 | comboProcs.Items.Add(name); 103 | } 104 | procs = null; 105 | } 106 | 107 | private void btnSetMem_Click(object sender, EventArgs e) 108 | { 109 | if (comboProcs.SelectedIndex >= 0 && BoxOffset.Text != "" && BoxValue.Text != "") 110 | { 111 | try 112 | { 113 | uint processSelected = procs[comboProcs.SelectedIndex]; 114 | PS3.AttachProcess(processSelected); 115 | uint offset = Convert.ToUInt32(BoxOffset.Text.Replace("0x", ""), 16); 116 | uint value = Convert.ToUInt32(BoxValue.Text.Replace("0x", ""), 16); 117 | PS3.Extension.WriteUInt32(offset, value); 118 | } 119 | catch (Exception exx) 120 | { 121 | MessageBox.Show(exx.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 122 | } 123 | } 124 | else MessageBox.Show("Please select a process!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 125 | } 126 | 127 | private void btnCID_Click(object sender, EventArgs e) 128 | { 129 | PS3.SetConsoleID(BoxCID.Text); 130 | } 131 | 132 | private void btnBuzzer_Click(object sender, EventArgs e) 133 | { 134 | if (comboBuzzer.SelectedIndex >= 0) 135 | { 136 | if (comboBuzzer.SelectedIndex == 0) 137 | PS3.RingBuzzer(CCAPI.BuzzerMode.Continuous); 138 | else if (comboBuzzer.SelectedIndex == 1) 139 | PS3.RingBuzzer(CCAPI.BuzzerMode.Single); 140 | else if (comboBuzzer.SelectedIndex == 2) 141 | PS3.RingBuzzer(CCAPI.BuzzerMode.Double); 142 | else if (comboBuzzer.SelectedIndex == 3) 143 | PS3.RingBuzzer(CCAPI.BuzzerMode.Triple); 144 | } 145 | else MessageBox.Show("Please select a buzzer mode", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 146 | } 147 | 148 | private void radioGreen_CheckedChanged(object sender, EventArgs e) 149 | { 150 | 151 | } 152 | 153 | private void radioRed_CheckedChanged(object sender, EventArgs e) 154 | { 155 | 156 | } 157 | 158 | private void radioOn_CheckedChanged(object sender, EventArgs e) 159 | { 160 | 161 | } 162 | 163 | private void radioOff_CheckedChanged(object sender, EventArgs e) 164 | { 165 | 166 | } 167 | 168 | private void radioBlink_CheckedChanged(object sender, EventArgs e) 169 | { 170 | 171 | } 172 | 173 | private void btnLed_Click(object sender, EventArgs e) 174 | { 175 | CCAPI.LedColor Color = CCAPI.LedColor.Green; 176 | CCAPI.LedMode Mode = CCAPI.LedMode.On; 177 | 178 | if (radioOn.Checked) 179 | Mode = CCAPI.LedMode.On; 180 | else if (radioOff.Checked) 181 | Mode = CCAPI.LedMode.Off; 182 | else if (radioBlink.Checked) 183 | Mode = CCAPI.LedMode.Blink; 184 | 185 | if (radioGreen.Checked) 186 | Color = CCAPI.LedColor.Green; 187 | 188 | if (radioRed.Checked) 189 | Color = CCAPI.LedColor.Red; 190 | 191 | PS3.SetConsoleLed(Color, Mode); 192 | } 193 | 194 | private void btnNotify_Click(object sender, EventArgs e) 195 | { 196 | PS3.Notify(CCAPI.NotifyIcon.INFO, BoxNotify.Text); 197 | } 198 | 199 | private void btnAttach_Click(object sender, EventArgs e) 200 | { 201 | if(PS3.SUCCESS(PS3.AttachProcess())) 202 | { 203 | currentGame = true; 204 | MessageBox.Show("Success!"); 205 | } 206 | else MessageBox.Show("You're in a game ?", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 207 | } 208 | 209 | private void btnDefProc_Click(object sender, EventArgs e) 210 | { 211 | if (currentGame) 212 | { 213 | PS3.Extension.WriteInt32(0x10050004, 1337); 214 | byte[] buffer = new byte[4]; 215 | for (int i = 0; i < 4; i++) 216 | buffer[i] = (byte)Rand.Next(255); 217 | PS3.SetMemory(0x10060000, buffer); 218 | MessageBox.Show("Random bytes set in memory, offset 0x10060000"); 219 | } 220 | else MessageBox.Show("Attach the default game before.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 221 | } 222 | 223 | private void btnDialog_Click(object sender, EventArgs e) 224 | { 225 | if (PS3.ConnectTarget()) 226 | { 227 | if (!TargetInfo.IsAlive) 228 | { 229 | threadIsRunning = true; 230 | TargetInfo.Start(); 231 | } 232 | EnableBoxes(true); 233 | MessageBox.Show("Connected"); 234 | } 235 | else 236 | { 237 | EnableBoxes(false); 238 | MessageBox.Show("Failed to connect"); 239 | } 240 | } 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /src/extra/ArrayBuilder.cs: -------------------------------------------------------------------------------- 1 | // ************************************************* // 2 | // --- Copyright (c) 2015 iMCS Productions --- // 3 | // ************************************************* // 4 | // PS3Lib v4 By FM|T iMCSx // 5 | // // 6 | // Features v4.5 : // 7 | // - Support CCAPI v2.60+ C# by iMCSx. // 8 | // - Read/Write memory as 'double'. // 9 | // - Read/Write memory as 'float' array. // 10 | // - Constructor overload for ArrayBuilder. // 11 | // - Some functions fixes. // 12 | // // 13 | // Credits : Enstone, Buc-ShoTz // 14 | // // 15 | // Follow me : // 16 | // // 17 | // FrenchModdingTeam.com // 18 | // Twitter.com/iMCSx // 19 | // Facebook.com/iMCSx // 20 | // // 21 | // ************************************************* // 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Linq; 26 | using System.Text; 27 | using System.Threading.Tasks; 28 | 29 | namespace PS3Lib 30 | { 31 | public enum EndianType 32 | { 33 | LittleEndian, 34 | BigEndian 35 | } 36 | 37 | public class ArrayBuilder 38 | { 39 | private byte[] buffer; 40 | private int size; 41 | 42 | public ArrayBuilder(byte[] BytesArray) 43 | { 44 | buffer = BytesArray; 45 | size = buffer.Length; 46 | } 47 | 48 | public ArrayBuilder(int arraySize) 49 | { 50 | buffer = new byte[arraySize]; 51 | size = buffer.Length; 52 | } 53 | 54 | public byte[] ToArray() 55 | { 56 | return buffer; 57 | } 58 | 59 | /// Enter into all functions "Reader". 60 | public ArrayReader Read 61 | { 62 | get { return new ArrayReader(buffer); } 63 | } 64 | 65 | /// Enter into all functions "Writer". 66 | public ArrayWriter Write 67 | { 68 | get { return new ArrayWriter(buffer); } 69 | } 70 | 71 | public class ArrayReader 72 | { 73 | private byte[] buffer; 74 | private int size; 75 | 76 | public ArrayReader(byte[] BytesArray) 77 | { 78 | buffer = BytesArray; 79 | size = buffer.Length; 80 | } 81 | 82 | public sbyte GetSByte(int pos) 83 | { 84 | return (sbyte)buffer[pos]; 85 | } 86 | 87 | public byte GetByte(int pos) 88 | { 89 | return buffer[pos]; 90 | } 91 | 92 | public char GetChar(int pos) 93 | { 94 | string s = buffer[pos].ToString(); 95 | char b = s[0]; 96 | return b; 97 | } 98 | 99 | public bool GetBool(int pos) 100 | { 101 | return buffer[pos] != 0; 102 | } 103 | 104 | public short GetInt16(int pos, EndianType Type = EndianType.BigEndian) 105 | { 106 | byte[] b = new byte[2]; 107 | for(int i = 0; i < 2; i++) 108 | b[i] = buffer[pos + i]; 109 | if (Type == EndianType.BigEndian) 110 | Array.Reverse(b, 0, 2); 111 | return BitConverter.ToInt16(b, 0); 112 | } 113 | 114 | public int GetInt32(int pos, EndianType Type = EndianType.BigEndian) 115 | { 116 | byte[] b = new byte[4]; 117 | for (int i = 0; i < 4; i++) 118 | b[i] = buffer[pos + i]; 119 | if (Type == EndianType.BigEndian) 120 | Array.Reverse(b, 0, 4); 121 | return BitConverter.ToInt32(b, 0); 122 | } 123 | 124 | public long GetInt64(int pos, EndianType Type = EndianType.BigEndian) 125 | { 126 | byte[] b = new byte[8]; 127 | for (int i = 0; i < 8; i++) 128 | b[i] = buffer[pos + i]; 129 | if (Type == EndianType.BigEndian) 130 | Array.Reverse(b, 0, 8); 131 | return BitConverter.ToInt64(b, 0); 132 | } 133 | 134 | public ushort GetUInt16(int pos, EndianType Type = EndianType.BigEndian) 135 | { 136 | byte[] b = new byte[2]; 137 | for (int i = 0; i < 2; i++) 138 | b[i] = buffer[pos + i]; 139 | if (Type == EndianType.BigEndian) 140 | Array.Reverse(b, 0, 2); 141 | return BitConverter.ToUInt16(b, 0); 142 | } 143 | 144 | public uint GetUInt32(int pos, EndianType Type = EndianType.BigEndian) 145 | { 146 | byte[] b = new byte[4]; 147 | for (int i = 0; i < 4; i++) 148 | b[i] = buffer[pos + i]; 149 | if (Type == EndianType.BigEndian) 150 | Array.Reverse(b, 0, 4); 151 | return BitConverter.ToUInt32(b, 0); 152 | } 153 | 154 | public ulong GetUInt64(int pos, EndianType Type = EndianType.BigEndian) 155 | { 156 | byte[] b = new byte[8]; 157 | for (int i = 0; i < 8; i++) 158 | b[i] = buffer[pos + i]; 159 | if (Type == EndianType.BigEndian) 160 | Array.Reverse(b, 0, 8); 161 | return BitConverter.ToUInt64(b, 0); 162 | } 163 | 164 | public byte[] GetBytes(int pos, int length) 165 | { 166 | byte[] b = new byte[length]; 167 | for (int i = 0; i < length; i++) 168 | b[i] = buffer[pos + i]; 169 | return b; 170 | } 171 | 172 | public string GetString(int pos) 173 | { 174 | int strlen = 0; 175 | while (true) 176 | { 177 | if ((pos + strlen) == buffer.Length) 178 | break; 179 | if (buffer[pos + strlen] != (byte)0) 180 | strlen++; 181 | else break; 182 | } 183 | return Encoding.UTF8.GetString( 184 | buffer.ToList() 185 | .GetRange(pos, strlen) 186 | .ToArray()); 187 | } 188 | 189 | public float GetFloat(int pos) 190 | { 191 | byte[] b = new byte[4]; 192 | for (int i = 0; i < 4; i++) 193 | b[i] = buffer[pos+i]; 194 | Array.Reverse(b, 0, 4); 195 | return BitConverter.ToSingle(b, 0); 196 | } 197 | } 198 | 199 | public class ArrayWriter 200 | { 201 | private byte[] buffer; 202 | private int size; 203 | 204 | public ArrayWriter(byte[] BytesArray) 205 | { 206 | buffer = BytesArray; 207 | size = buffer.Length; 208 | } 209 | 210 | public void SetSByte(int pos, sbyte value) 211 | { 212 | buffer[pos] = (byte)value; 213 | } 214 | 215 | public void SetByte(int pos, byte value) 216 | { 217 | buffer[pos] = value; 218 | } 219 | 220 | public void SetChar(int pos, char value) 221 | { 222 | byte[] b = Encoding.UTF8.GetBytes(value.ToString()); 223 | buffer[pos] = b[0]; 224 | } 225 | 226 | public void SetBool(int pos, bool value) 227 | { 228 | byte[] b = new byte[1]; 229 | b[0] = value ? (byte)1 : (byte)0; 230 | buffer[pos] = b[0]; 231 | } 232 | 233 | public void SetInt16(int pos, short value, EndianType Type = EndianType.BigEndian) 234 | { 235 | byte[] b = BitConverter.GetBytes(value); 236 | if (Type == EndianType.BigEndian) 237 | Array.Reverse(b, 0, 2); 238 | for (int i = 0; i < 2; i++) 239 | buffer[i + pos] = b[i]; 240 | } 241 | 242 | public void SetInt32(int pos, int value, EndianType Type = EndianType.BigEndian) 243 | { 244 | byte[] b = BitConverter.GetBytes(value); 245 | if (Type == EndianType.BigEndian) 246 | Array.Reverse(b, 0, 4); 247 | for (int i = 0; i < 4; i++) 248 | buffer[i + pos] = b[i]; 249 | } 250 | 251 | public void SetInt64(int pos, long value, EndianType Type = EndianType.BigEndian) 252 | { 253 | byte[] b = BitConverter.GetBytes(value); 254 | if (Type == EndianType.BigEndian) 255 | Array.Reverse(b, 0, 8); 256 | for (int i = 0; i < 8; i++) 257 | buffer[i + pos] = b[i]; 258 | } 259 | 260 | public void SetUInt16(int pos, ushort value, EndianType Type = EndianType.BigEndian) 261 | { 262 | byte[] b = BitConverter.GetBytes(value); 263 | if (Type == EndianType.BigEndian) 264 | Array.Reverse(b, 0, 2); 265 | for (int i = 0; i < 2; i++) 266 | buffer[i + pos] = b[i]; 267 | } 268 | 269 | public void SetUInt32(int pos, uint value, EndianType Type = EndianType.BigEndian) 270 | { 271 | byte[] b = BitConverter.GetBytes(value); 272 | if (Type == EndianType.BigEndian) 273 | Array.Reverse(b, 0, 4); 274 | for (int i = 0; i < 4; i++) 275 | buffer[i + pos] = b[i]; 276 | } 277 | 278 | public void SetUInt64(int pos, ulong value, EndianType Type = EndianType.BigEndian) 279 | { 280 | byte[] b = BitConverter.GetBytes(value); 281 | if (Type == EndianType.BigEndian) 282 | Array.Reverse(b, 0, 8); 283 | for (int i = 0; i < 8; i++) 284 | buffer[i + pos] = b[i]; 285 | } 286 | 287 | public void SetBytes(int pos, byte[] value) 288 | { 289 | int valueSize = value.Length; 290 | for (int i = 0; i < valueSize; i++) 291 | buffer[i + pos] = value[i]; 292 | } 293 | 294 | public void SetString(int pos, string value) 295 | { 296 | byte[] b = Encoding.UTF8.GetBytes(value+"\0"); 297 | for (int i = 0; i < b.Length; i++) 298 | buffer[i + pos] = b[i]; 299 | } 300 | 301 | public void SetFloat(int pos, float value) 302 | { 303 | byte[] b = BitConverter.GetBytes(value); 304 | Array.Reverse(b, 0, 4); 305 | for (int i = 0; i < 4; i++) 306 | buffer[i + pos] = b[i]; 307 | } 308 | } 309 | } 310 | } 311 | -------------------------------------------------------------------------------- /demo/PS3API-Demo/PS3API-Demo/Main.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PS3API_Demo 2 | { 3 | partial class Main 4 | { 5 | /// 6 | /// Variable nécessaire au concepteur. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Nettoyage des ressources utilisées. 12 | /// 13 | /// true si les ressources managées doivent être supprimées ; sinon, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Code généré par le Concepteur Windows Form 24 | 25 | /// 26 | /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas 27 | /// le contenu de cette méthode avec l'éditeur de code. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.groupConnect = new System.Windows.Forms.GroupBox(); 32 | this.btnConnect = new System.Windows.Forms.Button(); 33 | this.radioCC = new System.Windows.Forms.RadioButton(); 34 | this.radioTM = new System.Windows.Forms.RadioButton(); 35 | this.groupAttach = new System.Windows.Forms.GroupBox(); 36 | this.btnAttach = new System.Windows.Forms.Button(); 37 | this.groupMem = new System.Windows.Forms.GroupBox(); 38 | this.btnSpeed = new System.Windows.Forms.Button(); 39 | this.btnJump = new System.Windows.Forms.Button(); 40 | this.btnReadRand = new System.Windows.Forms.Button(); 41 | this.btnSetRand = new System.Windows.Forms.Button(); 42 | this.groupArray = new System.Windows.Forms.GroupBox(); 43 | this.btnReadArr = new System.Windows.Forms.Button(); 44 | this.btnCrArr = new System.Windows.Forms.Button(); 45 | this.groupConnect.SuspendLayout(); 46 | this.groupAttach.SuspendLayout(); 47 | this.groupMem.SuspendLayout(); 48 | this.groupArray.SuspendLayout(); 49 | this.SuspendLayout(); 50 | // 51 | // groupConnect 52 | // 53 | this.groupConnect.Controls.Add(this.btnConnect); 54 | this.groupConnect.Controls.Add(this.radioCC); 55 | this.groupConnect.Controls.Add(this.radioTM); 56 | this.groupConnect.Location = new System.Drawing.Point(15, 12); 57 | this.groupConnect.Name = "groupConnect"; 58 | this.groupConnect.Size = new System.Drawing.Size(200, 100); 59 | this.groupConnect.TabIndex = 0; 60 | this.groupConnect.TabStop = false; 61 | this.groupConnect.Text = "Connection Panel "; 62 | // 63 | // btnConnect 64 | // 65 | this.btnConnect.Location = new System.Drawing.Point(32, 27); 66 | this.btnConnect.Name = "btnConnect"; 67 | this.btnConnect.Size = new System.Drawing.Size(137, 28); 68 | this.btnConnect.TabIndex = 2; 69 | this.btnConnect.Text = "Connect"; 70 | this.btnConnect.UseVisualStyleBackColor = true; 71 | this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click); 72 | // 73 | // radioCC 74 | // 75 | this.radioCC.AutoSize = true; 76 | this.radioCC.Location = new System.Drawing.Point(113, 64); 77 | this.radioCC.Name = "radioCC"; 78 | this.radioCC.Size = new System.Drawing.Size(56, 17); 79 | this.radioCC.TabIndex = 1; 80 | this.radioCC.Text = "CCAPI\r\n"; 81 | this.radioCC.UseVisualStyleBackColor = true; 82 | this.radioCC.CheckedChanged += new System.EventHandler(this.radioCC_CheckedChanged); 83 | // 84 | // radioTM 85 | // 86 | this.radioTM.AutoSize = true; 87 | this.radioTM.Checked = true; 88 | this.radioTM.Location = new System.Drawing.Point(32, 64); 89 | this.radioTM.Name = "radioTM"; 90 | this.radioTM.Size = new System.Drawing.Size(58, 17); 91 | this.radioTM.TabIndex = 0; 92 | this.radioTM.TabStop = true; 93 | this.radioTM.Text = "TMAPI\r\n"; 94 | this.radioTM.UseVisualStyleBackColor = true; 95 | this.radioTM.CheckedChanged += new System.EventHandler(this.radioTM_CheckedChanged); 96 | // 97 | // groupAttach 98 | // 99 | this.groupAttach.Controls.Add(this.btnAttach); 100 | this.groupAttach.Location = new System.Drawing.Point(231, 12); 101 | this.groupAttach.Name = "groupAttach"; 102 | this.groupAttach.Size = new System.Drawing.Size(200, 100); 103 | this.groupAttach.TabIndex = 1; 104 | this.groupAttach.TabStop = false; 105 | this.groupAttach.Text = "Attach Process"; 106 | // 107 | // btnAttach 108 | // 109 | this.btnAttach.Location = new System.Drawing.Point(32, 27); 110 | this.btnAttach.Name = "btnAttach"; 111 | this.btnAttach.Size = new System.Drawing.Size(137, 54); 112 | this.btnAttach.TabIndex = 3; 113 | this.btnAttach.Text = "Attach Game Process"; 114 | this.btnAttach.UseVisualStyleBackColor = true; 115 | this.btnAttach.Click += new System.EventHandler(this.btnAttach_Click); 116 | // 117 | // groupMem 118 | // 119 | this.groupMem.Controls.Add(this.btnSpeed); 120 | this.groupMem.Controls.Add(this.btnJump); 121 | this.groupMem.Controls.Add(this.btnReadRand); 122 | this.groupMem.Controls.Add(this.btnSetRand); 123 | this.groupMem.Location = new System.Drawing.Point(15, 118); 124 | this.groupMem.Name = "groupMem"; 125 | this.groupMem.Size = new System.Drawing.Size(200, 138); 126 | this.groupMem.TabIndex = 2; 127 | this.groupMem.TabStop = false; 128 | this.groupMem.Text = "Memory"; 129 | // 130 | // btnSpeed 131 | // 132 | this.btnSpeed.Location = new System.Drawing.Point(32, 106); 133 | this.btnSpeed.Name = "btnSpeed"; 134 | this.btnSpeed.Size = new System.Drawing.Size(137, 23); 135 | this.btnSpeed.TabIndex = 3; 136 | this.btnSpeed.Text = "Set MW3 Speed\r\n\r\n"; 137 | this.btnSpeed.UseVisualStyleBackColor = true; 138 | this.btnSpeed.Click += new System.EventHandler(this.btnSpeed_Click); 139 | // 140 | // btnJump 141 | // 142 | this.btnJump.Location = new System.Drawing.Point(32, 77); 143 | this.btnJump.Name = "btnJump"; 144 | this.btnJump.Size = new System.Drawing.Size(137, 23); 145 | this.btnJump.TabIndex = 2; 146 | this.btnJump.Text = "Set MW3 Jump\r\n"; 147 | this.btnJump.UseVisualStyleBackColor = true; 148 | this.btnJump.Click += new System.EventHandler(this.btnJump_Click); 149 | // 150 | // btnReadRand 151 | // 152 | this.btnReadRand.Location = new System.Drawing.Point(32, 48); 153 | this.btnReadRand.Name = "btnReadRand"; 154 | this.btnReadRand.Size = new System.Drawing.Size(137, 23); 155 | this.btnReadRand.TabIndex = 1; 156 | this.btnReadRand.Text = "Read Random"; 157 | this.btnReadRand.UseVisualStyleBackColor = true; 158 | this.btnReadRand.Click += new System.EventHandler(this.btnReadRand_Click); 159 | // 160 | // btnSetRand 161 | // 162 | this.btnSetRand.Location = new System.Drawing.Point(32, 19); 163 | this.btnSetRand.Name = "btnSetRand"; 164 | this.btnSetRand.Size = new System.Drawing.Size(137, 23); 165 | this.btnSetRand.TabIndex = 0; 166 | this.btnSetRand.Text = "Set Random"; 167 | this.btnSetRand.UseVisualStyleBackColor = true; 168 | this.btnSetRand.Click += new System.EventHandler(this.btnSetRand_Click); 169 | // 170 | // groupArray 171 | // 172 | this.groupArray.Controls.Add(this.btnReadArr); 173 | this.groupArray.Controls.Add(this.btnCrArr); 174 | this.groupArray.Location = new System.Drawing.Point(231, 118); 175 | this.groupArray.Name = "groupArray"; 176 | this.groupArray.Size = new System.Drawing.Size(200, 138); 177 | this.groupArray.TabIndex = 3; 178 | this.groupArray.TabStop = false; 179 | this.groupArray.Text = "Create Array"; 180 | // 181 | // btnReadArr 182 | // 183 | this.btnReadArr.Location = new System.Drawing.Point(27, 72); 184 | this.btnReadArr.Name = "btnReadArr"; 185 | this.btnReadArr.Size = new System.Drawing.Size(147, 41); 186 | this.btnReadArr.TabIndex = 1; 187 | this.btnReadArr.Text = "Read from PS3"; 188 | this.btnReadArr.UseVisualStyleBackColor = true; 189 | this.btnReadArr.Click += new System.EventHandler(this.btnReadArr_Click); 190 | // 191 | // btnCrArr 192 | // 193 | this.btnCrArr.Location = new System.Drawing.Point(27, 25); 194 | this.btnCrArr.Name = "btnCrArr"; 195 | this.btnCrArr.Size = new System.Drawing.Size(147, 41); 196 | this.btnCrArr.TabIndex = 0; 197 | this.btnCrArr.Text = "Create + Set to PS3"; 198 | this.btnCrArr.UseVisualStyleBackColor = true; 199 | this.btnCrArr.Click += new System.EventHandler(this.btnCrArr_Click); 200 | // 201 | // Main 202 | // 203 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 204 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 205 | this.ClientSize = new System.Drawing.Size(447, 267); 206 | this.Controls.Add(this.groupArray); 207 | this.Controls.Add(this.groupMem); 208 | this.Controls.Add(this.groupAttach); 209 | this.Controls.Add(this.groupConnect); 210 | this.MaximumSize = new System.Drawing.Size(463, 306); 211 | this.MinimumSize = new System.Drawing.Size(463, 306); 212 | this.Name = "Main"; 213 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 214 | this.Text = "Demo for use PS3API with PS3Lib v4.5 - By iMCSx"; 215 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing); 216 | this.Load += new System.EventHandler(this.Main_Load); 217 | this.groupConnect.ResumeLayout(false); 218 | this.groupConnect.PerformLayout(); 219 | this.groupAttach.ResumeLayout(false); 220 | this.groupMem.ResumeLayout(false); 221 | this.groupArray.ResumeLayout(false); 222 | this.ResumeLayout(false); 223 | 224 | } 225 | 226 | #endregion 227 | 228 | private System.Windows.Forms.GroupBox groupConnect; 229 | private System.Windows.Forms.Button btnConnect; 230 | private System.Windows.Forms.RadioButton radioCC; 231 | private System.Windows.Forms.RadioButton radioTM; 232 | private System.Windows.Forms.GroupBox groupAttach; 233 | private System.Windows.Forms.Button btnAttach; 234 | private System.Windows.Forms.GroupBox groupMem; 235 | private System.Windows.Forms.Button btnSpeed; 236 | private System.Windows.Forms.Button btnJump; 237 | private System.Windows.Forms.Button btnReadRand; 238 | private System.Windows.Forms.Button btnSetRand; 239 | private System.Windows.Forms.GroupBox groupArray; 240 | private System.Windows.Forms.Button btnReadArr; 241 | private System.Windows.Forms.Button btnCrArr; 242 | } 243 | } 244 | 245 | -------------------------------------------------------------------------------- /src/extra/Extensions.cs: -------------------------------------------------------------------------------- 1 | // ************************************************* // 2 | // --- Copyright (c) 2015 iMCS Productions --- // 3 | // ************************************************* // 4 | // PS3Lib v4 By FM|T iMCSx // 5 | // // 6 | // Features v4.5 : // 7 | // - Support CCAPI v2.60+ C# by iMCSx. // 8 | // - Read/Write memory as 'double'. // 9 | // - Read/Write memory as 'float' array. // 10 | // - Constructor overload for ArrayBuilder. // 11 | // - Some functions fixes. // 12 | // // 13 | // Credits : Enstone, Buc-ShoTz // 14 | // // 15 | // Follow me : // 16 | // // 17 | // FrenchModdingTeam.com // 18 | // Twitter.com/iMCSx // 19 | // Facebook.com/iMCSx // 20 | // // 21 | // ************************************************* // 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Linq; 26 | using System.Text; 27 | 28 | namespace PS3Lib 29 | { 30 | public class Extension 31 | { 32 | private SelectAPI CurrentAPI; 33 | public Extension(SelectAPI API) 34 | { 35 | CurrentAPI = API; 36 | if (API == SelectAPI.TargetManager) 37 | if (Common.TmApi == null) 38 | Common.TmApi = new TMAPI(); 39 | if (API == SelectAPI.ControlConsole) 40 | if (Common.CcApi == null) 41 | Common.CcApi = new CCAPI(); 42 | } 43 | 44 | /// Read a signed byte. 45 | public sbyte ReadSByte(uint offset) 46 | { 47 | byte[] buffer = new byte[1]; 48 | GetMem(offset, buffer, CurrentAPI); 49 | return (sbyte)buffer[0]; 50 | } 51 | 52 | /// Read a byte a check if his value. This return a bool according the byte detected. 53 | public bool ReadBool(uint offset) 54 | { 55 | byte[] buffer = new byte[1]; 56 | GetMem(offset, buffer, CurrentAPI); 57 | return buffer[0] != 0; 58 | } 59 | 60 | /// Read and return an integer 16 bits. 61 | public short ReadInt16(uint offset) 62 | { 63 | byte[] buffer = GetBytes(offset, 2, CurrentAPI); 64 | Array.Reverse(buffer, 0, 2); 65 | return BitConverter.ToInt16(buffer, 0); 66 | } 67 | 68 | /// Read and return an integer 32 bits. 69 | public int ReadInt32(uint offset) 70 | { 71 | byte[] buffer = GetBytes(offset, 4, CurrentAPI); 72 | Array.Reverse(buffer, 0, 4); 73 | return BitConverter.ToInt32(buffer, 0); 74 | } 75 | 76 | /// Read and return an integer 64 bits. 77 | public long ReadInt64(uint offset) 78 | { 79 | byte[] buffer = GetBytes(offset, 8, CurrentAPI); 80 | Array.Reverse(buffer, 0, 8); 81 | return BitConverter.ToInt64(buffer, 0); 82 | } 83 | 84 | /// Read and return a byte. 85 | public byte ReadByte(uint offset) 86 | { 87 | byte[] buffer = GetBytes(offset, 1, CurrentAPI); 88 | return buffer[0]; 89 | } 90 | 91 | /// Read a string with a length to the first byte equal to an value null (0x00). 92 | public byte[] ReadBytes(uint offset, int length) 93 | { 94 | byte[] buffer = GetBytes(offset, (uint)length, CurrentAPI); 95 | return buffer; 96 | } 97 | 98 | /// Read and return an unsigned integer 16 bits. 99 | public ushort ReadUInt16(uint offset) 100 | { 101 | byte[] buffer = GetBytes(offset, 2, CurrentAPI); 102 | Array.Reverse(buffer, 0, 2); 103 | return BitConverter.ToUInt16(buffer, 0); 104 | } 105 | 106 | /// Read and return an unsigned integer 32 bits. 107 | public uint ReadUInt32(uint offset) 108 | { 109 | byte[] buffer = GetBytes(offset, 4, CurrentAPI); 110 | Array.Reverse(buffer, 0, 4); 111 | return BitConverter.ToUInt32(buffer, 0); 112 | } 113 | 114 | /// Read and return an unsigned integer 64 bits. 115 | public ulong ReadUInt64(uint offset) 116 | { 117 | byte[] buffer = GetBytes(offset, 8, CurrentAPI); 118 | Array.Reverse(buffer, 0, 8); 119 | return BitConverter.ToUInt64(buffer, 0); 120 | } 121 | 122 | /// Read and return a Float. 123 | public float ReadFloat(uint offset) 124 | { 125 | byte[] buffer = GetBytes(offset, 4, CurrentAPI); 126 | Array.Reverse(buffer, 0, 4); 127 | return BitConverter.ToSingle(buffer, 0); 128 | } 129 | 130 | /// Read and return an array of Floats. 131 | public float[] ReadFloats(uint offset, int arrayLength = 3) 132 | { 133 | float[] vec = new float[arrayLength]; 134 | for (int i = 0; i < arrayLength; i++) 135 | { 136 | byte[] buffer = GetBytes(offset + ((uint)i*4), 4, CurrentAPI); 137 | Array.Reverse(buffer, 0, 4); 138 | vec[i] = BitConverter.ToSingle(buffer, 0); 139 | } 140 | return vec; 141 | } 142 | 143 | /// Read and return a Double. 144 | public double ReadDouble(uint offset) 145 | { 146 | byte[] buffer = GetBytes(offset, 8, CurrentAPI); 147 | Array.Reverse(buffer, 0, 8); 148 | return BitConverter.ToDouble(buffer, 0); 149 | } 150 | 151 | /// Read a string very fast by buffer and stop only when a byte null is detected (0x00). 152 | public string ReadString(uint offset) 153 | { 154 | int blocksize = 40; 155 | int scalesize = 0; 156 | string str = string.Empty; 157 | 158 | while (!str.Contains('\0')) 159 | { 160 | byte[] buffer = ReadBytes(offset + (uint)scalesize, blocksize); 161 | str += Encoding.UTF8.GetString(buffer); 162 | scalesize += blocksize; 163 | } 164 | 165 | return str.Substring(0, str.IndexOf('\0')); 166 | } 167 | 168 | /// Write a signed byte. 169 | public void WriteSByte(uint offset, sbyte input) 170 | { 171 | byte[] buff = new byte[1]; 172 | buff[0] = (byte)input; 173 | SetMem(offset, buff, CurrentAPI); 174 | } 175 | 176 | /// Write a boolean. 177 | public void WriteBool(uint offset, bool input) 178 | { 179 | byte[] buff = new byte[1]; 180 | buff[0] = input ? (byte)1 : (byte)0; 181 | SetMem(offset, buff, CurrentAPI); 182 | } 183 | 184 | /// Write an interger 16 bits. 185 | public void WriteInt16(uint offset, short input) 186 | { 187 | byte[] buff = new byte[2]; 188 | BitConverter.GetBytes(input).CopyTo(buff, 0); 189 | Array.Reverse(buff, 0, 2); 190 | SetMem(offset, buff, CurrentAPI); 191 | } 192 | 193 | /// Write an integer 32 bits. 194 | public void WriteInt32(uint offset, int input) 195 | { 196 | byte[] buff = new byte[4]; 197 | BitConverter.GetBytes(input).CopyTo(buff, 0); 198 | Array.Reverse(buff, 0, 4); 199 | SetMem(offset, buff, CurrentAPI); 200 | } 201 | 202 | /// Write an integer 64 bits. 203 | public void WriteInt64(uint offset, long input) 204 | { 205 | byte[] buff = new byte[8]; 206 | BitConverter.GetBytes(input).CopyTo(buff, 0); 207 | Array.Reverse(buff, 0, 8); 208 | SetMem(offset, buff, CurrentAPI); 209 | } 210 | 211 | /// Write a byte. 212 | public void WriteByte(uint offset, byte input) 213 | { 214 | byte[] buff = new byte[1]; 215 | buff[0] = input; 216 | SetMem(offset, buff, CurrentAPI); 217 | } 218 | 219 | /// Write a byte array. 220 | public void WriteBytes(uint offset, byte[] input) 221 | { 222 | byte[] buff = input; 223 | SetMem(offset, buff, CurrentAPI); 224 | } 225 | 226 | /// Write a string. 227 | public void WriteString(uint offset, string input) 228 | { 229 | byte[] buff = Encoding.UTF8.GetBytes(input); 230 | Array.Resize(ref buff, buff.Length + 1); 231 | SetMem(offset, buff, CurrentAPI); 232 | } 233 | 234 | /// Write an unsigned integer 16 bits. 235 | public void WriteUInt16(uint offset, ushort input) 236 | { 237 | byte[] buff = new byte[2]; 238 | BitConverter.GetBytes(input).CopyTo(buff, 0); 239 | Array.Reverse(buff, 0, 2); 240 | SetMem(offset, buff, CurrentAPI); 241 | } 242 | 243 | /// Write an unsigned integer 32 bits. 244 | public void WriteUInt32(uint offset, uint input) 245 | { 246 | byte[] buff = new byte[4]; 247 | BitConverter.GetBytes(input).CopyTo(buff, 0); 248 | Array.Reverse(buff, 0, 4); 249 | SetMem(offset, buff, CurrentAPI); 250 | } 251 | 252 | /// Write an unsigned integer 64 bits. 253 | public void WriteUInt64(uint offset, ulong input) 254 | { 255 | byte[] buff = new byte[8]; 256 | BitConverter.GetBytes(input).CopyTo(buff, 0); 257 | Array.Reverse(buff, 0, 8); 258 | SetMem(offset, buff, CurrentAPI); 259 | } 260 | 261 | /// Write a Float. 262 | public void WriteFloat(uint offset, float input) 263 | { 264 | byte[] buff = new byte[4]; 265 | BitConverter.GetBytes(input).CopyTo(buff, 0); 266 | Array.Reverse(buff, 0, 4); 267 | SetMem(offset, buff, CurrentAPI); 268 | } 269 | 270 | /// Write an array of Floats. 271 | public void WriteFloats(uint offset, float[] input) 272 | { 273 | byte[] buff = new byte[4]; 274 | for (int i = 0; i < input.Length; i++) 275 | { 276 | BitConverter.GetBytes(input[i]).CopyTo(buff, 0); 277 | Array.Reverse(buff, 0, 4); 278 | SetMem(offset+((uint)i*4), buff, CurrentAPI); 279 | } 280 | } 281 | 282 | /// Write a double. 283 | public void WriteDouble(uint offset, double input) 284 | { 285 | byte[] buff = new byte[8]; 286 | BitConverter.GetBytes(input).CopyTo(buff, 0); 287 | Array.Reverse(buff, 0, 8); 288 | SetMem(offset, buff, CurrentAPI); 289 | } 290 | 291 | private void SetMem(uint Address, byte[] buffer, SelectAPI API) 292 | { 293 | if (API == SelectAPI.ControlConsole) 294 | Common.CcApi.SetMemory(Address, buffer); 295 | else if (API == SelectAPI.TargetManager) 296 | Common.TmApi.SetMemory(Address, buffer); 297 | } 298 | 299 | private void GetMem(uint offset, byte[] buffer, SelectAPI API) 300 | { 301 | if (API == SelectAPI.ControlConsole) 302 | Common.CcApi.GetMemory(offset, buffer); 303 | else if (API == SelectAPI.TargetManager) 304 | Common.TmApi.GetMemory(offset, buffer); 305 | } 306 | 307 | private byte[] GetBytes(uint offset, uint length, SelectAPI API) 308 | { 309 | byte[] buffer = new byte[length]; 310 | if (API == SelectAPI.ControlConsole) 311 | buffer = Common.CcApi.GetBytes(offset, length); 312 | else if (API == SelectAPI.TargetManager) 313 | buffer = Common.TmApi.GetBytes(offset, length); 314 | return buffer; 315 | } 316 | 317 | private class Common 318 | { 319 | public static CCAPI CcApi; 320 | public static TMAPI TmApi; 321 | } 322 | 323 | } 324 | } -------------------------------------------------------------------------------- /src/api/TMAPI.cs: -------------------------------------------------------------------------------- 1 | // ************************************************* // 2 | // --- Copyright (c) 2015 iMCS Productions --- // 3 | // ************************************************* // 4 | // PS3Lib v4 By FM|T iMCSx // 5 | // // 6 | // Features v4.5 : // 7 | // - Support CCAPI v2.60+ C# by iMCSx. // 8 | // - Read/Write memory as 'double'. // 9 | // - Read/Write memory as 'float' array. // 10 | // - Constructor overload for ArrayBuilder. // 11 | // - Some functions fixes. // 12 | // // 13 | // Credits : Enstone, Buc-ShoTz // 14 | // // 15 | // Follow me : // 16 | // // 17 | // FrenchModdingTeam.com // 18 | // Twitter.com/iMCSx // 19 | // Facebook.com/iMCSx // 20 | // // 21 | // ************************************************* // 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Globalization; 26 | using System.IO; 27 | using System.Linq; 28 | using System.Reflection; 29 | using System.Text; 30 | using System.Windows.Forms; 31 | using System.Xml; 32 | 33 | using PS3Lib.NET; 34 | 35 | namespace PS3Lib 36 | { 37 | public class TMAPI 38 | { 39 | public static int Target = 0xFF; 40 | public static bool AssemblyLoaded = true; 41 | public static PS3TMAPI.ResetParameter resetParameter; 42 | 43 | public TMAPI() 44 | { 45 | 46 | } 47 | 48 | public Extension Extension 49 | { 50 | get { return new Extension(SelectAPI.TargetManager); } 51 | } 52 | 53 | public class SCECMD 54 | { 55 | /// Get the target status and return the string value. 56 | public string SNRESULT() 57 | { 58 | return Parameters.snresult; 59 | } 60 | 61 | /// Get the target name. 62 | public string GetTargetName() 63 | { 64 | if (Parameters.ConsoleName == null || Parameters.ConsoleName == String.Empty) 65 | { 66 | PS3TMAPI.InitTargetComms(); 67 | PS3TMAPI.TargetInfo TargetInfo = new PS3TMAPI.TargetInfo(); 68 | TargetInfo.Flags = PS3TMAPI.TargetInfoFlag.TargetID; 69 | TargetInfo.Target = TMAPI.Target; 70 | PS3TMAPI.GetTargetInfo(ref TargetInfo); 71 | Parameters.ConsoleName = TargetInfo.Name; 72 | } 73 | return Parameters.ConsoleName; 74 | } 75 | 76 | /// Get the target status and return the string value. 77 | public string GetStatus() 78 | { 79 | if (TMAPI.AssemblyLoaded) 80 | return "NotConnected"; 81 | Parameters.connectStatus = new PS3TMAPI.ConnectStatus(); 82 | PS3TMAPI.GetConnectStatus(Target, out Parameters.connectStatus, out Parameters.usage); 83 | Parameters.Status = Parameters.connectStatus.ToString(); 84 | return Parameters.Status; 85 | } 86 | 87 | /// Get the ProcessID by the current process. 88 | public uint ProcessID() 89 | { 90 | return Parameters.ProcessID; 91 | } 92 | 93 | /// Get an array of processID's. 94 | public uint[] ProcessIDs() 95 | { 96 | return Parameters.processIDs; 97 | } 98 | 99 | /// Get some details from your target. 100 | public PS3TMAPI.ConnectStatus DetailStatus() 101 | { 102 | return Parameters.connectStatus; 103 | } 104 | } 105 | 106 | public SCECMD SCE 107 | { 108 | get { return new SCECMD(); } 109 | } 110 | 111 | public class Parameters 112 | { 113 | public static string 114 | usage, 115 | info, 116 | snresult, 117 | Status, 118 | MemStatus, 119 | ConsoleName; 120 | public static uint 121 | ProcessID; 122 | public static uint[] 123 | processIDs; 124 | public static byte[] 125 | Retour; 126 | public static PS3TMAPI.ConnectStatus 127 | connectStatus; 128 | } 129 | 130 | /// Enum of flag reset. 131 | public enum ResetTarget 132 | { 133 | Hard, 134 | Quick, 135 | ResetEx, 136 | Soft 137 | } 138 | 139 | public void InitComms() 140 | { 141 | PS3TMAPI.InitTargetComms(); 142 | } 143 | 144 | /// Connect the default target and initialize the dll. Possible to put an int as arugment for determine which target to connect. 145 | public bool ConnectTarget(int TargetIndex = 0) 146 | { 147 | bool result = false; 148 | if(AssemblyLoaded) 149 | PS3TMAPI_NET(); 150 | AssemblyLoaded = false; 151 | Target = TargetIndex; 152 | result = PS3TMAPI.SUCCEEDED(PS3TMAPI.InitTargetComms()); 153 | result = PS3TMAPI.SUCCEEDED(PS3TMAPI.Connect(TargetIndex, null)); 154 | return result; 155 | } 156 | 157 | /// Connect the target by is name. 158 | public bool ConnectTarget(string TargetName) 159 | { 160 | bool result = false; 161 | if (AssemblyLoaded) 162 | PS3TMAPI_NET(); 163 | AssemblyLoaded = false; 164 | result = PS3TMAPI.SUCCEEDED(PS3TMAPI.InitTargetComms()); 165 | if (result) 166 | { 167 | result = PS3TMAPI.SUCCEEDED(PS3TMAPI.GetTargetFromName(TargetName, out Target)); 168 | result = PS3TMAPI.SUCCEEDED(PS3TMAPI.Connect(Target, null)); 169 | } 170 | return result; 171 | } 172 | 173 | /// Disconnect the target. 174 | public void DisconnectTarget() 175 | { 176 | PS3TMAPI.Disconnect(Target); 177 | } 178 | 179 | /// Power on selected target. 180 | public void PowerOn(int numTarget = 0) 181 | { 182 | if (Target != 0xFF) 183 | numTarget = Target; 184 | PS3TMAPI.PowerOn(numTarget); 185 | } 186 | 187 | /// Power off selected target. 188 | public void PowerOff(bool Force) 189 | { 190 | PS3TMAPI.PowerOff(Target, Force); 191 | } 192 | 193 | /// Attach and continue the current process from the target. 194 | public bool AttachProcess() 195 | { 196 | bool isOK = false; 197 | PS3TMAPI.GetProcessList(Target, out Parameters.processIDs); 198 | if (Parameters.processIDs.Length > 0) 199 | isOK = true; 200 | else isOK = false; 201 | if (isOK) 202 | { 203 | ulong uProcess = Parameters.processIDs[0]; 204 | Parameters.ProcessID = Convert.ToUInt32(uProcess); 205 | PS3TMAPI.ProcessAttach(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID); 206 | PS3TMAPI.ProcessContinue(Target, Parameters.ProcessID); 207 | Parameters.info = "The Process 0x" + Parameters.ProcessID.ToString("X8") + " Has Been Attached !"; 208 | } 209 | return isOK; 210 | } 211 | 212 | /// Set memory to the target (byte[]). 213 | public void SetMemory(uint Address, byte[] Bytes) 214 | { 215 | PS3TMAPI.ProcessSetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, Bytes); 216 | } 217 | 218 | /// Set memory to the address (byte[]). 219 | public void SetMemory(uint Address, ulong value) 220 | { 221 | byte[] b = BitConverter.GetBytes(value); 222 | Array.Reverse(b); 223 | PS3TMAPI.ProcessSetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, b); 224 | } 225 | 226 | /// Set memory with value as string hexadecimal to the address (string). 227 | public void SetMemory(uint Address, string hexadecimal, EndianType Type = EndianType.BigEndian) 228 | { 229 | byte[] Entry = StringToByteArray(hexadecimal); 230 | if (Type == EndianType.LittleEndian) 231 | Array.Reverse(Entry); 232 | PS3TMAPI.ProcessSetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, Entry); 233 | } 234 | 235 | /// Get memory from the address. 236 | public void GetMemory(uint Address, byte[] Bytes) 237 | { 238 | PS3TMAPI.ProcessGetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, ref Bytes); 239 | } 240 | 241 | /// Get a bytes array with the length input. 242 | public byte[] GetBytes(uint Address, uint lengthByte) 243 | { 244 | byte[] Longueur = new byte[lengthByte]; 245 | PS3TMAPI.ProcessGetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, ref Longueur); 246 | return Longueur; 247 | } 248 | 249 | /// Get a string with the length input. 250 | public string GetString(uint Address, uint lengthString) 251 | { 252 | byte[] Longueur = new byte[lengthString]; 253 | PS3TMAPI.ProcessGetMemory(Target, PS3TMAPI.UnitType.PPU, Parameters.ProcessID, 0, Address, ref Longueur); 254 | string StringResult = Hex2Ascii(ReplaceString(Longueur)); 255 | return StringResult; 256 | } 257 | 258 | internal static string Hex2Ascii(string iMCSxString) 259 | { 260 | StringBuilder builder = new StringBuilder(); 261 | for (int i = 0; i <= (iMCSxString.Length - 2); i += 2) 262 | { 263 | builder.Append(Convert.ToString(Convert.ToChar(int.Parse(iMCSxString.Substring(i, 2), NumberStyles.HexNumber)))); 264 | } 265 | return builder.ToString(); 266 | } 267 | 268 | internal static byte[] StringToByteArray(string hex) 269 | { 270 | string replace = hex.Replace("0x", ""); 271 | string Stringz = replace.Insert(replace.Length - 1, "0"); 272 | 273 | int Odd = replace.Length; 274 | bool Nombre = false; 275 | if (Odd % 2 == 0) Nombre = true; 276 | 277 | try 278 | { 279 | return Enumerable.Range(0, replace.Length) 280 | .Where(x => x % 2 == 0) 281 | .Select(x => Convert.ToByte(Nombre ? replace.Substring(x, 2) : Stringz.Substring(x, 2), 16)) 282 | .ToArray(); 283 | } 284 | catch { throw new System.ArgumentException("Value not possible.", "Byte Array"); } 285 | } 286 | 287 | internal static string ReplaceString(byte[] bytes) 288 | { 289 | string PSNString = BitConverter.ToString(bytes); 290 | PSNString = PSNString.Replace("00", string.Empty); 291 | PSNString = PSNString.Replace("-", string.Empty); 292 | for(int i = 0; i < 10; i++) 293 | PSNString = PSNString.Replace("^" + i.ToString(), string.Empty); 294 | return PSNString; 295 | } 296 | 297 | /// Reset target to XMB , Sometimes the target restart quickly. 298 | public void ResetToXMB(ResetTarget flag) 299 | { 300 | if (flag == ResetTarget.Hard) 301 | resetParameter = PS3TMAPI.ResetParameter.Hard; 302 | else if (flag == ResetTarget.Quick) 303 | resetParameter = PS3TMAPI.ResetParameter.Quick; 304 | else if (flag == ResetTarget.ResetEx) 305 | resetParameter = PS3TMAPI.ResetParameter.ResetEx; 306 | else if (flag == ResetTarget.Soft) 307 | resetParameter = PS3TMAPI.ResetParameter.Soft; 308 | PS3TMAPI.Reset(Target, resetParameter); 309 | } 310 | 311 | internal static Assembly LoadApi; 312 | ///Load the PS3 API for use with your Application .NET. 313 | public Assembly PS3TMAPI_NET() 314 | { 315 | AppDomain.CurrentDomain.AssemblyResolve += (s, e) => 316 | { 317 | var filename = new AssemblyName(e.Name).Name; 318 | var x = string.Format(@"C:\Program Files\SN Systems\PS3\bin\ps3tmapi_net.dll", filename); 319 | var x64 = string.Format(@"C:\Program Files (x64)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename); 320 | var x86 = string.Format(@"C:\Program Files (x86)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename); 321 | if (System.IO.File.Exists(x)) 322 | LoadApi = Assembly.LoadFile(x); 323 | else 324 | { 325 | if (System.IO.File.Exists(x64)) 326 | LoadApi = Assembly.LoadFile(x64); 327 | 328 | else 329 | { 330 | if (System.IO.File.Exists(x86)) 331 | LoadApi = Assembly.LoadFile(x86); 332 | else 333 | { 334 | MessageBox.Show("Target Manager API cannot be founded to:\r\n\r\n" + x86, "Error with PS3 API!", MessageBoxButtons.OK, MessageBoxIcon.Error); 335 | } 336 | } 337 | } 338 | return LoadApi; 339 | }; 340 | return LoadApi; 341 | } 342 | } 343 | } 344 | -------------------------------------------------------------------------------- /bin/PS3Lib.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PS3Lib 5 | 6 | 7 | 8 | 9 | Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 10 | 11 | 12 | 13 | 14 | Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 15 | 16 | 17 | 18 | 19 | Remplace la propriété CurrentUICulture du thread actuel pour toutes 20 | les recherches de ressources à l'aide de cette classe de ressource fortement typée. 21 | 22 | 23 | 24 | 25 | Recherche une ressource localisée de type System.Drawing.Icon semblable à (Icône). 26 | 27 | 28 | 29 | 30 | Recherche une ressource localisée de type System.Drawing.Icon semblable à (Icône). 31 | 32 | 33 | 34 | Return true if a ccapi function return a good integer. 35 | 36 | 37 | Connect your console by console list. 38 | 39 | 40 | Connect your console by ip address. 41 | 42 | 43 | Get the status of the console. 44 | 45 | 46 | Disconnect your console. 47 | 48 | 49 | Attach the default process (Current Game). 50 | 51 | 52 | Attach your desired process. 53 | 54 | 55 | Attach your desired process. 56 | 57 | 58 | Get a list of all processes available. 59 | 60 | 61 | Get the process name of your choice. 62 | 63 | 64 | Return the current process attached. Use this function only if you called AttachProcess before. 65 | 66 | 67 | Set memory to offset (uint). 68 | 69 | 70 | Set memory to offset (ulong). 71 | 72 | 73 | Set memory to offset (string hex). 74 | 75 | 76 | Get memory from offset (uint). 77 | 78 | 79 | Get memory from offset (ulong). 80 | 81 | 82 | Like Get memory but this function return directly the buffer from the offset (uint). 83 | 84 | 85 | Like Get memory but this function return directly the buffer from the offset (ulong). 86 | 87 | 88 | Display the notify message on your PS3. 89 | 90 | 91 | Display the notify message on your PS3. 92 | 93 | 94 | You can shutdown the console or just reboot her according the flag selected. 95 | 96 | 97 | Your console will emit a song. 98 | 99 | 100 | Change leds for your console. 101 | 102 | 103 | Get informations of your console and store them into TargetInfo class. 104 | 105 | 106 | Return the current firmware of your console in string format. 107 | 108 | 109 | Return the current temperature of your system in string. 110 | 111 | 112 | Return the current temperature of your system in string. 113 | 114 | 115 | Return the type of your firmware in string format. 116 | 117 | 118 | Clear informations into the DLL (PS3Lib). 119 | 120 | 121 | Set a new ConsoleID in real time. (string) 122 | 123 | 124 | Set a new ConsoleID in real time. (bytes) 125 | 126 | 127 | Set a new PSID in real time. (string) 128 | 129 | 130 | Set a new PSID in real time. (bytes) 131 | 132 | 133 | Set a console ID when the console is running. (string) 134 | 135 | 136 | Set a console ID when the console is running. (bytes) 137 | 138 | 139 | Reset a console ID when the console is running. 140 | 141 | 142 | Return CCAPI Version. 143 | 144 | 145 | Return a list of informations for each console available. 146 | 147 | 148 | Get informations from your target. 149 | 150 | 151 | Get Info for targets. 152 | 153 | 154 | Force a language for the console list popup. 155 | 156 | 157 | init again the connection if you use a Thread or a Timer. 158 | 159 | 160 | Connect your console with selected API. 161 | 162 | 163 | Connect your console with CCAPI. 164 | 165 | 166 | Disconnect Target with selected API. 167 | 168 | 169 | Attach the current process (current Game) with selected API. 170 | 171 | 172 | Set memory to offset with selected API. 173 | 174 | 175 | Get memory from offset using the Selected API. 176 | 177 | 178 | Get memory from offset with a length using the Selected API. 179 | 180 | 181 | Change current API. 182 | 183 | 184 | Return selected API. 185 | 186 | 187 | Return selected API into string format. 188 | 189 | 190 | This will find the dll ps3tmapi_net.dll for TMAPI. 191 | 192 | 193 | Use the extension class with your selected API. 194 | 195 | 196 | Access to all TMAPI functions. 197 | 198 | 199 | Access to all CCAPI functions. 200 | 201 | 202 | Return the systeme language, if it's others all text will be in english. 203 | 204 | 205 | Connect the default target and initialize the dll. Possible to put an int as arugment for determine which target to connect. 206 | 207 | 208 | Connect the target by is name. 209 | 210 | 211 | Disconnect the target. 212 | 213 | 214 | Power on selected target. 215 | 216 | 217 | Power off selected target. 218 | 219 | 220 | Attach and continue the current process from the target. 221 | 222 | 223 | Set memory to the target (byte[]). 224 | 225 | 226 | Set memory to the address (byte[]). 227 | 228 | 229 | Set memory with value as string hexadecimal to the address (string). 230 | 231 | 232 | Get memory from the address. 233 | 234 | 235 | Get a bytes array with the length input. 236 | 237 | 238 | Get a string with the length input. 239 | 240 | 241 | Reset target to XMB , Sometimes the target restart quickly. 242 | 243 | 244 | Load the PS3 API for use with your Application .NET. 245 | 246 | 247 | Get the target status and return the string value. 248 | 249 | 250 | Get the target name. 251 | 252 | 253 | Get the target status and return the string value. 254 | 255 | 256 | Get the ProcessID by the current process. 257 | 258 | 259 | Get an array of processID's. 260 | 261 | 262 | Get some details from your target. 263 | 264 | 265 | Enum of flag reset. 266 | 267 | 268 | Enter into all functions "Reader". 269 | 270 | 271 | Enter into all functions "Writer". 272 | 273 | 274 | Read a signed byte. 275 | 276 | 277 | Read a byte a check if his value. This return a bool according the byte detected. 278 | 279 | 280 | Read and return an integer 16 bits. 281 | 282 | 283 | Read and return an integer 32 bits. 284 | 285 | 286 | Read and return an integer 64 bits. 287 | 288 | 289 | Read and return a byte. 290 | 291 | 292 | Read a string with a length to the first byte equal to an value null (0x00). 293 | 294 | 295 | Read and return an unsigned integer 16 bits. 296 | 297 | 298 | Read and return an unsigned integer 32 bits. 299 | 300 | 301 | Read and return an unsigned integer 64 bits. 302 | 303 | 304 | Read and return a Float. 305 | 306 | 307 | Read and return an array of Floats. 308 | 309 | 310 | Read and return a Double. 311 | 312 | 313 | Read a string very fast by buffer and stop only when a byte null is detected (0x00). 314 | 315 | 316 | Write a signed byte. 317 | 318 | 319 | Write a boolean. 320 | 321 | 322 | Write an interger 16 bits. 323 | 324 | 325 | Write an integer 32 bits. 326 | 327 | 328 | Write an integer 64 bits. 329 | 330 | 331 | Write a byte. 332 | 333 | 334 | Write a byte array. 335 | 336 | 337 | Write a string. 338 | 339 | 340 | Write an unsigned integer 16 bits. 341 | 342 | 343 | Write an unsigned integer 32 bits. 344 | 345 | 346 | Write an unsigned integer 64 bits. 347 | 348 | 349 | Write a Float. 350 | 351 | 352 | Write an array of Floats. 353 | 354 | 355 | Write a double. 356 | 357 | 358 | 359 | -------------------------------------------------------------------------------- /src/api/PS3API.cs: -------------------------------------------------------------------------------- 1 | // ************************************************* // 2 | // --- Copyright (c) 2015 iMCS Productions --- // 3 | // ************************************************* // 4 | // PS3Lib v4 By FM|T iMCSx // 5 | // // 6 | // Features v4.5 : // 7 | // - Support CCAPI v2.60+ C# by iMCSx. // 8 | // - Read/Write memory as 'double'. // 9 | // - Read/Write memory as 'float' array. // 10 | // - Constructor overload for ArrayBuilder. // 11 | // - Some functions fixes. // 12 | // // 13 | // Credits : Enstone, Buc-ShoTz // 14 | // // 15 | // Follow me : // 16 | // // 17 | // FrenchModdingTeam.com // 18 | // Twitter.com/iMCSx // 19 | // Facebook.com/iMCSx // 20 | // // 21 | // ************************************************* // 22 | 23 | using PS3Lib.Properties; 24 | using System; 25 | using System.Collections.Generic; 26 | using System.Drawing; 27 | using System.Globalization; 28 | using System.Linq; 29 | using System.Reflection; 30 | using System.Text; 31 | using System.Threading.Tasks; 32 | using System.Windows.Forms; 33 | 34 | namespace PS3Lib 35 | { 36 | public enum Lang 37 | { 38 | Null, 39 | French, 40 | English, 41 | German 42 | } 43 | 44 | public enum SelectAPI 45 | { 46 | ControlConsole, 47 | TargetManager 48 | } 49 | 50 | public class PS3API 51 | { 52 | private static string targetName = String.Empty; 53 | private static string targetIp = String.Empty; 54 | public PS3API(SelectAPI API = SelectAPI.TargetManager) 55 | { 56 | SetAPI.API = API; 57 | MakeInstanceAPI(API); 58 | } 59 | 60 | public void setTargetName(string value) 61 | { 62 | targetName = value; 63 | } 64 | 65 | private void MakeInstanceAPI(SelectAPI API) 66 | { 67 | if (API == SelectAPI.TargetManager) 68 | if (Common.TmApi == null) 69 | Common.TmApi = new TMAPI(); 70 | if (API == SelectAPI.ControlConsole) 71 | if (Common.CcApi == null) 72 | Common.CcApi = new CCAPI(); 73 | } 74 | 75 | private class SetLang 76 | { 77 | public static Lang defaultLang = Lang.Null; 78 | } 79 | 80 | private class SetAPI 81 | { 82 | public static SelectAPI API; 83 | } 84 | 85 | private class Common 86 | { 87 | public static CCAPI CcApi; 88 | public static TMAPI TmApi; 89 | } 90 | 91 | /// Force a language for the console list popup. 92 | public void SetFormLang(Lang Language) 93 | { 94 | SetLang.defaultLang = Language; 95 | } 96 | 97 | /// init again the connection if you use a Thread or a Timer. 98 | public void InitTarget() 99 | { 100 | if (SetAPI.API == SelectAPI.TargetManager) 101 | Common.TmApi.InitComms(); 102 | } 103 | 104 | /// Connect your console with selected API. 105 | public bool ConnectTarget(int target = 0) 106 | { 107 | // We'll check again if the instance has been done, else you'll got an exception error. 108 | MakeInstanceAPI(GetCurrentAPI()); 109 | 110 | bool result = false; 111 | if (SetAPI.API == SelectAPI.TargetManager) 112 | result = Common.TmApi.ConnectTarget(target); 113 | else 114 | result = new ConsoleList(this).Show(); 115 | return result; 116 | } 117 | 118 | /// Connect your console with CCAPI. 119 | public bool ConnectTarget(string ip) 120 | { 121 | // We'll check again if the instance has been done. 122 | MakeInstanceAPI(GetCurrentAPI()); 123 | if (Common.CcApi.SUCCESS(Common.CcApi.ConnectTarget(ip))) 124 | { 125 | targetIp = ip; 126 | return true; 127 | } 128 | else return false; 129 | } 130 | 131 | /// Disconnect Target with selected API. 132 | public void DisconnectTarget() 133 | { 134 | if (SetAPI.API == SelectAPI.TargetManager) 135 | Common.TmApi.DisconnectTarget(); 136 | else Common.CcApi.DisconnectTarget(); 137 | } 138 | 139 | /// Attach the current process (current Game) with selected API. 140 | public bool AttachProcess() 141 | { 142 | // We'll check again if the instance has been done. 143 | MakeInstanceAPI(GetCurrentAPI()); 144 | 145 | bool AttachResult = false; 146 | if (SetAPI.API == SelectAPI.TargetManager) 147 | AttachResult = Common.TmApi.AttachProcess(); 148 | else if (SetAPI.API == SelectAPI.ControlConsole) 149 | AttachResult = Common.CcApi.SUCCESS(Common.CcApi.AttachProcess()); 150 | return AttachResult; 151 | } 152 | 153 | public string GetConsoleName() 154 | { 155 | if (SetAPI.API == SelectAPI.TargetManager) 156 | return Common.TmApi.SCE.GetTargetName(); 157 | else 158 | { 159 | if (targetName != String.Empty) 160 | return targetName; 161 | 162 | if (targetIp != String.Empty) 163 | { 164 | List Data = new List(); 165 | Data = Common.CcApi.GetConsoleList(); 166 | if (Data.Count > 0) 167 | { 168 | for (int i = 0; i < Data.Count; i++) 169 | if (Data[i].Ip == targetIp) 170 | return Data[i].Name; 171 | } 172 | } 173 | return targetIp; 174 | } 175 | } 176 | 177 | /// Set memory to offset with selected API. 178 | public void SetMemory(uint offset, byte[] buffer) 179 | { 180 | if (SetAPI.API == SelectAPI.TargetManager) 181 | Common.TmApi.SetMemory(offset, buffer); 182 | else if (SetAPI.API == SelectAPI.ControlConsole) 183 | Common.CcApi.SetMemory(offset, buffer); 184 | } 185 | 186 | /// Get memory from offset using the Selected API. 187 | public void GetMemory(uint offset, byte[] buffer) 188 | { 189 | if (SetAPI.API == SelectAPI.TargetManager) 190 | Common.TmApi.GetMemory(offset, buffer); 191 | else if (SetAPI.API == SelectAPI.ControlConsole) 192 | Common.CcApi.GetMemory(offset, buffer); 193 | } 194 | 195 | /// Get memory from offset with a length using the Selected API. 196 | public byte[] GetBytes(uint offset, int length) 197 | { 198 | byte[] buffer = new byte[length]; 199 | if (SetAPI.API == SelectAPI.TargetManager) 200 | Common.TmApi.GetMemory(offset, buffer); 201 | else if (SetAPI.API == SelectAPI.ControlConsole) 202 | Common.CcApi.GetMemory(offset, buffer); 203 | return buffer; 204 | } 205 | 206 | /// Change current API. 207 | public void ChangeAPI(SelectAPI API) 208 | { 209 | SetAPI.API = API; 210 | MakeInstanceAPI(GetCurrentAPI()); 211 | } 212 | 213 | /// Return selected API. 214 | public SelectAPI GetCurrentAPI() 215 | { 216 | return SetAPI.API; 217 | } 218 | 219 | /// Return selected API into string format. 220 | public string GetCurrentAPIName() 221 | { 222 | string output = String.Empty; 223 | if (SetAPI.API == SelectAPI.TargetManager) 224 | output = Enum.GetName(typeof(SelectAPI), SelectAPI.TargetManager).Replace("Manager"," Manager"); 225 | else output = Enum.GetName(typeof(SelectAPI), SelectAPI.ControlConsole).Replace("Console", " Console"); 226 | return output; 227 | } 228 | 229 | /// This will find the dll ps3tmapi_net.dll for TMAPI. 230 | public Assembly PS3TMAPI_NET() 231 | { 232 | return Common.TmApi.PS3TMAPI_NET(); 233 | } 234 | 235 | /// Use the extension class with your selected API. 236 | public Extension Extension 237 | { 238 | get { return new Extension(SetAPI.API); } 239 | } 240 | 241 | /// Access to all TMAPI functions. 242 | public TMAPI TMAPI 243 | { 244 | get { return new TMAPI(); } 245 | } 246 | 247 | /// Access to all CCAPI functions. 248 | public CCAPI CCAPI 249 | { 250 | get { return new CCAPI(); } 251 | } 252 | 253 | public class ConsoleList 254 | { 255 | private PS3API Api; 256 | private List data; 257 | 258 | public ConsoleList(PS3API f) 259 | { 260 | Api = f; 261 | data = Api.CCAPI.GetConsoleList(); 262 | } 263 | 264 | /// Return the systeme language, if it's others all text will be in english. 265 | private Lang getSysLanguage() 266 | { 267 | if (SetLang.defaultLang == Lang.Null) 268 | { 269 | if (CultureInfo.CurrentCulture.ThreeLetterWindowsLanguageName.StartsWith("FRA")) 270 | return Lang.French; 271 | else if (CultureInfo.CurrentCulture.ThreeLetterWindowsLanguageName.StartsWith("GER")) 272 | return Lang.German; 273 | return Lang.English; 274 | } 275 | else return SetLang.defaultLang; 276 | } 277 | 278 | private string strTraduction(string keyword) 279 | { 280 | Lang lang = getSysLanguage(); 281 | if (lang == Lang.French) 282 | { 283 | switch (keyword) 284 | { 285 | case "btnConnect": return "Connexion"; 286 | case "btnRefresh": return "Rafraîchir"; 287 | case "errorSelect": return "Vous devez d'abord sélectionner une console."; 288 | case "errorSelectTitle": return "Sélectionnez une console."; 289 | case "selectGrid": return "Sélectionnez une console dans la grille."; 290 | case "selectedLbl": return "Sélection :"; 291 | case "formTitle": return "Choisissez une console..."; 292 | case "noConsole": return "Aucune console disponible, démarrez CCAPI Manager (v2.60+) et ajoutez une nouvelle console."; 293 | case "noConsoleTitle": return "Aucune console disponible."; 294 | } 295 | } 296 | else if(lang == Lang.German) 297 | { 298 | switch (keyword) 299 | { 300 | case "btnConnect": return "Verbinde"; 301 | case "btnRefresh": return "Wiederholen"; 302 | case "errorSelect": return "Du musst zuerst eine Konsole auswählen."; 303 | case "errorSelectTitle": return "Wähle eine Konsole."; 304 | case "selectGrid": return "Wähle eine Konsole innerhalb dieses Gitters."; 305 | case "selectedLbl": return "Ausgewählt :"; 306 | case "formTitle": return "Wähle eine Konsole..."; 307 | case "noConsole": return "Keine Konsolen verfügbar - starte CCAPI Manager (v2.60+) und füge eine neue Konsole hinzu."; 308 | case "noConsoleTitle": return "Keine Konsolen verfügbar."; 309 | } 310 | } 311 | else 312 | { 313 | switch (keyword) 314 | { 315 | case "btnConnect": return "Connection"; 316 | case "btnRefresh": return "Refresh"; 317 | case "errorSelect": return "You need to select a console first."; 318 | case "errorSelectTitle": return "Select a console."; 319 | case "selectGrid": return "Select a console within this grid."; 320 | case "selectedLbl": return "Selected :"; 321 | case "formTitle": return "Select a console..."; 322 | case "noConsole": return "None consoles available, run CCAPI Manager (v2.60+) and add a new console."; 323 | case "noConsoleTitle": return "None console available."; 324 | } 325 | } 326 | return "?"; 327 | } 328 | 329 | public bool Show() 330 | { 331 | bool Result = false; 332 | int tNum = -1; 333 | 334 | // Instance of widgets 335 | Label lblInfo = new Label(); 336 | Button btnConnect = new Button(); 337 | Button btnRefresh = new Button(); 338 | ListViewGroup listViewGroup = new ListViewGroup("Consoles", HorizontalAlignment.Left); 339 | ListView listView = new ListView(); 340 | Form formList = new Form(); 341 | 342 | // Create our button connect 343 | btnConnect.Location = new Point(12, 254); 344 | btnConnect.Name = "btnConnect"; 345 | btnConnect.Size = new Size(198, 23); 346 | btnConnect.TabIndex = 1; 347 | btnConnect.Text = strTraduction("btnConnect"); 348 | btnConnect.UseVisualStyleBackColor = true; 349 | btnConnect.Enabled = false; 350 | btnConnect.Click += (sender, e) => 351 | { 352 | if(tNum > -1) 353 | { 354 | if (Api.ConnectTarget(data[tNum].Ip)) 355 | { 356 | Api.setTargetName(data[tNum].Name); 357 | Result = true; 358 | } 359 | else Result = false; 360 | formList.Close(); 361 | } 362 | else 363 | MessageBox.Show(strTraduction("errorSelect"), strTraduction("errorSelectTitle"), MessageBoxButtons.OK, MessageBoxIcon.Error); 364 | }; 365 | 366 | // Create our button refresh 367 | btnRefresh.Location = new Point(216, 254); 368 | btnRefresh.Name = "btnRefresh"; 369 | btnRefresh.Size = new Size(86, 23); 370 | btnRefresh.TabIndex = 1; 371 | btnRefresh.Text = strTraduction("btnRefresh"); 372 | btnRefresh.UseVisualStyleBackColor = true; 373 | btnRefresh.Click += (sender, e) => 374 | { 375 | tNum = -1; 376 | listView.Clear(); 377 | lblInfo.Text = strTraduction("selectGrid"); 378 | btnConnect.Enabled = false; 379 | data = Api.CCAPI.GetConsoleList(); 380 | int sizeD = data.Count(); 381 | for (int i = 0; i < sizeD; i++) 382 | { 383 | ListViewItem item = new ListViewItem(" " + data[i].Name + " - " + data[i].Ip); 384 | item.ImageIndex = 0; 385 | listView.Items.Add(item); 386 | } 387 | }; 388 | 389 | // Create our list view 390 | listView.Font = new Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 391 | listViewGroup.Header = "Consoles"; 392 | listViewGroup.Name = "consoleGroup"; 393 | listView.Groups.AddRange(new ListViewGroup[] {listViewGroup}); 394 | listView.HideSelection = false; 395 | listView.Location = new Point(12, 12); 396 | listView.MultiSelect = false; 397 | listView.Name = "ConsoleList"; 398 | listView.ShowGroups = false; 399 | listView.Size = new Size(290, 215); 400 | listView.TabIndex = 0; 401 | listView.UseCompatibleStateImageBehavior = false; 402 | listView.View = View.List; 403 | listView.ItemSelectionChanged += (sender, e) => 404 | { 405 | tNum = e.ItemIndex; 406 | btnConnect.Enabled = true; 407 | string Name, Ip = "?"; 408 | if (data[tNum].Name.Length > 18) 409 | Name = data[tNum].Name.Substring(0, 17) + "..."; 410 | else Name = data[tNum].Name; 411 | if (data[tNum].Ip.Length > 16) 412 | Ip = data[tNum].Name.Substring(0, 16) + "..."; 413 | else Ip = data[tNum].Ip; 414 | lblInfo.Text = strTraduction("selectedLbl") + " " + Name + " / " + Ip; 415 | }; 416 | 417 | // Create our label 418 | lblInfo.AutoSize = true; 419 | lblInfo.Location = new Point(12, 234); 420 | lblInfo.Name = "lblInfo"; 421 | lblInfo.Size = new Size(158, 13); 422 | lblInfo.TabIndex = 3; 423 | lblInfo.Text = strTraduction("selectGrid"); 424 | 425 | // Create our form 426 | formList.MinimizeBox = false; 427 | formList.MaximizeBox = false; 428 | formList.ClientSize = new Size(314, 285); 429 | formList.AutoScaleDimensions = new SizeF(6F, 13F); 430 | formList.AutoScaleMode = AutoScaleMode.Font; 431 | formList.FormBorderStyle = FormBorderStyle.FixedSingle; 432 | formList.StartPosition = FormStartPosition.CenterScreen; 433 | formList.Text = strTraduction("formTitle"); 434 | formList.Controls.Add(listView); 435 | formList.Controls.Add(lblInfo); 436 | formList.Controls.Add(btnConnect); 437 | formList.Controls.Add(btnRefresh); 438 | 439 | // Start to update our list 440 | ImageList imgL = new ImageList(); 441 | imgL.Images.Add(Resources.ps3); 442 | listView.SmallImageList = imgL; 443 | int sizeData = data.Count(); 444 | 445 | for (int i = 0; i < sizeData; i++) 446 | { 447 | ListViewItem item = new ListViewItem(" " + data[i].Name + " - " + data[i].Ip); 448 | item.ImageIndex = 0; 449 | listView.Items.Add(item); 450 | } 451 | 452 | // If there are more than 0 targets we show the form 453 | // Else we inform the user to create a console. 454 | if (sizeData > 0) 455 | formList.ShowDialog(); 456 | else 457 | { 458 | Result = false; 459 | formList.Close(); 460 | MessageBox.Show(strTraduction("noConsole"), strTraduction("noConsoleTitle"), MessageBoxButtons.OK, MessageBoxIcon.Error); 461 | } 462 | 463 | return Result; 464 | } 465 | } 466 | } 467 | } 468 | -------------------------------------------------------------------------------- /src/api/TMAPI_NET.cs: -------------------------------------------------------------------------------- 1 | // ************************************************* // 2 | // --- Copyright (c) 2015 iMCS Productions --- // 3 | // ************************************************* // 4 | // PS3Lib v4 By FM|T iMCSx // 5 | // // 6 | // Features v4.5 : // 7 | // - Support CCAPI v2.60+ C# by iMCSx. // 8 | // - Read/Write memory as 'double'. // 9 | // - Read/Write memory as 'float' array. // 10 | // - Constructor overload for ArrayBuilder. // 11 | // - Some functions fixes. // 12 | // // 13 | // Credits : Enstone, Buc-ShoTz // 14 | // // 15 | // Follow me : // 16 | // // 17 | // FrenchModdingTeam.com // 18 | // Twitter.com/iMCSx // 19 | // Facebook.com/iMCSx // 20 | // // 21 | // ************************************************* // 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Linq; 26 | using System.Runtime.InteropServices; 27 | using System.Text; 28 | using System.Threading.Tasks; 29 | 30 | namespace PS3Lib.NET 31 | { 32 | public class PS3TMAPI 33 | { 34 | public enum SNRESULT 35 | { 36 | SN_E_BAD_ALIGN = -28, 37 | SN_E_BAD_MEMSPACE = -18, 38 | SN_E_BAD_PARAM = -21, 39 | SN_E_BAD_TARGET = -3, 40 | SN_E_BAD_UNIT = -11, 41 | SN_E_BUSY = -22, 42 | SN_E_CHECK_TARGET_CONFIGURATION = -33, 43 | SN_E_COMMAND_CANCELLED = -36, 44 | SN_E_COMMS_ERR = -5, 45 | SN_E_COMMS_EVENT_MISMATCHED_ERR = -39, 46 | SN_E_CONNECT_TO_GAMEPORT_FAILED = -35, 47 | SN_E_CONNECTED = -38, 48 | SN_E_DATA_TOO_LONG = -26, 49 | SN_E_DECI_ERROR = -23, 50 | SN_E_DEPRECATED = -27, 51 | SN_E_DLL_NOT_INITIALISED = -15, 52 | SN_E_ERROR = -2147483648, 53 | SN_E_EXISTING_CALLBACK = -24, 54 | SN_E_FILE_ERROR = -29, 55 | SN_E_HOST_NOT_FOUND = -8, 56 | SN_E_INSUFFICIENT_DATA = -25, 57 | SN_E_LICENSE_ERROR = -32, 58 | SN_E_LOAD_ELF_FAILED = -10, 59 | SN_E_LOAD_MODULE_FAILED = -31, 60 | SN_E_MODULE_NOT_FOUND = -34, 61 | SN_E_NO_SEL = -20, 62 | SN_E_NO_TARGETS = -19, 63 | SN_E_NOT_CONNECTED = -4, 64 | SN_E_NOT_IMPL = -1, 65 | SN_E_NOT_LISTED = -13, 66 | SN_E_NOT_SUPPORTED_IN_SDK_VERSION = -30, 67 | SN_E_OUT_OF_MEM = -12, 68 | SN_E_PROTOCOL_ALREADY_REGISTERED = -37, 69 | SN_E_TARGET_IN_USE = -9, 70 | SN_E_TARGET_RUNNING = -17, 71 | SN_E_TIMEOUT = -7, 72 | SN_E_TM_COMMS_ERR = -6, 73 | SN_E_TM_NOT_RUNNING = -2, 74 | SN_E_TM_VERSION = -14, 75 | SN_S_NO_ACTION = 6, 76 | SN_S_NO_MSG = 3, 77 | SN_S_OK = 0, 78 | SN_S_PENDING = 1, 79 | SN_S_REPLACED = 5, 80 | SN_S_TARGET_STILL_REGISTERED = 7, 81 | SN_S_TM_VERSION = 4 82 | } 83 | 84 | public enum UnitType 85 | { 86 | PPU, 87 | SPU, 88 | SPURAW 89 | } 90 | 91 | [Flags] 92 | public enum ResetParameter : ulong 93 | { 94 | Hard = 1L, 95 | Quick = 2L, 96 | ResetEx = 9223372036854775808L, 97 | Soft = 0L 98 | } 99 | 100 | private class ScopedGlobalHeapPtr 101 | { 102 | private IntPtr m_intPtr = IntPtr.Zero; 103 | 104 | public ScopedGlobalHeapPtr(IntPtr intPtr) 105 | { 106 | this.m_intPtr = intPtr; 107 | } 108 | 109 | ~ScopedGlobalHeapPtr() 110 | { 111 | if (this.m_intPtr != IntPtr.Zero) 112 | { 113 | Marshal.FreeHGlobal(this.m_intPtr); 114 | } 115 | } 116 | 117 | public IntPtr Get() 118 | { 119 | return this.m_intPtr; 120 | } 121 | } 122 | 123 | public enum ConnectStatus 124 | { 125 | Connected, 126 | Connecting, 127 | NotConnected, 128 | InUse, 129 | Unavailable 130 | } 131 | 132 | [StructLayout(LayoutKind.Sequential)] 133 | public class TCPIPConnectProperties 134 | { 135 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0xff)] 136 | public string IPAddress; 137 | public uint Port; 138 | } 139 | 140 | [Flags] 141 | public enum TargetInfoFlag : uint 142 | { 143 | Boot = 0x20, 144 | FileServingDir = 0x10, 145 | HomeDir = 8, 146 | Info = 4, 147 | Name = 2, 148 | TargetID = 1 149 | } 150 | 151 | [StructLayout(LayoutKind.Sequential)] 152 | private struct TargetInfoPriv 153 | { 154 | public PS3TMAPI.TargetInfoFlag Flags; 155 | public int Target; 156 | public IntPtr Name; 157 | public IntPtr Type; 158 | public IntPtr Info; 159 | public IntPtr HomeDir; 160 | public IntPtr FSDir; 161 | public PS3TMAPI.BootParameter Boot; 162 | } 163 | 164 | [Flags] 165 | public enum BootParameter : ulong 166 | { 167 | BluRayEmuOff = 4L, 168 | BluRayEmuUSB = 0x20L, 169 | DebugMode = 0x10L, 170 | Default = 0L, 171 | DualNIC = 0x80L, 172 | HDDSpeedBluRayEmu = 8L, 173 | HostFSTarget = 0x40L, 174 | MemSizeConsole = 2L, 175 | ReleaseMode = 1L, 176 | SystemMode = 0x11L 177 | } 178 | 179 | [StructLayout(LayoutKind.Sequential)] 180 | public struct TargetInfo 181 | { 182 | public PS3TMAPI.TargetInfoFlag Flags; 183 | public int Target; 184 | public string Name; 185 | public string Type; 186 | public string Info; 187 | public string HomeDir; 188 | public string FSDir; 189 | public PS3TMAPI.BootParameter Boot; 190 | } 191 | 192 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3InitTargetComms", CallingConvention = CallingConvention.Cdecl)] 193 | private static extern SNRESULT InitTargetCommsX64(); 194 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3InitTargetComms", CallingConvention = CallingConvention.Cdecl)] 195 | private static extern SNRESULT InitTargetCommsX86(); 196 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3PowerOn", CallingConvention = CallingConvention.Cdecl)] 197 | private static extern SNRESULT PowerOnX64(int target); 198 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3PowerOn", CallingConvention = CallingConvention.Cdecl)] 199 | private static extern SNRESULT PowerOnX86(int target); 200 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3PowerOff", CallingConvention = CallingConvention.Cdecl)] 201 | private static extern SNRESULT PowerOffX64(int target, uint force); 202 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3PowerOff", CallingConvention = CallingConvention.Cdecl)] 203 | private static extern SNRESULT PowerOffX86(int target, uint force); 204 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3Connect", CallingConvention = CallingConvention.Cdecl)] 205 | private static extern SNRESULT ConnectX64(int target, string application); 206 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3Connect", CallingConvention = CallingConvention.Cdecl)] 207 | private static extern SNRESULT ConnectX86(int target, string application); 208 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3GetConnectionInfo", CallingConvention = CallingConvention.Cdecl)] 209 | private static extern SNRESULT GetConnectionInfoX64(int target, IntPtr connectProperties); 210 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3GetConnectionInfo", CallingConvention = CallingConvention.Cdecl)] 211 | private static extern SNRESULT GetConnectionInfoX86(int target, IntPtr connectProperties); 212 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3GetConnectStatus", CallingConvention = CallingConvention.Cdecl)] 213 | private static extern SNRESULT GetConnectStatusX64(int target, out uint status, out IntPtr usage); 214 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3GetConnectStatus", CallingConvention = CallingConvention.Cdecl)] 215 | private static extern SNRESULT GetConnectStatusX86(int target, out uint status, out IntPtr usage); 216 | [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 217 | private static extern int MultiByteToWideChar(int codepage, int flags, IntPtr utf8, int utf8len, StringBuilder buffer, int buflen); 218 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3ProcessList", CallingConvention = CallingConvention.Cdecl)] 219 | private static extern SNRESULT GetProcessListX64(int target, ref uint count, IntPtr processIdArray); 220 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3ProcessList", CallingConvention = CallingConvention.Cdecl)] 221 | private static extern SNRESULT GetProcessListX86(int target, ref uint count, IntPtr processIdArray); 222 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3ProcessContinue", CallingConvention = CallingConvention.Cdecl)] 223 | private static extern SNRESULT ProcessContinueX64(int target, uint processId); 224 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3ProcessContinue", CallingConvention = CallingConvention.Cdecl)] 225 | private static extern SNRESULT ProcessContinueX86(int target, uint processId); 226 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3ProcessAttach", CallingConvention = CallingConvention.Cdecl)] 227 | private static extern SNRESULT ProcessAttachX64(int target, uint unitId, uint processId); 228 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3ProcessAttach", CallingConvention = CallingConvention.Cdecl)] 229 | private static extern SNRESULT ProcessAttachX86(int target, uint unitId, uint processId); 230 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3ProcessGetMemory", CallingConvention = CallingConvention.Cdecl)] 231 | private static extern SNRESULT ProcessGetMemoryX64(int target, UnitType unit, uint processId, ulong threadId, ulong address, int count, byte[] buffer); 232 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3ProcessGetMemory", CallingConvention = CallingConvention.Cdecl)] 233 | private static extern SNRESULT ProcessGetMemoryX86(int target, UnitType unit, uint processId, ulong threadId, ulong address, int count, byte[] buffer); 234 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3GetTargetFromName", CallingConvention = CallingConvention.Cdecl)] 235 | private static extern SNRESULT GetTargetFromNameX64(IntPtr name, out int target); 236 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3GetTargetFromName", CallingConvention = CallingConvention.Cdecl)] 237 | private static extern SNRESULT GetTargetFromNameX86(IntPtr name, out int target); 238 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3Reset", CallingConvention = CallingConvention.Cdecl)] 239 | private static extern SNRESULT ResetX64(int target, ulong resetParameter); 240 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3Reset", CallingConvention = CallingConvention.Cdecl)] 241 | private static extern SNRESULT ResetX86(int target, ulong resetParameter); 242 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3ProcessSetMemory", CallingConvention = CallingConvention.Cdecl)] 243 | private static extern SNRESULT ProcessSetMemoryX64(int target, UnitType unit, uint processId, ulong threadId, ulong address, int count, byte[] buffer); 244 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3ProcessSetMemory", CallingConvention = CallingConvention.Cdecl)] 245 | private static extern SNRESULT ProcessSetMemoryX86(int target, UnitType unit, uint processId, ulong threadId, ulong address, int count, byte[] buffer); 246 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3GetTargetInfo", CallingConvention = CallingConvention.Cdecl)] 247 | private static extern SNRESULT GetTargetInfoX64(ref TargetInfoPriv targetInfoPriv); 248 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3GetTargetInfo", CallingConvention = CallingConvention.Cdecl)] 249 | private static extern SNRESULT GetTargetInfoX86(ref TargetInfoPriv targetInfoPriv); 250 | [DllImport("PS3TMAPIX64.dll", EntryPoint = "SNPS3Disconnect", CallingConvention = CallingConvention.Cdecl)] 251 | private static extern SNRESULT DisconnectX64(int target); 252 | [DllImport("PS3TMAPI.dll", EntryPoint = "SNPS3Disconnect", CallingConvention = CallingConvention.Cdecl)] 253 | private static extern SNRESULT DisconnectX86(int target); 254 | private static bool Is32Bit() 255 | { 256 | return (IntPtr.Size == 4); 257 | } 258 | 259 | public static bool FAILED(SNRESULT res) 260 | { 261 | return !SUCCEEDED(res); 262 | } 263 | 264 | public static bool SUCCEEDED(SNRESULT res) 265 | { 266 | return (res >= SNRESULT.SN_S_OK); 267 | } 268 | 269 | private static IntPtr AllocUtf8FromString(string wcharString) 270 | { 271 | if (wcharString == null) 272 | { 273 | return IntPtr.Zero; 274 | } 275 | byte[] bytes = Encoding.UTF8.GetBytes(wcharString); 276 | IntPtr destination = Marshal.AllocHGlobal((int)(bytes.Length + 1)); 277 | Marshal.Copy(bytes, 0, destination, bytes.Length); 278 | Marshal.WriteByte((IntPtr)(destination.ToInt64() + bytes.Length), 0); 279 | return destination; 280 | } 281 | 282 | public static string Utf8ToString(IntPtr utf8, uint maxLength) 283 | { 284 | int len = MultiByteToWideChar(65001, 0, utf8, -1, null, 0); 285 | if (len == 0) throw new System.ComponentModel.Win32Exception(); 286 | var buf = new StringBuilder(len); 287 | len = MultiByteToWideChar(65001, 0, utf8, -1, buf, len); 288 | return buf.ToString(); 289 | } 290 | 291 | private static IntPtr ReadDataFromUnmanagedIncPtr(IntPtr unmanagedBuf, ref T storage) 292 | { 293 | storage = (T)Marshal.PtrToStructure(unmanagedBuf, typeof(T)); 294 | return new IntPtr(unmanagedBuf.ToInt64() + Marshal.SizeOf((T)storage)); 295 | } 296 | 297 | public static SNRESULT InitTargetComms() 298 | { 299 | if (!Is32Bit()) 300 | { 301 | return InitTargetCommsX64(); 302 | } 303 | return InitTargetCommsX86(); 304 | } 305 | 306 | public static SNRESULT Connect(int target, string application) 307 | { 308 | if (!Is32Bit()) 309 | { 310 | return ConnectX64(target, application); 311 | } 312 | return ConnectX86(target, application); 313 | } 314 | 315 | public static SNRESULT PowerOn(int target) 316 | { 317 | if (!Is32Bit()) 318 | { 319 | return PowerOnX64(target); 320 | } 321 | return PowerOnX86(target); 322 | } 323 | 324 | public static SNRESULT PowerOff(int target, bool bForce) 325 | { 326 | uint force = bForce ? (uint)1 : 0; 327 | if (!Is32Bit()) 328 | { 329 | return PowerOffX64(target, force); 330 | } 331 | return PowerOffX86(target, force); 332 | } 333 | 334 | public static SNRESULT GetProcessList(int target, out uint[] processIDs) 335 | { 336 | processIDs = null; 337 | uint count = 0; 338 | SNRESULT res = Is32Bit() ? GetProcessListX86(target, ref count, IntPtr.Zero) : GetProcessListX64(target, ref count, IntPtr.Zero); 339 | if (!FAILED(res)) 340 | { 341 | ScopedGlobalHeapPtr ptr = new ScopedGlobalHeapPtr(Marshal.AllocHGlobal((int)(4 * count))); 342 | res = Is32Bit() ? GetProcessListX86(target, ref count, ptr.Get()) : GetProcessListX64(target, ref count, ptr.Get()); 343 | if (FAILED(res)) 344 | { 345 | return res; 346 | } 347 | IntPtr unmanagedBuf = ptr.Get(); 348 | processIDs = new uint[count]; 349 | for (uint i = 0; i < count; i++) 350 | { 351 | unmanagedBuf = ReadDataFromUnmanagedIncPtr(unmanagedBuf, ref processIDs[i]); 352 | } 353 | } 354 | return res; 355 | } 356 | 357 | public static SNRESULT ProcessAttach(int target, UnitType unit, uint processID) 358 | { 359 | if (!Is32Bit()) 360 | { 361 | return ProcessAttachX64(target, (uint)unit, processID); 362 | } 363 | return ProcessAttachX86(target, (uint)unit, processID); 364 | } 365 | 366 | public static SNRESULT ProcessContinue(int target, uint processID) 367 | { 368 | if (!Is32Bit()) 369 | { 370 | return ProcessContinueX64(target, processID); 371 | } 372 | return ProcessContinueX86(target, processID); 373 | } 374 | 375 | public static SNRESULT GetTargetInfo(ref TargetInfo targetInfo) 376 | { 377 | TargetInfoPriv targetInfoPriv = new TargetInfoPriv 378 | { 379 | Flags = targetInfo.Flags, 380 | Target = targetInfo.Target 381 | }; 382 | SNRESULT res = Is32Bit() ? GetTargetInfoX86(ref targetInfoPriv) : GetTargetInfoX64(ref targetInfoPriv); 383 | if (!FAILED(res)) 384 | { 385 | targetInfo.Flags = targetInfoPriv.Flags; 386 | targetInfo.Target = targetInfoPriv.Target; 387 | targetInfo.Name = Utf8ToString(targetInfoPriv.Name, uint.MaxValue); 388 | targetInfo.Type = Utf8ToString(targetInfoPriv.Type, uint.MaxValue); 389 | targetInfo.Info = Utf8ToString(targetInfoPriv.Info, uint.MaxValue); 390 | targetInfo.HomeDir = Utf8ToString(targetInfoPriv.HomeDir, uint.MaxValue); 391 | targetInfo.FSDir = Utf8ToString(targetInfoPriv.FSDir, uint.MaxValue); 392 | targetInfo.Boot = targetInfoPriv.Boot; 393 | } 394 | return res; 395 | } 396 | 397 | public static SNRESULT GetTargetFromName(string name, out int target) 398 | { 399 | ScopedGlobalHeapPtr ptr = new ScopedGlobalHeapPtr(AllocUtf8FromString(name)); 400 | if (!Is32Bit()) 401 | { 402 | return GetTargetFromNameX64(ptr.Get(), out target); 403 | } 404 | return GetTargetFromNameX86(ptr.Get(), out target); 405 | } 406 | 407 | public static SNRESULT GetConnectionInfo(int target, out TCPIPConnectProperties connectProperties) 408 | { 409 | connectProperties = null; 410 | ScopedGlobalHeapPtr ptr = new ScopedGlobalHeapPtr(Marshal.AllocHGlobal(Marshal.SizeOf(typeof(TCPIPConnectProperties)))); 411 | SNRESULT res = Is32Bit() ? GetConnectionInfoX86(target, ptr.Get()) : GetConnectionInfoX64(target, ptr.Get()); 412 | if (SUCCEEDED(res)) 413 | { 414 | connectProperties = new TCPIPConnectProperties(); 415 | Marshal.PtrToStructure(ptr.Get(), connectProperties); 416 | } 417 | return res; 418 | } 419 | 420 | public static SNRESULT GetConnectStatus(int target, out ConnectStatus status, out string usage) 421 | { 422 | IntPtr ptr; 423 | uint num; 424 | SNRESULT snresult = Is32Bit() ? GetConnectStatusX86(target, out num, out ptr) : GetConnectStatusX64(target, out num, out ptr); 425 | status = (ConnectStatus)num; 426 | usage = Utf8ToString(ptr, uint.MaxValue); 427 | return snresult; 428 | } 429 | 430 | public static SNRESULT Reset(int target, ResetParameter resetParameter) 431 | { 432 | if (!Is32Bit()) 433 | { 434 | return ResetX64(target, (ulong)resetParameter); 435 | } 436 | return ResetX86(target, (ulong)resetParameter); 437 | } 438 | 439 | public static SNRESULT ProcessGetMemory(int target, UnitType unit, uint processID, ulong threadID, ulong address, ref byte[] buffer) 440 | { 441 | if (!Is32Bit()) 442 | { 443 | return ProcessGetMemoryX64(target, unit, processID, threadID, address, buffer.Length, buffer); 444 | } 445 | return ProcessGetMemoryX86(target, unit, processID, threadID, address, buffer.Length, buffer); 446 | } 447 | 448 | public static SNRESULT ProcessSetMemory(int target, UnitType unit, uint processID, ulong threadID, ulong address, byte[] buffer) 449 | { 450 | if (!Is32Bit()) 451 | { 452 | return ProcessSetMemoryX64(target, unit, processID, threadID, address, buffer.Length, buffer); 453 | } 454 | return ProcessSetMemoryX86(target, unit, processID, threadID, address, buffer.Length, buffer); 455 | } 456 | 457 | public static SNRESULT Disconnect(int target) 458 | { 459 | if (!Is32Bit()) 460 | { 461 | return DisconnectX64(target); 462 | } 463 | return DisconnectX86(target); 464 | } 465 | } 466 | } 467 | --------------------------------------------------------------------------------