Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: xfwcfw/kelftool
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ps2homebrew/kelftool
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Jan 4, 2021

  1. Copy the full SHA
    e3768ee View commit details

Commits on Mar 31, 2021

  1. MBR KELF header added

    parrado committed Mar 31, 2021
    Copy the full SHA
    befdc6b View commit details

Commits on Feb 8, 2022

  1. Copy the full SHA
    e20ee2a View commit details

Commits on Feb 9, 2022

  1. Fixed ubunu/macos compilation and github action

    Windows version forced to x86
    Added source control files and formatted source code
    AKuHAK committed Feb 9, 2022
    Copy the full SHA
    c525071 View commit details
  2. Merge pull request #1 from AKuHAK/master

    Github CI: win32/macos/ubuntu
    AKuHAK authored Feb 9, 2022
    Copy the full SHA
    859c822 View commit details

Commits on Feb 11, 2022

  1. Copy the full SHA
    2fd03a8 View commit details
  2. Merge pull request #2 from AKuHAK/master

    Fixed memory leaks and added const qualifier
    AKuHAK authored Feb 11, 2022
    Copy the full SHA
    2428430 View commit details

Commits on Feb 26, 2022

  1. Fixed MacOS build

    Text messages adjusted/ made more informative
    Decryption now is more verbose
    bitTable.gap now correctly filled with zeroes
    AKuHAK committed Feb 26, 2022
    Copy the full SHA
    7d56fa1 View commit details

Commits on Mar 5, 2022

  1. Attempt to use generic BitTable for encryption

    Currently use 1 Raw block to speed up kelf loading
    Added region flags
    Added some Header flags
    Fixed Kc/Kbit to print in decrypted form
    Print BitBlock flag secription
    Try to decrypt elf even if some signatures are wrong
    AKuHAK committed Mar 5, 2022
    Copy the full SHA
    68cdebf View commit details
  2. Get rid of segfault errors

    print header flags
    AKuHAK committed Mar 5, 2022
    Copy the full SHA
    513f212 View commit details
  3. Copy the full SHA
    1f684eb View commit details

Commits on Mar 8, 2022

  1. Added support for PS2KEYS.dat in the working path

    Fixed some segfault errors and minor warnings
    Encryption: added check for block size bound to 8 and 16
    AKuHAK committed Mar 8, 2022
    Copy the full SHA
    e0532cf View commit details
  2. Merge pull request #4 from AKuHAK/test

    Improvements
    AKuHAK authored Mar 8, 2022
    Copy the full SHA
    0a6db4c View commit details

Commits on Sep 14, 2022

  1. Fixed kelftool to produce working kelfs

    Fix make to not remove folder
    AKuHAK committed Sep 14, 2022
    Copy the full SHA
    c87b4a0 View commit details
  2. Added arcade support with fixed Kbit and Kc keys.

    Adjusted Readme.
    AKuHAK committed Sep 14, 2022
    Copy the full SHA
    fb700c2 View commit details

Commits on Sep 16, 2022

  1. Copy the full SHA
    bf894ae View commit details
  2. Merge pull request #5 from AKuHAK/fix

    Fix
    AKuHAK authored Sep 16, 2022
    Copy the full SHA
    efb095d View commit details
  3. Fix actions

    AKuHAK committed Sep 16, 2022
    Copy the full SHA
    504ef09 View commit details

Commits on Jan 17, 2024

  1. Copy the full SHA
    c87f654 View commit details
  2. Copy the full SHA
    5451d54 View commit details
  3. fix const declaration

    AKuHAK committed Jan 17, 2024
    Copy the full SHA
    c5f23b2 View commit details
  4. fix init

    AKuHAK committed Jan 17, 2024
    Copy the full SHA
    4c5abdd View commit details
  5. Copy the full SHA
    a4f7995 View commit details

Commits on Jan 19, 2024

  1. Fix windows build

    AKuHAK authored Jan 19, 2024
    Copy the full SHA
    e61e094 View commit details

