Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

patchlayout

Alexander Hartmann edited this page Sep 21, 2015 · 12 revisions

##Version 0

Not final

used types:

typedef struct patchStruct
{
    u32    version;              //0 for development, 1 after first release
    u32   patchSize;
    u32   patchNameSize;
    u32   descriptionSize;
    u32   processNameSize;
    u32   originalcodeSize;
    u32   patchcodeSize;
    u32   processType;          //ARM9 = 0, ARM11 = 1
    kernelVersion       minKernelVersion;
    kernelVersion       maxKernelVersion;
    firmwareVersion     minFirmwareVersion;
    firmwareVersion     maxFirmwareVersion;
    devices devicesSupported;
    regions regionsSupported;
    nands   nandCompability;
    u32     patchType;
    u32     startAddressProcess;
    u32     startAddressGlobal;
    u32     searchAreaSize;     //0 overwrite all apearences
    u32     patchOffset;        //strings offset between each character, code offset wer to patch based on originalcode  
    u32     numberOfReplacements;
    char binaryData[];
} binPatch;

searchAreaSize

  • 0 -> overwrite all apearences

patchType

  • 0 -> findAndReplaceCode
  • 1 -> replaceCodeAt
  • 2 -> usePointerAndReplaceCode
  • 3 -> findAndReplaceString
  • 4 -> replaceStringAt
  • 5 -> usePointerAndReplaceString

patchOffset

  • strings -> offset between each character
  • code -> offset where to patch based on the target address

processType

  • 0 -> ARM9
  • 1 -> ARM11

binaryData

The binary data include the following informations in this order:

  • patch name
  • patch description
  • processname
  • originalCode or originalString
  • patchCode or patchString
Clone this wiki locally