├── .gitignore ├── meta.json ├── source └── main.c ├── CHANGELOG.md ├── README.md ├── .github └── workflows │ └── sanity-check.yml ├── Makefile └── .clang-format /.gitignore: -------------------------------------------------------------------------------- 1 | /*.bin 2 | /*.map 3 | /build 4 | -------------------------------------------------------------------------------- /meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Kernel Clock", 3 | "version": "1.0.0", 4 | "updated": "2021-01-01T00:00:00Z", 5 | "device": "PlayStation 4", 6 | "firmware": "", 7 | "description": { 8 | "default": "Changes the internal clock of the PS4, can be used to reactive licenses/features.", 9 | "en": "Changes the internal clock of the PS4, can be used to reactive licenses/features." 10 | }, 11 | "author": "", 12 | "url": "https://github.com/Scene-Collective/ps4-kernel-clock/", 13 | "redirect": false, 14 | "reload": false, 15 | "offline": true 16 | } 17 | -------------------------------------------------------------------------------- /source/main.c: -------------------------------------------------------------------------------- 1 | //#define DEBUG_SOCKET 2 | #define DEBUG_IP "192.168.2.2" 3 | #define DEBUG_PORT 9023 4 | 5 | #include "ps4.h" 6 | 7 | int _main(struct thread *td) { 8 | UNUSED(td); 9 | 10 | initKernel(); 11 | initLibc(); 12 | 13 | #ifdef DEBUG_SOCKET 14 | initNetwork(); 15 | DEBUG_SOCK = SckConnect(DEBUG_IP, DEBUG_PORT); 16 | #endif 17 | 18 | jailbreak(); 19 | kernel_clock(14861963); 20 | 21 | initSysUtil(); 22 | 23 | printf_notification("Kernel time changed!"); 24 | 25 | #ifdef DEBUG_SOCKET 26 | printf_debug("Closing socket...\n"); 27 | SckClose(DEBUG_SOCK); 28 | #endif 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Unreleased] 9 | 10 | ## [1.0.0] - 2021-01-01 11 | 12 | ### Added 13 | - Using the semantic versioning via `CHANGELOG.md` 14 | - `.gitignore` setup to ignore bin and map files as well as the build directory 15 | - Workflow file for pull requests for sanity testing 16 | 17 | ### Changed 18 | - Initial commit to support offloading all firmware specific offsets to the SDK 19 | 20 | ### Removed 21 | - Commit history. Starting versioning with a clean slate. 22 | 23 | [unreleased]: https://github.com/Scene-Collective/ps4-kernel-clock/compare/v1.0.0...HEAD 24 | [1.0.0]: https://github.com/Scene-Collective/ps4-kernel-clock/releases/tag/v1.0.0 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Kernel Clock 2 | === 3 | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/)](https://www.codacy.com/gh/Scene-Collective/ps4-kernel-clock/dashboard) 4 | 5 | ## Synopsis 6 | Changes the internal clock of the PS4, can be used to reactive licenses/features. 7 | 8 | For the payloads built with the most recent firmware supported visit [this repo]. 9 | 10 | ## Notes 11 | - Contribute translations for the decription in `meta.json` 12 | - Requires being built with the [Scene Collective Payload SDK] 13 | - Supports any firmware that the SDK supports 14 | - Originally created by [Zer0xFF] 15 | - **BEWARE:** Somewhere between 5.05 and 6.72 the function used changed, this payload will ONLY zero out the clock and will no reset it. This will cause the errors with trophy times, licenses etc. This would be as if you unplugged the CMOS battery. 16 | 17 | [//]: # 18 | [Scene Collective Payload SDK]: 19 | [this repo]: 20 | [Zer0xFF]: 21 | -------------------------------------------------------------------------------- /.github/workflows/sanity-check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Sanity Check" 3 | 4 | on: 5 | workflow_dispatch: 6 | push: 7 | branches: 8 | - main 9 | pull_request: 10 | branches: 11 | - main 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - 18 | name: "Checkout" 19 | uses: actions/checkout@v2 20 | - 21 | name: "Setup Environment" 22 | run: | 23 | git clone https://github.com/Scene-Collective/ps4-payload-sdk ~/ps4-payload-sdk && cd "$_" 24 | chmod +x install.sh 25 | sudo ./install.sh 26 | - 27 | name: "Build Payload" 28 | run: | 29 | export PS4SDK=/opt/ps4sdk 30 | make 31 | - 32 | name: "Upload Binary Artifact" 33 | uses: actions/upload-artifact@v2 34 | with: 35 | path: ./*.bin 36 | if-no-files-found: error 37 | - 38 | name: "Upload Map Artifact" 39 | uses: actions/upload-artifact@v2 40 | with: 41 | path: ./*.map 42 | if-no-files-found: error 43 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | LIBPS4 := $(PS4SDK)/libPS4 2 | 3 | CC := gcc 4 | OBJCOPY := objcopy 5 | ODIR := build 6 | SDIR := source 7 | IDIRS := -I$(LIBPS4)/include -Iinclude 8 | LDIRS := -L$(LIBPS4) 9 | MAPFILE := $(shell basename "$(CURDIR)").map 10 | CFLAGS := $(IDIRS) -Os -std=c11 -ffunction-sections -fdata-sections -fno-builtin -nostartfiles -nostdlib -Wall -Wextra -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=small -fpie -fPIC 11 | LFLAGS := $(LDIRS) -Xlinker -T $(LIBPS4)/linker.x -Xlinker -Map="$(MAPFILE)" -Wl,--build-id=none -Wl,--gc-sections 12 | CFILES := $(wildcard $(SDIR)/*.c) 13 | SFILES := $(wildcard $(SDIR)/*.s) 14 | OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES)) 15 | 16 | LIBS := -lPS4 17 | 18 | TARGET = $(shell basename "$(CURDIR)").bin 19 | 20 | $(TARGET): $(ODIR) $(OBJS) 21 | $(CC) $(LIBPS4)/crt0.s $(ODIR)/*.o -o temp.t $(CFLAGS) $(LFLAGS) $(LIBS) 22 | $(OBJCOPY) -O binary temp.t "$(TARGET)" 23 | rm -f temp.t 24 | 25 | $(ODIR)/%.o: $(SDIR)/%.c 26 | $(CC) -c -o $@ $< $(CFLAGS) 27 | 28 | $(ODIR)/%.o: $(SDIR)/%.s 29 | $(CC) -c -o $@ $< $(CFLAGS) 30 | 31 | $(ODIR): 32 | @mkdir $@ 33 | 34 | .PHONY: clean 35 | 36 | clean: 37 | rm -rf "$(TARGET)" "$(MAPFILE)" $(ODIR) 38 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: LLVM 4 | AccessModifierOffset: -2 5 | AlignAfterOpenBracket: Align 6 | AlignConsecutiveAssignments: false 7 | AlignConsecutiveDeclarations: false 8 | AlignEscapedNewlines: Right 9 | AlignOperands: true 10 | AlignTrailingComments: true 11 | AllowAllParametersOfDeclarationOnNextLine: true 12 | AllowShortBlocksOnASingleLine: false 13 | AllowShortCaseLabelsOnASingleLine: false 14 | AllowShortFunctionsOnASingleLine: All 15 | AllowShortIfStatementsOnASingleLine: false 16 | AllowShortLoopsOnASingleLine: false 17 | AlwaysBreakAfterDefinitionReturnType: None 18 | AlwaysBreakAfterReturnType: None 19 | AlwaysBreakBeforeMultilineStrings: false 20 | AlwaysBreakTemplateDeclarations: false 21 | BinPackArguments: true 22 | BinPackParameters: true 23 | BraceWrapping: 24 | AfterClass: false 25 | AfterControlStatement: false 26 | AfterEnum: false 27 | AfterFunction: false 28 | AfterNamespace: false 29 | AfterObjCDeclaration: false 30 | AfterStruct: false 31 | AfterUnion: false 32 | AfterExternBlock: false 33 | BeforeCatch: false 34 | BeforeElse: false 35 | IndentBraces: false 36 | SplitEmptyFunction: true 37 | SplitEmptyRecord: true 38 | SplitEmptyNamespace: true 39 | BreakBeforeBinaryOperators: None 40 | BreakBeforeBraces: Attach 41 | BreakBeforeInheritanceComma: false 42 | BreakBeforeTernaryOperators: true 43 | BreakConstructorInitializersBeforeComma: false 44 | BreakConstructorInitializers: BeforeColon 45 | BreakAfterJavaFieldAnnotations: false 46 | BreakStringLiterals: true 47 | ColumnLimit: 0 48 | CommentPragmas: '^ IWYU pragma:' 49 | CompactNamespaces: false 50 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 51 | ConstructorInitializerIndentWidth: 4 52 | ContinuationIndentWidth: 4 53 | Cpp11BracedListStyle: true 54 | DerivePointerAlignment: false 55 | DisableFormat: false 56 | ExperimentalAutoDetectBinPacking: false 57 | FixNamespaceComments: true 58 | ForEachMacros: 59 | - foreach 60 | - Q_FOREACH 61 | - BOOST_FOREACH 62 | IncludeBlocks: Preserve 63 | IncludeCategories: 64 | - Regex: '^"(llvm|llvm-c|clang|clang-c)/' 65 | Priority: 2 66 | - Regex: '^(<|"(gtest|gmock|isl|json)/)' 67 | Priority: 3 68 | - Regex: '.*' 69 | Priority: 1 70 | IncludeIsMainRegex: '(Test)?$' 71 | IndentCaseLabels: false 72 | IndentPPDirectives: None 73 | IndentWidth: 2 74 | IndentWrappedFunctionNames: false 75 | JavaScriptQuotes: Leave 76 | JavaScriptWrapImports: true 77 | KeepEmptyLinesAtTheStartOfBlocks: true 78 | MacroBlockBegin: '' 79 | MacroBlockEnd: '' 80 | MaxEmptyLinesToKeep: 1 81 | NamespaceIndentation: None 82 | ObjCBlockIndentWidth: 2 83 | ObjCSpaceAfterProperty: false 84 | ObjCSpaceBeforeProtocolList: true 85 | PenaltyBreakAssignment: 2 86 | PenaltyBreakBeforeFirstCallParameter: 19 87 | PenaltyBreakComment: 300 88 | PenaltyBreakFirstLessLess: 120 89 | PenaltyBreakString: 1000 90 | PenaltyExcessCharacter: 1000000 91 | PenaltyReturnTypeOnItsOwnLine: 60 92 | PointerAlignment: Right 93 | RawStringFormats: 94 | - Delimiter: pb 95 | Language: TextProto 96 | BasedOnStyle: google 97 | ReflowComments: true 98 | SortIncludes: true 99 | SortUsingDeclarations: true 100 | SpaceAfterCStyleCast: false 101 | SpaceAfterTemplateKeyword: true 102 | SpaceBeforeAssignmentOperators: true 103 | SpaceBeforeParens: ControlStatements 104 | SpaceInEmptyParentheses: false 105 | SpacesBeforeTrailingComments: 1 106 | SpacesInAngles: false 107 | SpacesInContainerLiterals: true 108 | SpacesInCStyleCastParentheses: false 109 | SpacesInParentheses: false 110 | SpacesInSquareBrackets: false 111 | Standard: Cpp11 112 | TabWidth: 2 113 | UseTab: Never 114 | ... 115 | --------------------------------------------------------------------------------