forked from bucanero/apollo-ps4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
131 changed files
with
25,614 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Package metadata. | ||
TITLE := Apollo Save Tool | ||
VERSION := 1.00 | ||
TITLE_ID := BREW00080 | ||
CONTENT_ID := IV0000-BREW00080_00-AUDIOWAVEX000000 | ||
|
||
# Libraries linked into the ELF. | ||
LIBS := -lc -lkernel -lc++ -lSceAudioOut -lSceUserService -lorbis2d -lSceVideoOut -lSceGnmDriver -lSceSysmodule -lSceFreeType -lScePad -ldbglogger -lpolarssl -lz | ||
|
||
# Additional compile flags. | ||
EXTRAFLAGS := -DAPOLLO_ENABLE_LOGGING | ||
|
||
# Asset and module directories. | ||
ASSETS := $(wildcard assets/**/*) | ||
LIBMODULES := $(wildcard sce_module/*) | ||
|
||
# You likely won't need to touch anything below this point. | ||
|
||
# Root vars | ||
TOOLCHAIN := $(OO_PS4_TOOLCHAIN) | ||
#PROJDIR := $(shell basename $(CURDIR)) | ||
PROJDIR := source | ||
COMMONDIR := $(TOOLCHAIN)/samples/_common | ||
#INTDIR := $(PROJDIR)/x64/Debug | ||
INTDIR := build/x64/Debug | ||
|
||
# Define objects to build | ||
CFILES := $(wildcard $(PROJDIR)/*.c) | ||
CPPFILES := $(wildcard $(PROJDIR)/*.cpp) | ||
COMMONFILES := $(wildcard $(COMMONDIR)/*.cpp) | ||
OBJS := $(patsubst $(PROJDIR)/%.c, $(INTDIR)/%.o, $(CFILES)) $(patsubst $(PROJDIR)/%.cpp, $(INTDIR)/%.o, $(CPPFILES)) | ||
|
||
# Define final C/C++ flags | ||
CFLAGS := -cc1 -triple x86_64-pc-freebsd-elf -munwind-tables -fuse-init-array -debug-info-kind=limited -debugger-tuning=gdb -emit-obj $(EXTRAFLAGS) -isysroot $(TOOLCHAIN) -isystem $(TOOLCHAIN)/include -Iinclude | ||
CXXFLAGS := $(CFLAGS) -isystem $(TOOLCHAIN)/include/c++/v1 | ||
LDFLAGS := -m elf_x86_64 -pie --script $(TOOLCHAIN)/link.x --eh-frame-hdr -L$(TOOLCHAIN)/lib $(LIBS) $(TOOLCHAIN)/lib/crt1.o | ||
|
||
# Create the intermediate directory incase it doesn't already exist. | ||
_unused := $(shell mkdir -p $(INTDIR)) | ||
|
||
# Check for linux vs macOS and account for clang/ld path | ||
UNAME_S := $(shell uname -s) | ||
|
||
ifeq ($(UNAME_S),Linux) | ||
CC := clang | ||
CCX := clang++ | ||
LD := ld.lld | ||
CDIR := linux | ||
endif | ||
ifeq ($(UNAME_S),Darwin) | ||
CC := /usr/local/opt/llvm/bin/clang | ||
CCX := /usr/local/opt/llvm/bin/clang++ | ||
LD := /usr/local/opt/llvm/bin/ld.lld | ||
CDIR := macos | ||
endif | ||
|
||
all: $(CONTENT_ID).pkg | ||
|
||
$(CONTENT_ID).pkg: pkg.gp4 | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core pkg_build $< . | ||
|
||
pkg.gp4: eboot.bin sce_sys/about/right.sprx sce_sys/param.sfo sce_sys/icon0.png $(LIBMODULES) $(ASSETS) | ||
$(TOOLCHAIN)/bin/$(CDIR)/create-gp4 -out $@ --content-id=$(CONTENT_ID) --files "$^" | ||
|
||
sce_sys/param.sfo: Makefile | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_new $@ | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ APP_TYPE --type Integer --maxsize 4 --value 1 | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ APP_VER --type Utf8 --maxsize 8 --value '$(VERSION)' | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ ATTRIBUTE --type Integer --maxsize 4 --value 0 | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ CATEGORY --type Utf8 --maxsize 4 --value 'gd' | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ CONTENT_ID --type Utf8 --maxsize 48 --value '$(CONTENT_ID)' | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ DOWNLOAD_DATA_SIZE --type Integer --maxsize 4 --value 0 | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ SYSTEM_VER --type Integer --maxsize 4 --value 0 | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ TITLE --type Utf8 --maxsize 128 --value '$(TITLE)' | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ TITLE_ID --type Utf8 --maxsize 12 --value '$(TITLE_ID)' | ||
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ VERSION --type Utf8 --maxsize 8 --value '$(VERSION)' | ||
|
||
eboot.bin: $(INTDIR) $(OBJS) | ||
$(LD) $(INTDIR)/*.o -o $(INTDIR)/$(PROJDIR).elf $(LDFLAGS) | ||
$(TOOLCHAIN)/bin/$(CDIR)/create-eboot -in=$(INTDIR)/$(PROJDIR).elf -out=$(INTDIR)/$(PROJDIR).oelf --paid 0x3800000000000011 | ||
|
||
$(INTDIR)/%.o: $(PROJDIR)/%.c | ||
$(CC) $(CFLAGS) -o $@ $< | ||
|
||
$(INTDIR)/%.o: $(PROJDIR)/%.cpp | ||
$(CCX) $(CXXFLAGS) -o $@ $< | ||
|
||
clean: | ||
rm -f $(CONTENT_ID).pkg pkg.gp4 pkg/sce_sys/param.sfo eboot.bin \ | ||
$(INTDIR)/$(PROJDIR).elf $(INTDIR)/$(PROJDIR).oelf $(OBJS) |
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#ifndef _PFD__BACKEND_H_ | ||
#define _PFD__BACKEND_H_ | ||
|
||
#include "types.h" | ||
#include "list.h" | ||
#include "pfd.h" | ||
|
||
#define PFDTOOL_VERSION_BASE "0.2.3" | ||
#define PFDTOOL_VERSION PFDTOOL_VERSION_BASE | ||
|
||
#define PFDTOOL_CONFIG_GLOBAL "global.conf" | ||
#define PFDTOOL_CONFIG_GAMES "games.conf" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define BACKEND_UPDATE_FLAG_NONE (0) | ||
#define BACKEND_UPDATE_FLAG_PARTIAL (1U << 0) | ||
|
||
#define BACKEND_VALIDATE_FLAG_NONE (0) | ||
#define BACKEND_VALIDATE_FLAG_PARTIAL (1U << 0) | ||
|
||
typedef struct secure_file_id_s { | ||
char file_path[MAX_PATH]; | ||
char file_name[PFD_ENTRY_NAME_SIZE]; | ||
u8 secure_file_id[PFD_PARAM_SFO_KEY_SIZE]; | ||
u8 real_hash[PFD_HASH_SIZE]; | ||
u8 *data; | ||
u64 data_size; | ||
int found; | ||
} secure_file_id_t; | ||
|
||
typedef struct structure_status_s { | ||
int top; | ||
int bottom; | ||
} structure_status_t; | ||
|
||
typedef struct entry_status_s { | ||
int signature; | ||
} entry_status_t; | ||
|
||
typedef struct file_status_s { | ||
char *file_name; | ||
int file; | ||
int cid; | ||
int dhk_cid2; | ||
int aid_uid; | ||
} file_status_t; | ||
|
||
typedef struct entry_info_s { | ||
u64 index; | ||
char *file_name; | ||
u64 file_size; | ||
} entry_info_t; | ||
|
||
typedef struct backend_s { | ||
pfd_config_t *config; | ||
list_t *secure_file_ids; | ||
pfd_context_t *pfd; | ||
|
||
union { | ||
struct { | ||
list_t *entries; | ||
} list; | ||
struct { | ||
structure_status_t structure; | ||
entry_status_t *entries; | ||
file_status_t *files; | ||
} validate; | ||
} storage; | ||
} backend_t; | ||
|
||
backend_t * backend_initialize(pfd_config_t *config, list_t *secure_file_ids, const char *directory_path); | ||
int backend_shutdown(backend_t *ctx); | ||
|
||
int backend_cmd_list(backend_t *ctx); | ||
int backend_cmd_check(backend_t *ctx, u32 options); | ||
int backend_cmd_update(backend_t *ctx, u32 options); | ||
int backend_cmd_encrypt(backend_t *ctx, list_t *file_names); | ||
int backend_cmd_decrypt(backend_t *ctx, list_t *file_names); | ||
int backend_cmd_brute(backend_t *ctx, const char *file_path, u64 file_offset, s64 advance_offset, list_t *secure_file_ids); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* !_PFD__BACKEND_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef _COMMON_H_ | ||
#define _COMMON_H_ | ||
|
||
#define SUCCESS 0 | ||
#define FAILED -1 | ||
|
||
//---------------------------------------- | ||
//String Utils | ||
//---------------------------------------- | ||
int is_char_integer(char c); | ||
int is_char_letter(char c); | ||
|
||
//---------------------------------------- | ||
//FILE UTILS | ||
//---------------------------------------- | ||
|
||
int file_exists(const char *path); | ||
int dir_exists(const char *path); | ||
int unlink_secure(const char *path); | ||
int mkdirs(const char* dir); | ||
int copy_file(const char* input, const char* output); | ||
int copy_directory(const char* startdir, const char* inputdir, const char* outputdir); | ||
int clean_directory(const char* inputdir); | ||
|
||
//---------------------------------------- | ||
//CONSOLE ID UTILS | ||
//---------------------------------------- | ||
|
||
int ss_aim_get_device_id(uint8_t *idps); | ||
int ss_aim_get_open_psid(uint8_t *psid); | ||
int sys_ss_get_open_psid(uint64_t psid[2]); | ||
int is_ps3hen(void); | ||
|
||
//---------------------------------------- | ||
//POWER UTILS | ||
//---------------------------------------- | ||
|
||
int sys_shutdown(); | ||
int sys_reboot(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef _CONFIG_H_ | ||
#define _CONFIG_H_ | ||
|
||
#include "types.h" | ||
|
||
int parse_config_file(const char *file_path, int (*handler)(void *, const char *, const char *, const char *), void *user); | ||
|
||
#endif /* !_CONFIG_H_ */ |
Oops, something went wrong.