Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Bensuperpc <[email protected]>
  • Loading branch information
bensuperpc committed Dec 17, 2023
1 parent a395a63 commit 37aa66c
Show file tree
Hide file tree
Showing 22 changed files with 403 additions and 408 deletions.
117 changes: 74 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

# set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
find_package(QT NAMES Qt6 COMPONENTS Quick QuickControls2 Gui Core Qml Charts Multimedia Widgets Concurrent SerialPort)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick QuickControls2 Gui Core Qml Charts Multimedia Widgets Concurrent SerialPort)

find_package(QT NAMES Qt6 REQUIRED COMPONENTS Quick QuickControls2 Gui Core Qml Charts Multimedia Widgets Concurrent SerialPort)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Quick QuickControls2 Gui Core Qml Charts Multimedia Widgets Concurrent SerialPort)
qt_standard_project_setup(REQUIRES 6.5)
if (Qt${QT_VERSION_MAJOR}_FOUND)
qt_standard_project_setup(REQUIRES 6.5)
else()
message(WARNING "Qt${QT_VERSION_MAJOR} not found, project will be CLI only")
endif()

find_package(OpenMP 2.0)

Expand All @@ -48,46 +51,72 @@ add_subdirectory(source/gta_cheat_finder)

# ---- Declare executable ----

#add_executable(GTA_SA_cheat_finder_exe source/main.cpp)
#add_executable(GTA_SA_cheat_finder::exe ALIAS GTA_SA_cheat_finder_exe)

qt_add_executable(GTA_SA_cheat_finder_exe
set(SRCS
source/main.cpp
source/gta_sa_ui.cpp
source/gta_sa_ui.hpp
source/imageprovider.h source/imageprovider.cpp
source/asyncimageprovider.h
source/application.h source/application.cpp
source/lineseries.h source/lineseries.cpp
source/tablemodel.h source/tablemodel.cpp
source/customlabel.h source/customlabel.cpp
source/utils/about_compilation.h
source/utils/utils.h
)
)

set(HEADERS
)

if (Qt${QT_VERSION_MAJOR}_FOUND)
list(APPEND SRCS
source/gta_sa_ui.cpp
source/imageprovider.cpp
source/application.cpp
source/lineseries.cpp
source/tablemodel.cpp
source/customlabel.cpp
)
list(APPEND HEADERS
source/gta_sa_ui.hpp
source/asyncimageprovider.h
source/application.h
source/lineseries.h
source/tablemodel.h
source/customlabel.h
source/utils/about_compilation.h
source/utils/utils.h
)
endif()

if (Qt${QT_VERSION_MAJOR}_FOUND)
qt_add_executable(GTA_SA_cheat_finder_exe
${SRCS} ${HEADERS}
)
else()
add_executable(GTA_SA_cheat_finder_exe
${SRCS} ${HEADERS}
)
endif()

add_executable(GTA_SA_cheat_finder::exe ALIAS GTA_SA_cheat_finder_exe)

qt_add_qml_module(GTA_SA_cheat_finder_exe
URI bensuperpc
RESOURCE_PREFIX /bensuperpc.fr
VERSION 1.0
QML_FILES
qml/responsive.qml
qml/responsiveOrg.qml
qml/GTA_SA.qml
qml/main.qml
qml/home.qml qml/image.qml
qml/about.qml qml/graphic.qml
qml/table.qml
qml/settings.qml
qml/swipe.qml
qml/custom/ProportionalRect.qml
qml/custom/CustomMenuSeparator.qml
qml/custom/HorizontalLabelDelegateMenu.qml
qml/custom/VerticalLabelDelegateMenu.qml
IMPORT_PATH qml
RESOURCES
image/cat_sticking_out_its_tongue.jpg
)

if (Qt${QT_VERSION_MAJOR}_FOUND)
qt_add_qml_module(GTA_SA_cheat_finder_exe
URI bensuperpc
OUTPUT_DIRECTORY bensuperpc
RESOURCE_PREFIX /bensuperpc.org
VERSION 1.0
QML_FILES
qml/responsive.qml
qml/responsiveOrg.qml
qml/GTA_SA.qml
qml/main.qml
qml/home.qml qml/image.qml
qml/about.qml qml/graphic.qml
qml/table.qml
qml/settings.qml
qml/swipe.qml
qml/custom/ProportionalRect.qml
qml/custom/CustomMenuSeparator.qml
qml/custom/HorizontalLabelDelegateMenu.qml
qml/custom/VerticalLabelDelegateMenu.qml
IMPORT_PATH qml
RESOURCES
image/cat_sticking_out_its_tongue.jpg
)
endif()

