Skip to content

Commit 5754a7b

Browse files
feat: initial commit
0 parents  commit 5754a7b

15 files changed

Lines changed: 553 additions & 0 deletions

File tree

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ko_fi: craftablescience

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
# nothing here
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
build_type:
18+
- Debug
19+
- Release
20+
os:
21+
- { name: Windows, image: windows-latest }
22+
- { name: Linux, image: ubuntu-latest }
23+
- { name: macOS, image: macos-latest }
24+
runs-on: ${{matrix.os.image}}
25+
steps:
26+
- name: Checkout Repository
27+
uses: actions/checkout@v5
28+
29+
- name: Set up MSVC [Windows]
30+
if: matrix.os.name == 'Windows'
31+
uses: ilammy/msvc-dev-cmd@v1
32+
33+
- name: Configure CMake
34+
run: cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFGPTOOL_USE_LTO=ON
35+
36+
- name: Build Binaries
37+
run: cmake --build build --config ${{matrix.build_type}} -t fgptool
38+
39+
- name: Upload Standalone
40+
uses: actions/upload-artifact@v5
41+
with:
42+
name: 'fgptool-${{matrix.os.name}}-Standalone-${{matrix.build_type}}'
43+
path: |
44+
build/fgptool.exe
45+
build/fgptool
46+
retention-days: 7
47+
48+
- name: Upload Standalone PDBs
49+
if: matrix.os.name == 'Windows'
50+
uses: actions/upload-artifact@v5
51+
with:
52+
name: 'fgptool-Windows-PDBs-${{matrix.build_type}}'
53+
path: |
54+
build/fgptool.pdb
55+
retention-days: 7

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# IDE
2+
.idea/
3+
.vs/
4+
.vscode/
5+
CMakeSettings.json
6+
7+
8+
# Build
9+
build/
10+
dist/
11+
cmake-build-*/
12+
out/
13+
*.dll
14+
*.ilk
15+
*.pdb
16+
*.pyd
17+
*.so*
18+
19+
20+
# Generated
21+
**/generated/
22+
src/config.h

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "cmake/helpers"]
2+
path = cmake/helpers
3+
url = https://github.com/craftablescience/cmake-helpers
4+
[submodule "ext/argparse"]
5+
path = ext/argparse
6+
url = https://github.com/p-ranav/argparse
7+
[submodule "ext/sourcepp"]
8+
path = ext/sourcepp
9+
url = https://github.com/craftablescience/sourcepp

CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
2+
3+
# set up project
4+
project(fgptool
5+
DESCRIPTION "A tool to crack the filepath hashes in The Orange Box PS3 file groups."
6+
VERSION 0.1.0
7+
HOMEPAGE_URL "https://github.com/craftablescience/fgptool")
8+
set(CMAKE_CXX_STANDARD 20)
9+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
10+
11+
# add helpers
12+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/helpers")
13+
include(CS_All)
14+
15+
# extra metadata variables
16+
set(PROJECT_ORGANIZATION_NAME "craftablescience" CACHE INTERNAL "" FORCE)
17+
18+
# initial VS integration
19+
cs_setup_vs_defaults(STARTUP_PROJECT "${PROJECT_NAME}")
20+
21+
# set common compile options
22+
option(FGPTOOL_USE_LTO "Compile ${PROJECT_NAME} with LTO/IPO" OFF)
23+
cs_configure_defaults(FGPTOOL_USE_LTO)
24+
25+
# external libraries
26+
cs_include_directory(ext)
27+
28+
# fgptool
29+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/config.h")
30+
add_executable(${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/fgptool.cpp")
31+
cs_configure_target(${PROJECT_NAME} MANIFEST)
32+
target_link_libraries(${PROJECT_NAME} PRIVATE argparse::argparse sourcepp::kvpp sourcepp::vpkpp)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Laura Lewis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# fgptool
2+
3+
<div>
4+
<a href="https://github.com/craftablescience/fgptool/blob/main/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/license/craftablescience/fgptool?branch=main&label=license" alt="License" /></a>
5+
<a href="https://github.com/craftablescience/fgptool/actions" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/actions/workflow/status/craftablescience/fgptool/build.yml?branch=main&label=builds" alt="Workflow Status" /></a>
6+
<a href="https://discord.gg/ASgHFkX" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/discord/678074864346857482?label=discord&logo=Discord&logoColor=%23FFFFFF" alt="Discord" /></a>
7+
<a href="https://ko-fi.com/craftablescience" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/donate-006dae?label=ko-fi&logo=ko-fi" alt="Ko-Fi" /></a>
8+
</div>
9+
10+
A tool to crack the filepath hashes in The Orange Box PS3 file groups.
11+
12+
## Credits
13+
14+
- [argparse](https://github.com/p-ranav/argparse)
15+
- [sourcepp](https://github.com/craftablescience/sourcepp)
16+
17+
## Full Help Text
18+
19+
```
20+
Usage: fgptool [--help] [--mode MODE] [PATH]...
21+
22+
Positional arguments:
23+
PATH The input path(s). [nargs: 0 or more]
24+
25+
Optional arguments:
26+
-h, --help shows help message and exits
27+
-m, --mode The active mode. Can be EXTRACT, CRACK, DUMP, or TEST. [nargs=0..1]
28+
[default: "CRACK"]
29+
```

cmake/helpers

Submodule helpers added at 222dc03

create_sln.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@echo off
2+
cd /d %~dp0
3+
4+
echo Running CMake...
5+
echo/
6+
cmake -B build -G "Visual Studio 17 2022"
7+
echo/
8+
echo Assuming CMake setup went well, the project sln is located at "build/fgptool.sln".
9+
echo/
10+
pause

ext/_ext.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# argparse
2+
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/argparse")
3+
4+
# sourcepp
5+
set(SOURCEPP_LIBS_START_ENABLED OFF CACHE INTERNAL "" FORCE)
6+
set(SOURCEPP_USE_KVPP ON CACHE INTERNAL "" FORCE)
7+
set(SOURCEPP_USE_VPKPP ON CACHE INTERNAL "" FORCE)
8+
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/sourcepp")

0 commit comments

Comments
 (0)