-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bd2778
commit 31d62ea
Showing
14 changed files
with
1,390 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
data/GTA3DE.FusionMod/Gameface/Binaries/Win64/scripts/GTA3DE.FusionMod.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
[MAIN] | ||
HudScale = 0.8 // Original value is 1.0. | ||
RadarScale = 0.9 // Original value is 1.0. | ||
SaveSlot = 5 // Available slots: 1 through 8 | ||
DisableFirstPersonAimForRifles = 1 | ||
SkipIntro = 1 | ||
SkipMenu = 1 | ||
HudScale = 0.8 // Original value is 1.0. | ||
RadarScale = 0.75 // Original value is 1.0. | ||
SaveSlot = 5 // Available slots: 1 through 8 | ||
DisableFirstPersonAimForRifles = 1 |
8 changes: 5 additions & 3 deletions
8
data/GTASADE.FusionMod/Gameface/Binaries/Win64/scripts/GTASADE.FusionMod.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
[MAIN] | ||
HudScale = 0.8 // Original value is 1.0. | ||
RadarScale = 0.9 // Original value is 1.0. | ||
SaveSlot = 5 // Available slots: 1 through 8 | ||
SkipIntro = 1 | ||
SkipMenu = 1 | ||
HudScale = 0.8 // Original value is 1.0. | ||
RadarScale = 0.75 // Original value is 1.0. | ||
SaveSlot = 5 // Available slots: 1 through 8 |
10 changes: 6 additions & 4 deletions
10
data/GTAVCDE.FusionMod/Gameface/Binaries/Win64/scripts/GTAVCDE.FusionMod.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
[MAIN] | ||
HudScale = 0.8 // Original value is 1.0. | ||
RadarScale = 0.9 // Original value is 1.0. | ||
SaveSlot = 5 // Available slots: 1 through 8 | ||
DisableFirstPersonAimForRifles = 1 | ||
SkipIntro = 1 | ||
SkipMenu = 1 | ||
HudScale = 0.8 // Original value is 1.0. | ||
RadarScale = 0.75 // Original value is 1.0. | ||
SaveSlot = 5 // Available slots: 1 through 8 | ||
DisableFirstPersonAimForRifles = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#pragma once | ||
#include <string> | ||
#include <locale> | ||
|
||
template<class T> | ||
struct TArray | ||
{ | ||
friend struct FString; | ||
|
||
public: | ||
inline TArray() | ||
{ | ||
Data = nullptr; | ||
Count = Max = 0; | ||
}; | ||
|
||
inline int Num() const | ||
{ | ||
return Count; | ||
}; | ||
|
||
inline T& operator[](int i) | ||
{ | ||
return Data[i]; | ||
}; | ||
|
||
inline const T& operator[](int i) const | ||
{ | ||
return Data[i]; | ||
}; | ||
|
||
inline bool IsValidIndex(int i) const | ||
{ | ||
return i < Num(); | ||
} | ||
|
||
public: | ||
T* Data; | ||
int Count; | ||
int Max; | ||
}; | ||
|
||
struct FString : public TArray<wchar_t> | ||
{ | ||
inline FString() | ||
{ | ||
}; | ||
|
||
inline bool IsValid() const | ||
{ | ||
return Data != nullptr; | ||
} | ||
|
||
inline const wchar_t* c_str() const | ||
{ | ||
return Data; | ||
} | ||
|
||
std::string ToString() const | ||
{ | ||
auto length = std::wcslen(Data); | ||
std::string str(length, '\0'); | ||
std::use_facet<std::ctype<wchar_t>>(std::locale()).narrow(Data, Data + length, '?', &str[0]); | ||
return str; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#pragma once | ||
#define _WINTERNL_ | ||
#include <utility/Scan.hpp> | ||
#include <utility/Module.hpp> | ||
|
||
namespace utility { | ||
static inline std::vector<uintptr_t> scan_references(uintptr_t start, size_t length, uintptr_t ptr) | ||
{ | ||
std::vector<uintptr_t> results{}; | ||
const auto end = (start + length) - sizeof(void*); | ||
|
||
for (auto ref = utility::scan_ptr(start, length, ptr); ref; ref = utility::scan_ptr(*ref + sizeof(void*), end - (*ref + sizeof(void*)), ptr)) { | ||
results.push_back(*ref); | ||
} | ||
|
||
return results; | ||
} | ||
|
||
static inline std::vector<uintptr_t> scan_references(HMODULE module, uintptr_t ptr) | ||
{ | ||
const auto module_size = utility::get_module_size(module); | ||
|
||
if (!module_size) { | ||
return {}; | ||
} | ||
|
||
return scan_references((uintptr_t)module, *module_size, ptr); | ||
} | ||
|
||
template<class T, class S, class UnaryPred> | ||
static T GetSymbolFromFuncStart(S& str, UnaryPred predicate) | ||
{ | ||
auto func = utility::find_function_from_string_ref(utility::get_executable(), str, true); | ||
if (func) | ||
{ | ||
INSTRUX ix{}; | ||
auto ip = utility::find_function_start_with_call(func.value()).value_or(func.value()); | ||
|
||
while (ip) | ||
{ | ||
const auto status = NdDecodeEx(&ix, (ND_UINT8*)ip, 1000, ND_CODE_64, ND_DATA_64); | ||
|
||
if (!ND_SUCCESS(status)) { | ||
break; | ||
} | ||
|
||
if (predicate(ix)) | ||
{ | ||
auto disp = utility::resolve_displacement(ip); | ||
if (disp) | ||
{ | ||
return reinterpret_cast<T>(disp.value()); | ||
break; | ||
} | ||
} | ||
|
||
ip += ix.Length; | ||
} | ||
} | ||
return T{}; | ||
} | ||
|
||
template<class T, class S> | ||
static T GetFunctionCallAfterStringParam(S& str, int callnum = 0) | ||
{ | ||
auto scan_res = utility::scan_string(utility::get_executable(), str, true); | ||
if (scan_res) | ||
{ | ||
auto xref = utility::scan_reference(utility::get_executable(), scan_res.value()); | ||
if (xref) | ||
{ | ||
INSTRUX ix{}; | ||
auto ip = xref.value() + 4; | ||
auto counter = 0; | ||
|
||
while (true) | ||
{ | ||
const auto status = NdDecodeEx(&ix, (ND_UINT8*)ip, 1000, ND_CODE_64, ND_DATA_64); | ||
|
||
if (!ND_SUCCESS(status)) { | ||
break; | ||
} | ||
|
||
if (ix.Instruction == ND_INS_CALLNR) | ||
{ | ||
auto disp = utility::resolve_displacement(ip); | ||
if (disp && counter == callnum) | ||
{ | ||
return reinterpret_cast<T>(disp.value()); | ||
break; | ||
} | ||
counter++; | ||
} | ||
|
||
ip += ix.Length; | ||
} | ||
} | ||
} | ||
return T{}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.