set_target_properties(GTA_SA_cheat_finder_exe PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
Expand All @@ -114,8 +143,10 @@ set_property(TARGET GTA_SA_cheat_finder_exe PROPERTY OUTPUT_NAME GTA_SA_cheat_fi

target_compile_features(GTA_SA_cheat_finder_exe PRIVATE cxx_std_20)

target_link_libraries(GTA_SA_cheat_finder_exe
PRIVATE Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::QuickControls2 Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::Concurrent Qt${QT_VERSION_MAJOR}::SerialPort)
if (Qt${QT_VERSION_MAJOR}_FOUND)
target_link_libraries(GTA_SA_cheat_finder_exe
PRIVATE Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::QuickControls2 Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::Concurrent Qt${QT_VERSION_MAJOR}::SerialPort)
endif()

target_compile_definitions(GTA_SA_cheat_finder_exe PUBLIC PROJECT_VERSION="${PROJECT_VERSION}")
target_compile_definitions(GTA_SA_cheat_finder_exe PUBLIC CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}")
Expand Down
46 changes: 31 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GTA_SA_cheat_finder

## _Find alternate cheat codes in Grand Theft Auto San Andreas by brute foce_
## _Find alternate cheat codes in Grand Theft Auto San Andreas by hash collision_

[![Continuous Integration](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/ci.yml/badge.svg)](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/base.yml) [![Dockcross CI](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/dockcross.yml/badge.svg)](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/dockcross.yml) [![tagged-release](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/release.yml/badge.svg)](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/release.yml) [![linux](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/linux.yml/badge.svg)](https://github.com/bensuperpc/GTA_SA_cheat_finder/actions/workflows/linux.yml)

Expand All @@ -11,9 +11,17 @@
## New Features

- Multi-plateform build: AMD64, I386, ARM64, ARMv7, ARMv7a, ARMv6, ARMv5, RISC-V 32/64, PPC64le, Mips, Windows 32/64, Android (Exec only), m68k... Thanks [dockcross](https://github.com/dockcross/dockcross) and [crosstool-ng](https://github.com/crosstool-ng/crosstool-ng)
- Add Qt GUI (Qt 6.4.0 and Qt Quick)
- Add Qt GUI (Qt 6.6.0 and Qt Quick)
- Add CUDA support (tested with NVIDIA RTX 2070 and 3070)

## Usage

## Usage (GUI)

```sh
./GTA_SA_cheat_finder
```

## Usage (CLI)

```sh
./GTA_SA_cheat_finder --min 0 --max 60000000 # (Searches codes from index 0 to 60000000, from A to: BYKYLXA alphabetic sequence)
Expand Down Expand Up @@ -58,27 +66,40 @@ Time: 1.19597 sec
This program execute: 501.684973 MOps/sec
```

## Perfs
## Benchmark

### CPU

On AMD R7 5800H (clang 12)
On AMD R7 5800H (clang 16)

```bash
141167095653376 = ~5 days
5429503678976 = ~4h
208827064576 = ~8 min
8031810176 = ~20 min
1544578880 = ~3 sec
308915776 = 0.6 sec
```
### GPU

On NVIDIA RTX 3070 (clang 16 and CUDA 11.3)

```bash
5429503678976 = ~45min
208827064576 = ~1 min
8031810176 = ~2 sec
1544578880 = ~0.3 sec
308915776 = 0.06 sec
```


### How does it work ?

- The algorithm will generate sequences of characters (A, B, C ... AA...)
- The algorithm will generate sequences of characters (A, B, C... AA, AB, AC...)
- It will then calculate hash (**JAMCRC**) from series of characters
- It will compare hashes, if they are equal to one of the hashes of one of the official cheat codes, this will save the sequence of characters
- When it is finished it displays the results
- When it is finished it displays the results and each code found can work as a alternative cheat code for GTA SA

### Information
More information on this video:

[![GTA SA - Alternative Cheats - Feat. Badger Goodger](https://yt-embed.herokuapp.com/embed?v=W_eFZ4HzU7Q)](https://youtu.be/W_eFZ4HzU7Q "GTA SA - Alternative Cheats - Feat. Badger Goodger")

Expand All @@ -90,13 +111,9 @@ See the [BUILDING](BUILDING.md) document.

See the [CONTRIBUTING](CONTRIBUTING.md) document.

## Todos

- Write Tests
- Use intrinsics

## Open source projects used

- [Stbrumme CRC32](https://github.com/stbrumme/crc32)
- [dockcross](https://github.com/dockcross/dockcross)
- [crosstool-ng](https://github.com/crosstool-ng/crosstool-ng)
- [git](https://github.com/git/git)
Expand All @@ -107,7 +124,6 @@ See the [CONTRIBUTING](CONTRIBUTING.md) document.
- [gcc](https://github.com/gcc-mirror/gcc)
- [docker](https://github.com/docker/docker)
- [actions](https://github.com/actions/virtual-environments)
- [fmt](https://github.com/fmtlib/fmt)

## Licensing

Expand Down
52 changes: 0 additions & 52 deletions main_en.ts

This file was deleted.

2 changes: 1 addition & 1 deletion qml/image.qml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Page {

Image {
source: Qt.resolvedUrl(
"/bensuperpc.fr/bensuperpc/image/cat_sticking_out_its_tongue.jpg")
"/bensuperpc.org/bensuperpc/image/cat_sticking_out_its_tongue.jpg")
width: 64
height: 64
fillMode: Image.PreserveAspectFit
Expand Down
2 changes: 1 addition & 1 deletion qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ApplicationWindow {
Image {
id: logo
source: Qt.resolvedUrl(
"/bensuperpc.fr/bensuperpc/image/cat_sticking_out_its_tongue.jpg")
"/bensuperpc.org/bensuperpc/image/cat_sticking_out_its_tongue.jpg")
fillMode: Image.Stretch
Layout.preferredWidth: 64
Layout.preferredHeight: 64
Expand Down
Loading

0 comments on commit 37aa66c

Please sign in to comment.