Skip to content

Commit

Permalink
Merge branch 'main' into cecie-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero authored Nov 10, 2024
2 parents 73f8564 + eaf27d1 commit cd7da76
Show file tree
Hide file tree
Showing 14 changed files with 1,773 additions and 49 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ All notable changes to the `apollo-ps4` project will be documented in this file.

## [Unreleased]()

---

## [v1.6.0](https://github.com/bucanero/apollo-ps4/releases/tag/v1.6.0) - 2024-11-02

### Added

* 7.0x/8.0x/8.5x/9.0x/9.5x/10.50/10.7x firmware support (thanks to @BestPig)
- GoldHEN or ps4debug payload is required
* Manage PS2 Virtual Memory Card images (VMC)
- Supports PS2 MemCard images, ECC and non-ECC (`.PS2`, `.VM2`, `.CARD`, `.VMC`)
- List, import, export, and delete PS2 saves inside VMC images
- Import - Supported formats: `.PSU`, `.PSV`, `.XPS`, `.MAX`, `.CBS`, `.SPS`
- Export - Supported formats: `.PSU`, `.PSV`
* Online DB: added PS2 saves listing
* Save sorting option by Type (PS4/PS2/VMC)
* Add Debug Log option in Settings (on/off)

### Misc

* Updated Apollo Patch Engine to v1.1.0
- Improve code parsing
- Improve SW Code Type 3 (Subtype 3/7/B/F)
- Improve SW Code Type 4 (Subtype 4/5/6/C/D/E)
- Add AES CBC encryption command (`aes_cbc(key, iv)`)

---

## [v1.4.5](https://github.com/bucanero/apollo-ps4/releases/tag/v1.4.5) - 2024-06-29

### Added
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package metadata.
TITLE := Apollo Save Tool
VERSION := 01.60
VERSION := 01.70
TITLE_ID := APOL00004
CONTENT_ID := IV0000-APOL00004_00-APOLLO0000000PS4

Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ This homebrew app allows you to download, unlock, patch, and resign save-game fi
* **Account activation:** create fake Account IDs and generate offline PS4 activations
* **Recover passcode:** simple recovery method for the Parental Security Passcode.

## PS1 Virtual Memory Card Management

* **VMC saves management:** quick access to all save files on Virtual Memory Cards images.
- Supported PS1 VMC formats: `.VMP`, `.MCR`, `.VM1`, `.BIN`, `.VMC`, `.GME`, `.VGS`, `.SRM`, `.MCD`
* **Import PS1 saves:** import saves to VMCs from other systems and consoles (`.MCS`, `.PSV`, `.PSX`, `.PS1`, `.MCB`, `.PDA` supported).
* **Export PS1 saves:** allows the user export saves on VMC images to `.MCS`/`.PSV`/`.PSX` formats.

## PS2 Virtual Memory Card Management

* **VMC saves management:** quick access to all save files on Virtual Memory Cards images.
- Supported PS2 VMC formats: `.VM2`, `.CARD`, `.PS2`, `.VMC`, `.BIN`
- Supports ECC and non-ECC images
* **Import PS2 saves:** import saves to VMCs from other systems and consoles (`.PSU`, `.PSV`, `.XPS`, `.CBS`, `.MAX`, `.SPS` supported).
* **Export PS2 saves:** allows the user export saves on VMC images to `.PSU` and `.PSV` formats

# Download

Get the [latest version here][app_latest].
Expand Down Expand Up @@ -88,6 +103,17 @@ On first run, the application will detect and setup the required user settings.
| **External saves (HDD)** | encrypted saves must be placed on `/data/fakeusb/PS4/SAVEDATA/<account-id>/`. |
| **HDD saves** | files will be scanned from the hard disk, based on the current `User ID`. |

### PS2

