Join Us and become a Member for a Verified Badge to access private areas with the latest PS4 PKGs.
Status
Not open for further replies.
I've been researching PS4 License files for Games and Applications. And there is an file format called IDX. I took the time to reverse this format and document it. Even make a program to generate these files for the community.

Here is the source code to the application: CrazyVoid GenIDX PS4 Program <--- Save this file as genidx.c in ps4_tools

Code:
/*  CrazyVoid Generate PS4 IDX File
 *  - 07/24/2017
 */
 
#include <sys/types.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <zlib.h>
#include <dirent.h>
#include <assert.h>
#include <stdint.h>
 
#ifdef WIN32
#include "mingw_mmap.h"
#include <windows.h>
#else
#include <sys/mman.h>
#endif
 
#include "tools.h"
 
u8 magicPreset[0x9] = { 0x72, 0x69, 0x64, 0x78, 0x01, 0x00, 0x00, 0x00, 0x01 };
u8 padding1Preset[0x4] = { 0x00, 0x00, 0x00, 0x00 };
u8 unknownPreset[0x16] = { 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
u8 padding2Preset[0x16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
u8 outputFile[0x50];
 
int generateIDX(char *CONTENT_ID, char *ENTITLEMENT_LABEL)
{
    int ret;
    if(strlen(CONTENT_ID) == 19)
    {
        if(strlen(ENTITLEMENT_LABEL) == 16)
        {
            char outputFilename[30] = "fake";
            strcat(outputFilename, CONTENT_ID);
            strcat(outputFilename, ".idx");
            printf("Output : %s\n\n", outputFilename);
 
            memcpy(outputFile, magicPreset, 9);
            memcpy(outputFile+9, CONTENT_ID, 19);
            memcpy(outputFile+28, padding1Preset, 4);
            memcpy(outputFile+32, ENTITLEMENT_LABEL, 16);
            memcpy(outputFile+48, unknownPreset, 16);
            memcpy(outputFile+64, padding2Preset, 16);
 
            FILE *fp;
            fp = fopen(outputFilename, "w+");
            fwrite(outputFile, sizeof(outputFile), 1, fp);
            fclose(fp);
            ret = 0;
        }
        else
        {
            printf("[ERROR] Invalid length of ENTITLEMENT LABLE\nFailed to create IDX\n\n");
            ret = 1;
        }
    }
    else
    {
        printf("[ERROR] Invalid length of CONTENT ID\nFailed to create IDX\n\n");
        ret = 2;
    }
 
    return ret;
}
 
void help_Output()
{
    printf("====PS4 IDX Generator - CrazyVoid======\n");
    #ifdef WIN32
    printf("genidx.exe CONTENT_ID ENTITLEMENT_LABEL\n\n");
    #else
    printf("./genidx CONTENT_ID ENTITLEMENT_LABEL\n\n");
    #endif
    printf("[ERROR] INCORRECT AMOUNT OF ARGUMENTS\n\n");
}
 
int main(int argc, char *argv[])
{
    int ret;
 
 
    if (argc != 3)
    {
        help_Output();
        ret = 3;
    }
    else
    {
        // Dont change this line, stealing others work is not nice :)
        // If you add code, feel free to add your name.
        printf("[CrazyVoid] IDX Generator v0.1\n");
        ret = generateIDX(argv[1], argv[2]);
    }
 
    return ret;
}
You'll also need PS4 Tools by Harlequin (Twitter aka @happyelement who also helped with Resigning PS4 Trophies) -> https://github.com/harlequin/ps4tools
-> Don't forget to include genidx.c in the Makefile in PS4 Tools

To use genidx, You need CONTENT_ID and ENTITLEMENT_LABEL of the application you're making the IDX file for. Once you have them. You can pass them to the app like so:
Code:
Linux : ./genidx EP9009-CUSA00061_00 WEBMAF000DEFAULT
Windows : ./genidx.exe EP9009-CUSA00061_00 WEBMAF000DEFAULT
The application will put out an .idx following the naming for debug idx files.
Code:
Example : fakeEP9009-CUSA00061_00.idx
Here is the documented file format of IDX files.
PS4 IDX Generator v0.1 and GenIDX Tool Tutorial by CrazyVoid.png

More information on the use of these files will be released in the future. RIF and IDX files are going to be an important part to Game Backups and Homebrew. Enjoy scene! Much Love <3 CrazyVoid 2017!
 

Comments

Big THANKS for sharing this @CrazyVoid, and from speaking to him on Discord this is just a brief guide on how to use the tool to get things started.

Along with RIF Files like this, the resulting IDX files are the other important requirement for what most are seeking to do. :D

Keep in mind once all this gets out Sony is going to be on a warpath far greater than they are now with the recent leaks, so everything will come as PS4 devs continue working discreetly behind the scenes. :ninja:
 
Big THANKS for sharing this @CrazyVoid, and from speaking to him on Discord this is just a brief guide on how to use the tool to get things started.

Along with RIF Files like this, the resulting IDX files are the other important requirement for what most are seeking to do. :D

Keep in mind once all this gets out Sony is going to be on a warpath far greater than they are now with the recent leaks, so everything will come as PS4 devs continue working discreetly behind the scenes. :ninja:
I don't know if i read this right but did you just say if this gets to sony it will set them on a warpath... MF you just put this on the damn home page....
 
I don't know if i read this right but did you just say if this gets to sony it will set them on a warpath... MF you just put this on the damn home page....
This refers to the end of the means (game backups and homebrew on PS4), not the means to the end (a guide on how to use a tool).

These are all small steps leading towards that goal, but due to the fear of Sony's wrath PS4 devs are handling things in a smarter way to both protect themselves and get information out to the community at the same time... in bits and pieces.

By the time everything is in place it will be too late for Sony to do much about, as the information will already be all over the Internet versus one person releasing a way to play PS4 backups and homebrew on their own that can be easily targeted by Sony the way they did GeoHot in the PS3 days.
 
Status
Not open for further replies.
Back
Top