-
Notifications
You must be signed in to change notification settings - Fork 43
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
ea8b22d
commit 7a3eca7
Showing
13 changed files
with
271 additions
and
98 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
Binary file modified
BIN
+5.5 KB
(100%)
build/red4ext/plugins/let_there_be_flight/let_there_be_flight.dll
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "Addresses.hpp" | ||
#include "FlightModule.hpp" | ||
|
||
// Vehicle Speed Unlimiter | ||
|
||
struct GetLocalizedTextFixer : FlightModule { | ||
void Load(const RED4ext::Sdk *aSdk, RED4ext::PluginHandle aHandle); | ||
void Unload(const RED4ext::Sdk *aSdk, RED4ext::PluginHandle aHandle); | ||
static RED4ext::CString *__fastcall LookupLocalizedString(__int64, RED4ext::CString *result, char *locKey); | ||
}; | ||
|
||
decltype(&GetLocalizedTextFixer::LookupLocalizedString) LookupLocalizedString_Original; | ||
|
||
RED4ext::CString *__fastcall GetLocalizedTextFixer::LookupLocalizedString(__int64 db, RED4ext::CString *result, | ||
char *locKey) { | ||
auto og = LookupLocalizedString_Original(db, result, locKey); | ||
if (result->length == 0) { | ||
result = new RED4ext::CString(locKey); | ||
} | ||
return result; | ||
} | ||
|
||
void GetLocalizedTextFixer::Load(const RED4ext::Sdk *aSdk, RED4ext::PluginHandle aHandle) { | ||
while (!aSdk->hooking->Attach(aHandle, RED4EXT_OFFSET_TO_ADDR(LookupLocalizedStringAddr), | ||
&LookupLocalizedString, reinterpret_cast<void **>(&LookupLocalizedString_Original))) | ||
; | ||
} | ||
|
||
void GetLocalizedTextFixer::Unload(const RED4ext::Sdk *aSdk, RED4ext::PluginHandle aHandle) { | ||
aSdk->hooking->Detach(aHandle, RED4EXT_OFFSET_TO_ADDR(PhysicsStructUpdateAddr)); | ||
aSdk->hooking->Detach(aHandle, RED4EXT_OFFSET_TO_ADDR(PhysicsUnkStructVelocityUpdateAddr)); | ||
} | ||
|
||
REGISTER_FLIGHT_MODULE(GetLocalizedTextFixer); |
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
Binary file not shown.
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.