Talk:PRX File Format

From PSP Developer wiki
Revision as of 15:33, 27 June 2021 by Anonymous (Privacy policy) (Created page with "From UOFW loadelf.h : <pre> typedef struct { →‎PSP Header magic: u8 magic[4]; //0 →‎The module's attributes. One or more of ::SceModulePrivilegeLevel.: ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

From UOFW loadelf.h :

typedef struct {
    /* PSP Header magic */
    u8 magic[4]; //0
    /* The module's attributes. One or more of ::SceModulePrivilegeLevel. */
    u16 modAttribute; //4
    /* The Compression attributes of the module. One of ::SceExecFileAttr. */
    u16 compAttribute; //6
    /* The minor module version. */
    u8 moduleVerLo; //8
    /* The major module version. */
    u8 moduleVerHi; //9
    /* The module's name. */
    s8 modName[SCE_MODULE_NAME_LEN + 1]; //10
    /* Module version. */
    u8 modVersion; //38
    /* The number of segment the module consists of. */
    u8 nSegments; //39
    /* The size of the uncompressed and decrypted module. */
    u32 elfSize; //40
    /* The size of the compressed/encrypted module. */
    u32 pspSize; //44
    /* The entry address of the module. It is the offset from the start of the TEXT segment to the program's entry point. */
    u32 bootEntry; //48
    /* The offset from the start address of the TEXT segment to the SceModuleInfo section. */
    u32 modInfoOffset; //52
    /* The size of the BSS segment. */
    u32 bssSize; //56
    /* An array containing the alignment information of each segment. */
    u16 segAlign[SCE_KERNEL_MAX_MODULE_SEGMENT]; //60
    /* An array containing the start address of each segment. */
    u32 segAddress[SCE_KERNEL_MAX_MODULE_SEGMENT]; //68
    /* An array containing the size of each segment. */
    u32 segSize[SCE_KERNEL_MAX_MODULE_SEGMENT]; //84
    /* Reserved. */
    u32 reserved[5]; //100
    /* The development kit version the module was compiled with. */
    u32 devkitVersion; //120
    /* The decryption mode. One of ::SceExecFileDecryptMode. */
    u8 decryptMode; //124
    /* Reserved. */
    u8 padding; //125
    /* The overlap size. */
    u16 overlapSize; //126
    /* The AES key data. */
    u8 aesKey[AES_KEY_SIZE]; //128
    /* THE CMAC key data. */
    u8 cmacKey[CMAC_KEY_SIZE]; //144
    /* The CMAC header hash. */
    u8 cmacHeaderHash[CMAC_HEADER_HASH_SIZE]; //160
    /* The size of the compressed ELF. */
    u32 compSize; //176
    /* Unknown. */
    u32 unk180; //180
    /* Unknown. */
    u32 unk184; //184
    /* Unknown. */
    u32 unk188; //188
    /* The CMAC Data hash. */
    u8 cmacDataHash[CMAC_DATA_HASH_SIZE]; //192
    /* Tag value. */
    u32 tag; //208
    /* Check. */
    u8 sCheck[CHECK_SIZE]; //212
    /* The SHA-1 hash. */
    u8 sha1Hash[SHA1_HASH_SIZE]; //300
    /* Key data. */
    u8 keyData4[KEY_DATA_SIZE]; //320
} PspHeader; //size == 336