Skip to content

Commit a281979

Browse files
committed
merged with GUI version
1 parent 05d28ab commit a281979

23 files changed

+604
-561
lines changed

CMakeLists.txt

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
cmake_minimum_required(VERSION 3.6)
22

3-
project("Splinter Cell 3 Hacks")
3+
project("SCCT GUI")
44

5-
set(EXEC "sp3")
6-
set(CMAKE_C_STANDARD 99)
5+
set(EXEC "scctgui")
6+
set(CMAKE_C_STANDARD 17)
77

88
## Sources
99
file(GLOB SOURCES src/*.c)
1010

1111
## Includes
1212
include_directories(include)
13+
include_directories("C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Include")
14+
15+
## Library
16+
link_directories("C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Lib/x86")
1317

1418
## Output DLL
1519
add_library(${EXEC} SHARED ${SOURCES})
1620

17-
## Output DIR
18-
#set_target_properties(${EXEC}
19-
# PROPERTIES
20-
# CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin
21-
# CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin
22-
# CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin
23-
#)
24-
25-
## Library Files
26-
target_link_libraries(${EXEC} Winmm)
21+
target_link_libraries(${EXEC} d3d9 d3dx9)

Makefile

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 31 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,51 @@
11
# Splinter Cell Chaos Theory Trainer
22
### Timeline
3-
- Project started: 03/12/2021
4-
- First release: 03/14/2021
5-
- Final Revision: 05/14/2021
3+
- Project started: 08/18/2021
4+
- Switch from C to CPP: 08/18/2021
5+
- Project completed: 08/19/2021
6+
- Switch from CPP to C: 08/20/2021
67

78
## Overview & Demonstration
89
The main purpose of this project was to get familiar with the C language while also
9-
familiarizing myself with cross platform compilation from Linux (wsl Ubuntu 20.04 LTS)
10-
to Windows*.
10+
familiarizing myself with the Directx9c API.
1111

12-
<img src="./resources/sp3_godmode.gif" width="680" height="400"/>
13-
Godmode Enabled - The player can not receive damage of any kind (invincible) while
14-
enemies convert any and all damage taken to maximum damage. (insta-kill)
12+
<img src="./resources/demo.gif"/>
13+
Demonstration of God Mode, Disable Alarms, and Disable Enemies.
14+
Activated cheats are highlighted in the top left in green.
1515

1616
## Table of Contents
1717
- [What I Learned](#what-i-learned)
18-
- [How it works](#how-it-works)
18+
- [How It Works](#how-it-works)
1919
- [Build Instructions](#build-instructions)
20-
- [Windows](#windows)
21-
- [Linux (Debian)](#linux-debian)
22-
- [Known issues](#known-issues)
20+
- [Known Issues](#known-issues)
2321
- [Goals](#Goals)
2422

2523
## What I Learned
26-
<b>Visual C++ lets you get away with a lot of programming fuckery.</b>
24+
Splinter Cell Chaos Theory has a unique Directx API structure. Text can
25+
not be drawn, and most sprites, tools, and images can only be half drawn
26+
and are very poorly rendered when they are drawn.
2727

28-
Switching to converting the old Visual C/C++ code to C99 was a pain because of the amount of
29-
errors that Visual Studio handled silently on its own. It was an enlightening experience.
28+
There are more things that can be done but I've concluded that it's not
29+
worth the effort.
3030

31-
While cross compiling from Linux to Windows using <code>i686-win64-mingw32-gcc</code> isn't as well
32-
documented as VisualC++ is, it is certainly doable (with serious effort). It took a bit of
33-
research just to get the compiler to compile all of the various non-standard 'MS-isms' that
34-
are included in <code>Windows.h</code> and <code>tlhelp32.h</code>.
31+
## How It Works
32+
Use any DLL injector that you are comfortable with to inject the file into
33+
the <code>splintercell3.exe</code> process.
3534

36-
I originally planned to hook DirectX for an internally hooked GUI, but getting mingw's ld
37-
to recognize <code>detours.h</code> was more work that it was really worth so it was abandoned.
38-
It seems that C++ is much better suited for these types of tasks anyway.
39-
40-
## How it works
41-
Use any DLL injector that you are comfortable with to inject the file into the <code>splintercell3.exe</code> process.
42-
If you don't have a DLL injector, you can use mine <a href="https://github.com/malikrbooker/Vipers-DLL-Injector-2/releases/latest">here</a>.
43-
44-
A resize-able console will pop up letting you know what hacks are available as well as their respective status.
45-
<img src="resources/dll_console_example.png"/>
35+
Once the DLL is injected, you will have access to the following Hacks:
36+
- Numpad 1: God Mode
37+
- Numpad 2: Ghost Mode
38+
- Numpad 3: Super Weapons
39+
- Numpad 4: Disable Alarms
40+
- Numpad 5: Disable Enemies
41+
- Numpad 6: Unlock All Doors
4642

4743
## Build Instructions
48-
### Windows
49-
- Powershell
50-
1. install MinGW
51-
2. add MinGW/bin to path
44+
- WSL
45+
1. install cmake for windows
5246
```
53-
$ make.exe
47+
$ ./install_script.sh
5448
```
55-
5649
- CMake
5750
1. install cmake for windows
5851
- Visual Studio 2019
@@ -65,43 +58,8 @@ A resize-able console will pop up letting you know what hacks are available as w
6558
$ cmake --build "build" --config "Release"
6659
```
6760
68-
- WSL
69-
```
70-
$ sudo apt install mingw-w64
71-
$ make
72-
```
73-
74-
- Python
75-
```
76-
python3 build.py
77-
```
78-
79-
### Linux (Debian)
80-
- MinGW
81-
```
82-
$ sudo apt install mingw-w64
83-
$ make
84-
```
85-
86-
## Known issues
87-
~~I could not find a reliable 'in game' boolean value or other explicit distinction that would
88-
prevent the user from attempting to execute the code in places that would crash the game.~~ <i>circumvented</i>
89-
90-
These locations include:
91-
- ~~Special cases such as trying to teleport without first equipping weapon~~ <i>(patched May 05, 2021)</i>
92-
- ~~Special cases such as trying to toggle no recoil without first equipping weapon~~ <i>(patched May 05, 2021)</i>
93-
94-
The entity list is also extremely illusive. Sometimes functions that include the EntityList Object end
95-
up returning NULL due to its random nature. The hacks that rely on the EntityList Object tend to work
96-
less reliably as multiple levels are completed.
61+
## Known Issues
62+
If the user presses F3 while the menu is minimized, it will reset position.
9763
9864
## Goals
99-
- [x] Find reliable weapon pointer <i>(patched March 12, 2021)</i>
100-
- [x] ~~Find 'Death' __thiscall~~ <i>(removed - unnecessary)</i>
101-
- [x] Find a way to prevent PolterGheist from breaking the game <i>(patched May 5, 2021)</i>
102-
- [ ] Find reliable entity_list pointer
103-
- [ ] ~~Find reliable player_health pointer~~ <i>(removed - unnecessary)</i>
104-
- [ ] ~~Find reliable 'in game' boolean (or other explicit distinction)~~ <i>(removed - unnecessary)</i>
105-
106-
#### References
107-
*Windows - <i>10 Pro Insider Preview Build 21318.rs_prerelease.210216-1530)</i>
65+
- [ ] ~~Find out how to draw text~~

build.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

include/d3d9hook.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef _D3D9HOOK_H
2+
#define _D3D9HOOK_H
3+
4+
#include <windows.h>
5+
#include <stdbool.h>
6+
#include <d3d9.h>
7+
#include <d3dx9.h>
8+
9+
typedef HRESULT(APIENTRY* tEndScene)(LPDIRECT3DDEVICE9 pDevice);
10+
11+
bool GetD3D9Device(void** pTable, size_t Size);
12+
13+
BOOL CALLBACK EnumWindowsCallback(HWND handle, LPARAM lParam);
14+
15+
HWND GetProcessWindow();
16+
17+
#endif /* _D3D9HOOK_H */

include/drawing.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef _DRAWING_H
2+
#define _DRAWING_H
3+
4+
#include "d3d9hook.h"
5+
6+
void draw_DrawBorderBox(int x, int y, int w, int h, int thickness, D3DCOLOR Colour, IDirect3DDevice9* d3dDevice);
7+
8+
void draw_DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* d3dDevice);
9+
10+
void draw_DrawText(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour, LPD3DXFONT m_font);
11+
12+
#endif /* _DRAWING_H */

include/entity.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ typedef struct Weapon
4040
float bloom_y; // + 0x0524
4141
} Weapon;
4242

43-
44-
#endif
43+
#endif

0 commit comments

Comments
 (0)