| PS2 | Folder |
|-----|--------|
| **USB saves** | `/mnt/usbX/PS2/SAVEDATA/` (`*.xps`, `*.max`, `*.psu`, `*.cbs`, `*.psv`, `*.sps`) |
| **VMC cards** | `/mnt/usbX/PS2/VMC/` (`*.vmc`, `*.card`, `*.vm2`, `*.ps2`, `*.bin`) |
| **PSV saves** | `/mnt/usbX/PS3/EXPORT/PSV/` |
| **External saves (HDD)** | `/data/fakeusb/PS2/SAVEDATA/` |
| **External VMCs (HDD)** | `/data/fakeusb/PS2/VMC/` |
| **HDD VMC cards** | VMCs will be scanned from PS4 saves on the hard disk |

## Offline Account activation

To activate an account offline, go to the `User Tools` menu, and select `Activate PS4 Accounts`.
Expand Down Expand Up @@ -134,6 +160,8 @@ Currently, the list of available games and files is limited, but the project aim
* [Berion](https://www.psx-place.com/members/berion.1431/): GUI design
* [flatz](https://github.com/flatz): [SFO tools](https://github.com/bucanero/pfd_sfo_tools/)
* [aldostools](https://aldostools.org/): [Bruteforce Save Data](https://bruteforcesavedata.forumms.net/)
* [jimmikaelkael](https://github.com/jimmikaelkael): ps3mca tool
* [ShendoXT](https://github.com/ShendoXT): [MemcardRex](https://github.com/ShendoXT/memcardrex)
* [Nobody/Wild Light](https://github.com/nobodo): [Background music track](https://github.com/bucanero/apollo-vita/blob/main/data/haiku.s3m)

# Building
Expand Down
52 changes: 51 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,36 @@ This homebrew app allows you to download, unlock, patch, and resign save-game fi
* **Account activation:** create fake Account IDs and generate offline PS4 activations
* **Recover passcode:** simple recovery method for the Parental Security Passcode.

## PS1 Virtual Memory Card Management

* **VMC saves management:** quick access to all save files on Virtual Memory Cards images.
- Supported PS1 VMC formats: `.VMP`, `.MCR`, `.VM1`, `.BIN`, `.VMC`, `.GME`, `.VGS`, `.SRM`, `.MCD`
* **Import PS1 saves:** import saves to VMCs from other systems and consoles (`.MCS`, `.PSV`, `.PSX`, `.PS1`, `.MCB`, `.PDA` supported).
* **Export PS1 saves:** allows the user export saves on VMC images to `.MCS`/`.PSV`/`.PSX` formats.

## PS2 Virtual Memory Card Management

* **VMC saves management:** quick access to all save files on Virtual Memory Cards images.
- Supported PS2 VMC formats: `.VM2`, `.CARD`, `.PS2`, `.VMC`, `.BIN`
- Supports ECC and non-ECC images
* **Import PS2 saves:** import saves to VMCs from other systems and consoles (`.PSU`, `.PSV`, `.XPS`, `.CBS`, `.MAX`, `.SPS` supported).
* **Export PS2 saves:** allows the user export saves on VMC images to `.PSU` and `.PSV` formats

# Download

Get the [latest version here][app_latest].

<details>
<summary>Nightly Builds (Click to Expand)</summary>

- Login to GitHub [(this is required to download artifacts)](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts#:~:text=Who%20can%20use,download%20workflow%20artifacts.).
- Click on a build in the **[Actions](https://github.com/bucanero/apollo-ps4/actions)** Tab.
- ![image](https://github.com/bucanero/apollo-ps4/assets/37698908/2e52961b-04ef-42f1-9453-78b3ceb24afc)
- Click on the artifact to download the pkg zip.
- ![image](https://github.com/bucanero/apollo-ps4/assets/37698908/aaeb523e-eab9-43f7-a993-5fa902ada1b7)

</details>

## Changelog

See the [latest changes here](CHANGELOG.md).
Expand All @@ -72,6 +98,28 @@ On first run, the application will detect and setup the required user settings.
| **External saves (HDD)** | encrypted saves must be placed on `/data/fakeusb/PS4/SAVEDATA/<account-id>/`. |
| **HDD saves** | files will be scanned from the hard disk, based on the current `User ID`. |

### PS2

| PS2 | Folder |
|-----|--------|
| **USB saves** | `/mnt/usbX/PS2/SAVEDATA/` (`*.xps`, `*.max`, `*.psu`, `*.cbs`, `*.psv`, `*.sps`) |
| **VMC cards** | `/mnt/usbX/PS2/VMC/` (`*.vmc`, `*.card`, `*.vm2`, `*.ps2`, `*.bin`) |
| **PSV saves** | `/mnt/usbX/PS3/EXPORT/PSV/` |
| **External saves (HDD)** | `/data/fakeusb/PS2/SAVEDATA/` |
| **External VMCs (HDD)** | `/data/fakeusb/PS2/VMC/` |
| **HDD VMC cards** | VMCs will be scanned from PS4 saves on the hard disk |

### PS1

| PS1 | Folder |
|-----|--------|
| **USB saves** | `/mnt/usbX/PS1/SAVEDATA/` (`*.mcs`, `*.psx`, `*.ps1`, `*.mcb`, `*.psv`, `*.pda`) |
| **VMC cards** | `/mnt/usbX/PS1/VMC/` (`*.vmc`, `*.mcd`, `*.mcr`, `*.gme`, `*.vm1`, `*.vmp`, `*.vgs`, `*.srm`, `*.bin`) |
| **PSV saves** | `/mnt/usbX/PS3/EXPORT/PSV/` |
| **External saves (HDD)** | `/data/fakeusb/PS1/SAVEDATA/` |
| **External VMCs (HDD)** | `/data/fakeusb/PS1/VMC/` |
| **HDD VMC cards** | VMCs will be scanned from PS4 saves on the hard disk |

## Offline Account activation

To activate an account offline, go to the `User Tools` menu, and select `Activate PS4 Accounts`.
Expand All @@ -80,7 +128,7 @@ This default account value can be edited using the on-screen keyboard.

# Usage

Using the application is simple and straight-forward:
Using the application is simple and straight-forward:

- Move <kbd>UP</kbd>/<kbd>DOWN</kbd> to select the save-game file you want to patch, and press ![X button](https://github.com/bucanero/pkgi-ps3/raw/master/data/CROSS.png). The patch screen will show the available fixes for the file. Select the patches and click `Apply`.
- To view the item's details, press ![Triangle](https://github.com/bucanero/pkgi-ps3/raw/master/data/TRIANGLE.png).
Expand Down Expand Up @@ -118,6 +166,8 @@ Currently, the list of available games and files is limited, but the project aim
* [Berion](https://www.psx-place.com/members/berion.1431/): GUI design
* [flatz](https://github.com/flatz): [SFO tools](https://github.com/bucanero/pfd_sfo_tools/)
* [aldostools](https://aldostools.org/): [Bruteforce Save Data](https://bruteforcesavedata.forumms.net/)
* [jimmikaelkael](https://github.com/jimmikaelkael): ps3mca tool
* [ShendoXT](https://github.com/ShendoXT): [MemcardRex](https://github.com/ShendoXT/memcardrex)
* [Nobody/Wild Light](https://github.com/nobodo): [Background music track](https://github.com/bucanero/apollo-vita/blob/main/data/haiku.s3m)

# Building
Expand Down
92 changes: 92 additions & 0 deletions include/ps1card.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#include <inttypes.h>

#define PS1CARD_MAX_SLOTS 15
#define PS1CARD_HEADER_SIZE 128
#define PS1CARD_BLOCK_SIZE 8192
#define PS1CARD_SIZE 131072

enum ps1card_type
{
PS1CARD_NULL,
PS1CARD_RAW,
PS1CARD_GME,
PS1CARD_VGS,
PS1CARD_VMP,
PS1CARD_MCX,
};

enum ps1save_type
{
PS1SAVE_NULL,
PS1SAVE_AR,
PS1SAVE_MCS,
PS1SAVE_RAW,
PS1SAVE_PSV,
};

enum ps1block_type
{
PS1BLOCK_FORMATTED,
PS1BLOCK_INITIAL,
PS1BLOCK_MIDDLELINK,
PS1BLOCK_ENDLINK,
PS1BLOCK_DELETED_INITIAL,
PS1BLOCK_DELETED_MIDDLELINK,
PS1BLOCK_DELETED_ENDLINK,
PS1BLOCK_CORRUPTED,
};

typedef struct ps1McData
{
uint8_t* headerData; //Memory Card header data (128 bytes each)
uint8_t* saveData; //Memory Card save data (8192 bytes each)
uint32_t iconPalette[16]; //Memory Card icon palette data
uint8_t iconData[3][256]; //Memory Card icon data, 3 icons per slot, (16*16px icons)
uint8_t iconFrames; //Number of icon frames
uint8_t saveType; //Type of the save (0 - formatted, 1 - initial, 2 - middle link, 3 - end link, 4 - deleted initial, 5 - deleted middle link, 6 - deleted end link, 7 - corrupted)
uint16_t saveRegion; //Region of the save (16 bit value, ASCII representation: BA - America, BE - Europe, BI - Japan)
char saveProdCode[11]; //Product code of the save
char saveIdentifier[9]; //Identifier string of the save
int saveSize; //Size of the save in Bytes
char saveName[21]; //Name of the save
char saveTitle[65]; //Title of the save data (in Shift-JIS format)
} ps1mcData_t;

//Open Memory Card from the given filename (return error message if operation is not sucessful)
int openMemoryCard(const char* fileName, int fixData);

//Open memory card from the given byte stream
int openMemoryCardStream(const uint8_t* memCardData, int dataSize, int fixData);

//Save (export) Memory Card to a given byte stream
uint8_t* saveMemoryCardStream(int fixData);

//Save Memory Card to the given filename
int saveMemoryCard(const char* fileName, int memoryCardType, int fixData);

//Format a complete Memory Card
void formatMemoryCard(void);

//Import single save to the Memory Card
int openSingleSave(const char* fileName, int* requiredSlots);

//Save single save to the given filename
int saveSingleSave(const char* fileName, int slotNumber, int singleSaveType);

//Get icon data as bytes
uint8_t* getIconRGBA(int slotNumber, int frame);

//Set icon data to saveData
void setIconBytes(int slotNumber, uint8_t* iconBytes);

//Return all bytes of the specified save
uint8_t* getSaveBytes(int slotNumber, uint32_t* saveLen);

//Toggle deleted/undeleted status
void toggleDeleteSave(int slotNumber);

//Format save
int formatSave(int slotNumber);

//Get Memory Card data
ps1mcData_t* getMemoryCardData(void);
24 changes: 17 additions & 7 deletions include/saves.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
#define PS2_SAVES_PATH_HDD "ps2emu2_savedata/"
#define PSP_SAVES_PATH_HDD "minis_savedata/"

#define PS1_IMP_PATH_USB "PS1/SAVEDATA/"
#define PS2_IMP_PATH_USB "PS2/SAVEDATA/"

#define SAVES_PATH_USB0 USB0_PATH PS4_SAVES_PATH_USB
#define SAVES_PATH_USB1 USB1_PATH PS4_SAVES_PATH_USB

Expand All @@ -54,7 +51,7 @@
#define EXP_PSV_PATH_USB1 USB1_PATH PSV_SAVES_PATH_USB

#define VMC_PS2_PATH_USB "PS2/VMC/"
#define VMC_PS2_PATH_HDD "/dev_hdd0/savedata/vmc/"
#define VMC_PS1_PATH_USB "PS1/VMC/"

#define IMP_PS2VMC_PATH_USB USB_PATH "PS2/VMC/"
#define IMPORT_RAP_PATH_USB USB_PATH PS3_LICENSE_PATH
Expand Down Expand Up @@ -115,8 +112,11 @@ enum cmd_code_enum
// Export commands
CMD_EXP_KEYSTONE,
CMD_EXP_PS2_VM2,
CMD_EXP_PS2_RAW,
CMD_EXP_VMC2SAVE,
CMD_EXP_VM2_RAW,
CMD_EXP_VMC1SAVE,
CMD_EXP_PS1_VMP,
CMD_EXP_PS1_VM1,
CMD_EXP_DATABASE,
CMD_DB_REBUILD,
CMD_DB_DEL_FIX,
Expand All @@ -126,6 +126,7 @@ enum cmd_code_enum
CMD_IMP_KEYSTONE,
CMD_IMP_DATABASE,
CMD_IMP_VMC2SAVE,
CMD_IMP_VMC1SAVE,
CMD_CREATE_ACT_DAT,
CMD_EXTRACT_ARCHIVE,
CMD_URL_DOWNLOAD,
Expand Down Expand Up @@ -159,11 +160,15 @@ enum save_type_enum
FILE_TYPE_NULL,
FILE_TYPE_MENU,
FILE_TYPE_PS4,
FILE_TYPE_PSV,
FILE_TYPE_TRP,
FILE_TYPE_VMC,

// PS1 File Types
FILE_TYPE_PS1,
FILE_TYPE_PSX,
FILE_TYPE_MCS,

// Misc
FILE_TYPE_ZIP,
FILE_TYPE_SQL,
FILE_TYPE_NET,
Expand All @@ -179,7 +184,7 @@ enum save_type_enum
FILE_TYPE_MAX,
FILE_TYPE_CBS,
FILE_TYPE_XPS,
FILE_TYPE_VM2,
FILE_TYPE_PSV,
};

enum char_flag_enum
Expand Down Expand Up @@ -259,6 +264,7 @@ list_t * ReadUserList(const char* userPath);
list_t * ReadOnlineList(const char* urlPath);
list_t * ReadBackupList(const char* userPath);
list_t * ReadTrophyList(const char* userPath);
list_t * ReadVmc1List(const char* userPath);
list_t * ReadVmc2List(const char* userPath);
void UnloadGameList(list_t * list);
char * readTextFile(const char * path, long* size);
Expand All @@ -270,6 +276,7 @@ int ReadCodes(save_entry_t * save);
int ReadTrophies(save_entry_t * game);
int ReadOnlineSaves(save_entry_t * game);
int ReadBackupCodes(save_entry_t * bup);
int ReadVmc1Codes(save_entry_t * save);
int ReadVmc2Codes(save_entry_t * save);

int http_init(void);
Expand Down Expand Up @@ -319,5 +326,8 @@ int ps2_xps2psv(const char *save, const char *psv_path);
int ps2_cbs2psv(const char *save, const char *psv_path);
int ps2_max2psv(const char *save, const char *psv_path);

int psv_resign(const char *src_psv);
int vmp_resign(const char *src_vmp);

char* sjis2utf8(char* input);
uint8_t* getIconPS2(const char* folder, const char* iconfile);
3 changes: 2 additions & 1 deletion include/settings.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define APOLLO_VERSION "1.6.0" //Apollo PS4 version (about menu)
#define APOLLO_VERSION "1.7.0" //Apollo PS4 version (about menu)

#define MENU_TITLE_OFF 45 //Offset of menu title text from menu mini icon
#define MENU_ICON_OFF 105 //X Offset to start printing menu mini icon
Expand Down Expand Up @@ -33,6 +33,7 @@ typedef struct
uint8_t doAni;
uint8_t update;
uint8_t usb_dev;
uint8_t dbglog;
uint32_t user_id;
uint64_t psid[2];
uint64_t account_id;
Expand Down
Loading

0 comments on commit cd7da76

Please sign in to comment.