Commits on Apr 11, 2024

  1. Extended keystore and customizable KELF header data (#9)

    * implement extended Keystore
    
    * Rename arcade Kbit and Kc to Override Kbit and Kc
    
    * fix typo in readme
    
    * Support detection of system 2x6 bootfile header
    
    * add predefined macros for kelf related constants
    
    * add dnasload user header
    
    a
    
    * add args to override specific KELF header data
    
    * add missing header
    
    * fix conditions on header check
    israpps authored Apr 11, 2024
    Copy the full SHA
    2517da4 View commit details

Commits on Dec 18, 2024

  1. fix typo (#10)

    israpps authored Dec 18, 2024
    Copy the full SHA
    45c2927 View commit details
  2. arcade header (#11)

    Co-authored-by: AKuHAK <621640+AKuHAK@users.noreply.github.com>
    israpps and AKuHAK authored Dec 18, 2024
    Copy the full SHA
    0527704 View commit details

Commits on Dec 19, 2024

  1. Some small fixes

    AKuHAK committed Dec 19, 2024
    Copy the full SHA
    f39ed36 View commit details
  2. Copy the full SHA
    f1e81d6 View commit details
  3. rename

    AKuHAK committed Dec 19, 2024
    Copy the full SHA
    9bfb6a5 View commit details
  4. update ms build

    AKuHAK committed Dec 19, 2024
    Copy the full SHA
    644fee6 View commit details
Showing with 1,905 additions and 675 deletions.
  1. +116 −0 .clang-format
  2. +20 −0 .editorconfig
  3. +17 −0 .gitattributes
  4. +116 −0 .github/workflows/compilation.yml
  5. +14 −3 .gitignore
  6. +14 −8 Makefile
  7. +126 −0 PS2KEYS_example.dat
  8. +48 −4 README.md
  9. +0 −6 kelftool.sln
  10. +3 −71 kelftool.vcxproj
  11. +0 −36 kelftool.vcxproj.filters
  12. +313 −0 src/inipp.h
  13. +696 −309 src/kelf.cpp
  14. +118 −49 src/kelf.h
  15. +186 −87 src/kelftool.cpp
  16. +85 −74 src/keystore.cpp
  17. +33 −28 src/keystore.h
116 changes: 116 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: AcrossComments
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing : Both
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeComma
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ (IWYU pragma:|NOLINT)'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
ForEachMacros: []
IncludeBlocks: Preserve
IndentExternBlock: NoIndent
IndentCaseBlocks: false
IndentCaseLabels: true
IndentGotoLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 3
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 80
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 80
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 80
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
# uncomment below when clang >13 will be out
# IndentPPDirectives: AfterHash
# PPIndentWidth: 1
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig: http://EditorConfig.org

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# 4 spaces indentation
[*.{c,h,js,css,html}]
indent_style = space
indent_size = 4

# Tab indentation
[Makefile*,Rules*]
indent_style = tab
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
116 changes: 116 additions & 0 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: CI-compile

on:
push:
pull_request:

jobs:
build-windows:
name: Windows compilation
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup msbuild
uses: microsoft/setup-msbuild@v2

- run: choco install openssl --no-progress --x86 --version=1.1.1.2100

- name: Build
run: msbuild /p:Configuration=Release

- uses: actions/upload-artifact@v4
with:
name: kelftool-windows
path: Release/kelftool.exe

build-macos:
name: MacOS compilation
runs-on: macos-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build
run: |
make
tar -zcvf kelftool-macos.tar.gz build/kelftool
- uses: actions/upload-artifact@v4
with:
name: kelftool-macos
path: kelftool-macos.tar.gz

build-ubuntu:
name: Ubuntu compilation
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- run: sudo apt-get install libssl-dev

- name: Build
run: |
make
tar -zcvf kelftool-linux.tar.gz build/kelftool
- uses: actions/upload-artifact@v4
with:
name: kelftool-linux
path: kelftool-linux.tar.gz

release:
needs: [build-windows, build-macos, build-ubuntu]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4

- name: Get short SHA and repository name
id: slug
run: |
echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> $GITHUB_ENV
- name: Download kelftool-windows artifact
uses: actions/download-artifact@v4
with:
name: kelftool-windows

- name: Download kelftool-macos artifact
uses: actions/download-artifact@v4
with:
name: kelftool-macos

- name: Download kelftool-linux artifact
uses: actions/download-artifact@v4
with:
name: kelftool-linux

- name: Create pre-release
if: github.ref == 'refs/heads/master'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "latest"
title: "Development build"
files: |
*.tar.gz
*.exe
- name: Create Tagged Release Draft
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
files: |
*.tar.gz
*.exe
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
*.user
*.userosscache
*.sln.docstates
*.filters

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
@@ -221,7 +222,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

@@ -317,7 +318,7 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
@@ -326,5 +327,15 @@ ASALocalRun/
# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
# MFractors (Xamarin productivity tool) working folder
.mfractor/

build/
.*
*.kelf
*.xlf
*.elf
*.KELF
*.XLF
*.ELF
PS2KEYS.dat
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2))

CXX = g++
LD = ld
CXX = g++
LD = ld

name := kelftool

@@ -11,20 +11,26 @@ dir_build := build
CXXFLAGS = --std=c++17
LDLIBS = -lcrypto

# next flags only for macos
# change paths to your location of openssl@1.1
ifdef HOMEBREW_PREFIX
OUTPUT_OPTION += -I$(HOMEBREW_PREFIX)/opt/openssl@1.1/include
LDLIBS += -L$(HOMEBREW_PREFIX)/opt/openssl@1.1/lib
endif

objects = $(patsubst $(dir_source)/%.cpp, $(dir_build)/%.o, \
$(call rwildcard, $(dir_source), *.cpp))

.PHONY: all
all: $(dir_build)/$(name).elf
all: $(dir_build)/$(name)

.PHONY: clean
clean:
@rm -rf $(dir_build)
@rm -rf $(dir_build)/$(name) $(objects)

$(dir_build)/$(name).elf: $(objects)
$(LINK.cc) $^ $(LDLIBS) $(OUTPUT_OPTION)
$(dir_build)/$(name): $(objects)
$(LINK.cc) $^ $(LDLIBS) $(OUTPUT_OPTION) -o $@

$(dir_build)/%.o: $(dir_source)/%.cpp
@mkdir -p "$(@D)"
$(COMPILE.cpp) $(OUTPUT_OPTION) $<

$(COMPILE.cpp) $< $(OUTPUT_OPTION) -o $@
Loading