CCAPI for Windows documentation
CCAPI (ControlConsole API) includes a file CCAPI.dll. CCAPI.dll is a Windows dynamic library and x86 32 bits assembly. It exports a few functions for programs to control a ps3 (with CCAPI installed on it).
Function documentation
Functions | Min ver. |
int CCAPIConnect(const char* ip) | 2.60 |
int CCAPIDisconnect() | 2.60 |
int CCAPIGetConnectionStatus(int* status) | 2.60 |
int CCAPISetConsoleIds(ConsoleIdType idType, const ConsoleId* id) | 2.60 |
int CCAPISetBootConsoleIds(ConsoleIdType idType, int on, const ConsoleId* id) | 2.60 |
int CCAPIGetMemory(u32 pid, u64 address, u32 size, void* data) | 2.60 |
int CCAPISetMemory(u32 pid, u64 address, u32 size, const void* data) | 2.60 |
int CCAPIGetProcessList(u32* npid, u32* pids) | 2.60 |
int CCAPIGetProcessName(u32 pid, ProcessName* name) | 2.60 |
int CCAPIGetTemperature(int* cell, int* rsx) | 2.60 |
int CCAPIShutdown(ShutdownMode mode) | 2.60 |
int CCAPIRingBuzzer(RingBuzzerType type) | 2.60 |
int CCAPISetConsoleLed(ColorLed color, StatusLed status) | 2.60 |
int CCAPIGetFirmwareInfo(u32* firmware, u32* ccapi, ConsoleType* cType) | 2.60 |
int CCAPIVshNotify(NotifyIcon icon, const char* msg) | 2.60 |
int CCAPIGetNumberOfConsoles() | 2.60 |
void CCAPIGetConsoleInfo(int index, ConsoleName* name, ConsoleIp* ip) | 2.60 |
int CCAPIGetDllVersion() | 2.60 |
Thread safety : All calls to CCAPI functions are thread safe.
Return value : a return value different of CCAPI_OK indicates that it failed and outputs are undefined.
#define CCAPI_OK 0
int CCAPIConnect(const char* ip)
Use this function to connect to CCAPI on your ps3.
This function takes one parameter the console ip for instance, ip can be const char* ip = "192.168.1.0";
A returned value of CCAPI_OK indicates that the connection was successful else it means that the connection failed.
Calling a second time CCAPIConnect even if you are already connected to the same console or to another console, will automatically perform a disconnection for the previous established connection.
Example:
if (CCAPIConnect("192.168.1.0") == CCAPI_OK)
{
printf("Connected to CCAPI\n");
}
int CCAPIDisconnect()
The purpose of this function is to disable an established connection with your ps3.
Example:
CCAPIDisconnect();
int CCAPIGetConnectionStatus(int* status)
This function always returns CCAPI_OK. If status is 0, the connection is not established else the connection is made. It can be called like this:
Example:
int status;
CCAPIGetConnectionStatus(&status);
int CCAPISetConsoleIds(ConsoleIdType idType, const ConsoleId* id)
This function can be used to modify immediately your active idps ("console id") and your psid.
Example, setting a psid:
ConsoleId id = {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}};
CCAPISetConsoleIds(Psid,&id);
int CCAPISetBootConsoleIds(ConsoleIdType idType, int on, const ConsoleId* id)
This function can be used to preset a modified idps and psid. At every console boot, those will be set.
Example:
Setting a boot psid:
ConsoleId id = {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}};
CCAPISetBootConsoleIds(Psid,1,&id);
Removing the boot psid:
CCAPISetBootConsoleIds(Psid,0,NULL);
int CCAPIGetMemory(u32 pid, u64 address, u32 size, void* data)
Use this function to read memory from the ps3 process that has the process id "pid".
Example:
char data[4];
if (CCAPIGetMemory(pid,0x10000,4,&data) == CCAPI_OK)
{
}
else
{
//error handling
}
int CCAPISetMemory(u32 pid, u64 address, u32 size, const void* data)
Use this function to wrte memory of the ps3 process that has the process id "pid".
Example:
char data[4] = {0x00,0x00,0x00,0x00};
u32 pid; //value must be retrieved with CCAPIGetProcessList
if (CCAPISetMemory(pid,0x10000,4,&data) == CCAPI_OK)
{
}
else
{
//error handling
}
int CCAPIGetProcessList(u32* npid, u32* pids)
With this function, it is possible to retrive process id of running processes. It is a unique identifier for a ps3 processes.
This function has several ways to be called, the procedure to get the process ids is the following:
u32 npid;
CCAPIGetProcessList(&npid,0);
Your will find in npid, the number of process running on your ps3. This way, you can allocate your buffer to the exact size needed.
Then a second call will return your all the process ids on your ps3 in "pids" and the effective number of process id in "*npid".
u32* pids = (u32*) malloc(npid * sizeof(u32));
if (CCAPIGetProcessList(&npid,pids) == CCAPI_OK)
{
int i;
for (i=0;i<npid;i++)
{
printf("process %d : id %x\n",i,pids[i]);
}
}
free(pids);
int CCAPIGetProcessName(u32 pid, ProcessName* name)
Use this function to get the name of a process with its pid.
Example:
u32 pid; //value must be retrieved with CCAPIGetProcessList
ProcessName name;
if (CCAPIGetProcessName(pid,&name) == CCAPI_OK)
{
printf("Process %x has name is %s\n",pid,name.value);
}
else
{
//Error handling...
}
int CCAPIGetTemperature(int* cell, int* rsx)
This function is useful to get temperature of ps3 processors.
Example:
int cell, rsx;
if (CCAPIGetTemperature(&cell,&rsx) == CCAPI_OK)
{
printf("Cell temperature is %d, Rsx temperature is %d\n",cell,rsx);
}
else
{
//Error handling...
}
int CCAPIShutdown(ShutdownMode mode)
Use this function to reboot or shutdown the ps3.
Example, reboot the ps3:
CCAPIShutdown(ActionHardReboot);
int CCAPIRingBuzzer(RingBuzzerType type)
Use this function to emit a buzzer sound.
Example:
CCAPIRingBuzzer(BuzzerSingle);
int CCAPISetConsoleLed(ColorLed color, StatusLed status)
Use this function to modify the main led behaviour and its color.
Example:
CCAPISetConsoleLed(LedRed,LedBlink);
int CCAPIGetFirmwareInfo(u32* firmware, u32* ccapi, ConsoleType* cType)
With this function, it is possible to get the ps3 firmware, ccapi version and the console type.
Example:
u32 firmware, ccapi;
ConsoleType ctype;
if (CCAPIGetFirmwareInfo(&firmware,&ccapi,&ctype) == CCAPI_OK)
{
printf("firmware %x, ccapi %d, ctype %d\n",firmware,ccapi,(u32)ctype);
}
int CCAPIVshNotify(NotifyIcon icon, const char* msg)
Show an xmb notification with custom icon and custom text.
Example:
CCAPIVshNotify(NotifyTrophy1, "Hello from CCAPI");
int CCAPIGetNumberOfConsoles()
This function accesses to the shared application console list and give you the number of registered consoles.
Example:
int nbConsoles = CCAPIGetNumberOfConsoles();
void CCAPIGetConsoleInfo(int index, ConsoleName* name, ConsoleIp* ip)
Retrieve a console name and ip from the shared console list.
Adding a console can be done through the windows application "ConsoleManager" available in the CCAPI package. Added console will be available in from all ccapi applications.
Example:
int i=0;
ConsoleName name;
ConsoleIp ip;
for (i=0;i<CCAPIGetNumberOfConsoles();i++)
{
CCAPIGetConsoleInfo(i,&name,&ip);
printf("Console name:%s ip:%s\n",name.value,ip.value);
}
int CCAPIGetDllVersion()
Return the dll version
Example
int dllversion = CCAPIGetDllVersion();
printf("Dll is %d\n",dllversion);
Typedef documentation
typedef | original type |
u8 | unsigned char |
u32 | unsigned int |
u64 | unsigned long long int |
Enumeration documentation
Enumerations |
enum ConsoleIdType |
enum ShutdownMode |
enum ConsoleType |
enum ColorLed |
enum StatusLed |
enum BuzzerType |
enum NotifyIcon |
enum ConsoleIdType
Identify whenever the console id is an idps or a psid.
enum ConsoleIdType //:int
{
Idps = 0,
Psid = 1,
};
enum ShutdownMode
Represent the shutdown action type, shutdown or reboot.
enum ShutdownMode //: int
{
ActionShutdown = 1,
ActionSoftReboot = 2,
ActionHardReboot = 3,
};
enum ConsoleType
Repesent the type of the ps3, CEX, DEX or TOOL.
enum ConsoleType //: int
{
UNK = 0,
CEX = 1,
DEX = 2,
TOOL = 3,
};
enum ColorLed
Represent a ps3 main led color.
enum ColorLed //: int
{
LedRed = 0,
LedGreen = 1,
};
enum StatusLed
Represent a ps3 main led status.
enum StatusLed //: int
{
LedOff = 0,
LedOn = 1,
LedBlink = 2,
};
enum BuzzerType
Represent a buzzer sound type.
enum BuzzerType //: int
{
BuzzerContinuous = 0,
BuzzerSingle = 1,
BuzzerDouble = 2,
BuzzerTriple = 3,
};
enum NotifyIcon
Represent a custom xmb notification icon.
enum NotifyIcon //: int
{
NotifyInfo = 0,
NotifyCaution = 1,
NotifyFriend = 2,
NotifySlider = 3,
NotifyWrongWay = 4,
NotifyDialog = 5,
NotifyDalogShadow = 6,
NotifyText = 7,
NotifyPointer = 8,
NotifyGrab = 9,
NotifyHand = 10,
NotifyPen = 11,
NotifyFinger = 12,
NotifyArrow = 13,
NotifyArrowRight = 14,
NotifyProgress = 15,
NotifyTrophy1 = 16,
NotifyTrophy2 = 17,
NotifyTrophy3 = 18,
NotifyTrophy4 = 19
};
Structure documentation
Structures |
struct ConsoleId |
struct ProcessName |
struct ConsoleName |
struct ConsoleIp |
struct ConsoleId
Store a idps/psid as an array of unsigned char.
struct ConsoleId
{
u8 value[16];
};
struct ProcessName
Store a process name as a 0-terminated string.
struct ProcessName
{
char value[512];
};
struct ConsoleName
Store a console name as a 0-terminated string.
struct ConsoleName
{
char value[256];
};
struct ConsoleIp
Store a console ip as a 0-terminated string.
struct ConsoleIp
{
char value[256];
};