Skip to content

Commit

Permalink
arcade header (#11)
Browse files Browse the repository at this point in the history

Co-authored-by: AKuHAK <[email protected]>
  • Loading branch information
israpps and AKuHAK authored Dec 18, 2024
1 parent 45c2927 commit 0527704
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/kelf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ int Kelf::SaveKelf(const std::string &filename, int headerid)
USER_HEADER = USER_HEADER_DNASLOAD;
break;

case HEADER::ARCADE_BOOTFILE:
USER_HEADER = USER_HEADER_NAMCO_SECURITY_DONGLE_BOOTFILE;
break;

default:
USER_HEADER = USER_HEADER_FHDB;
break;
Expand Down
1 change: 1 addition & 0 deletions src/kelf.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum HEADER {
FHDB,
MBR,
DNASLOAD,
ARCADE_BOOTFILE,
};

static uint8_t USER_HEADER_FMCB[16] = {0x01, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x4A, 0x00, 0x01, 0x02, 0x19, 0x00, 0x00, 0x00, 0x56};
Expand Down
22 changes: 17 additions & 5 deletions src/kelftool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ int decrypt(int argc, char **argv)
std::string KeyStoreEntry = "default";

if (argc < 3) {
printf("%s decrypt <input> <output>\n", argv[0]);
printf("%s decrypt <input> <output> [Flags]\n", argv[0]);
printf("\tFlags:\n");
printf("\t\t--keys Specify keys to be used\n");
return -1;
}

Expand Down Expand Up @@ -85,8 +87,14 @@ int encrypt(int argc, char **argv)
int headerid = -1;

if (argc < 4) {
printf("%s encrypt <headerid> <input> <output>\n", argv[0]);
printf("<headerid>: fmcb, fhdb, mbr\n");
printf("%s encrypt <headerid> <input> <output> [Flags]\n", argv[0]);
printf("<headerid>: fmcb, fhdb, mbr dnasload dongle\n");
printf("\tFlags:\n");
printf("\t\t--keys Specify keys to be used\n");
printf("\t\t--mgzone Specify custom region whitelist\n");
printf("\t\t--apptype Specify application type \n");
printf("\t\t--kflags Specify custom flags for KELF Header\n");
printf("\t\t--systemtype Specify sys type (PS2 or PSX)\n");
return -1;
}

Expand Down Expand Up @@ -145,6 +153,9 @@ int encrypt(int argc, char **argv)
if (strcmp("dnasload", argv[1]) == 0)
headerid = HEADER::DNASLOAD;

if (strcmp("dongle", argv[1]) == 0)
headerid = HEADER::ARCADE_BOOTFILE;

if (headerid == HEADER::INVALID) {

printf("Invalid header: %s\n", argv[1]);
Expand Down Expand Up @@ -184,9 +195,10 @@ int main(int argc, char **argv)
printf("usage: %s <submodule> <args>\n", argv[0]);
printf("Available submodules:\n");
printf("\tdecrypt - decrypt and check signature of kelf files\n");
printf("\tencrypt <headerid> - encrypt and sign kelf files <headerid>: fmcb, fhdb, mbr\n");
printf("\tencrypt <headerid> - encrypt and sign kelf files <headerid>: fmcb, fhdb, mbr, dnasload, dongle\n");
printf("\t\tfmcb - for retail PS2 memory cards\n");
printf("\t\tdnasload - for retail PS2 memory cards (PSX bypass)\n");
printf("\t\tdnasload - for retail PS2 memory cardsfor retail PS2 memory cards (PSX bypass)\n");
printf("\t\tdongle - for arcade PS2 Security Dongle\n");
printf("\t\tfhdb - for retail PS2 HDD (HDD OSD / BB Navigator)\n");
printf("\t\tmbr - for retail PS2 HDD (mbr injection).\n");
printf("\t\t Note: for mbr elf should load from 0x100000 and should be without headers:\n");
Expand Down

0 comments on commit 0527704

Please sign in to comment.