-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from s0t7x/refactor
Refactored a bit and hotfixes for svn 602428
- Loading branch information
Showing
115 changed files
with
34,218 additions
and
50,729 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[submodule "third-party/GuardDetour"] | ||
path = third-party/GuardDetour | ||
url = https://github.com/gravit0/GuardDetour | ||
[submodule "third-party/funchook"] | ||
path = third-party/funchook | ||
url = https://github.com/kubo/funchook | ||
[submodule "third-party/distorm"] | ||
path = third-party/distorm | ||
url = https://github.com/gdabah/distorm/ | ||
[submodule "third-party/nlohmann-json"] | ||
path = third-party/nlohmann-json | ||
url = https://github.com/nlohmann/json |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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,84 @@ | ||
#include "pch.h" | ||
|
||
#include <shroudtopia.h> | ||
#include <memory_utils.h> | ||
|
||
ModMetaData metaData = { | ||
"BuildCam", | ||
"Enables build cam. (Client only)", | ||
"1.0", | ||
"s0T7x", | ||
"0.0.1", | ||
true, | ||
false | ||
}; | ||
|
||
|
||
// Signature for GameVersion (SVN) 55812 | ||
class BuildCam : public Mod | ||
{ | ||
Mem::Detour* mod; | ||
public: | ||
void Load(ModContext* modContext) | ||
{ | ||
const char* pattern = "\xF3\x0F\x11\x9F\x2C\x07\x00\x00"; | ||
const char* mask = "xxxxxxxx"; | ||
|
||
uintptr_t baseAddress = (uintptr_t)GetModuleHandle(NULL); | ||
uintptr_t address = Mem::FindPattern(pattern, mask, baseAddress, 0x1000000); // Scan 16MB | ||
|
||
if (address) | ||
{ | ||
uint8_t modCode[] = { | ||
0xF3,0x0F,0x11,0x9F,0x2C,0x07,0x00,0x00, | ||
0xC7,0x87,0x2C,0x07,0x00,0x00,0x00,0x00,0x00,0x00, | ||
0xC7,0x87,0x30,0x07,0x00,0x00,0x00,0x00,0x80,0xBF, | ||
0xE9,0x00,0x00,0x00,0x00 | ||
}; | ||
mod = new Mem::Detour(address, modCode, sizeof(modCode), false, 3); | ||
mod->shellcode->updateValue<uint32_t>(sizeof(modCode) - 4, (uint32_t)(mod->patch->data->address + mod->patch->data->size) - ((uint32_t)((uintptr_t)mod->shellcode->data->address + mod->shellcode->data->size))); | ||
} | ||
} | ||
|
||
void Unload(ModContext* modContext) { | ||
if (mod) delete mod; | ||
} | ||
|
||
void Activate(ModContext* modContext) { | ||
active = mod->activate(); | ||
modContext->Log(std::string().append(metaData.name).append(" activated").c_str()); | ||
} | ||
|
||
void Deactivate(ModContext* modContext) { | ||
mod->deactivate(); | ||
active = false; | ||
modContext->Log(std::string().append(metaData.name).append(" deactivated").c_str()); | ||
} | ||
|
||
void Update(ModContext* modContext) { } | ||
|
||
ModMetaData GetMetaData() { | ||
return metaData; | ||
} | ||
}; | ||
|
||
extern "C" __declspec(dllexport) Mod* CreateModInstance() { | ||
return new BuildCam(); | ||
} | ||
|
||
BOOL APIENTRY DllMain(HMODULE hModule, | ||
DWORD ul_reason_for_call, | ||
LPVOID lpReserved | ||
) | ||
{ | ||
switch (ul_reason_for_call) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
case DLL_THREAD_ATTACH: | ||
case DLL_THREAD_DETACH: | ||
case DLL_PROCESS_DETACH: | ||
break; | ||
} | ||
return TRUE; | ||
} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion
2
first_person_view/dllmain.cpp → example-mods/first_person_view/dllmain.cpp
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
File renamed without changes.
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,5 @@ | ||
// pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht | ||
|
||
#include "pch.h" | ||
|
||
// Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich. |
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,13 @@ | ||
// pch.h: Dies ist eine vorkompilierte Headerdatei. | ||
// Die unten aufgeführten Dateien werden nur einmal kompiliert, um die Buildleistung für zukünftige Builds zu verbessern. | ||
// Dies wirkt sich auch auf die IntelliSense-Leistung aus, Codevervollständigung und viele Features zum Durchsuchen von Code eingeschlossen. | ||
// Die hier aufgeführten Dateien werden jedoch ALLE neu kompiliert, wenn mindestens eine davon zwischen den Builds aktualisiert wird. | ||
// Fügen Sie hier keine Dateien hinzu, die häufig aktualisiert werden sollen, da sich so der Leistungsvorteil ins Gegenteil verkehrt. | ||
|
||
#ifndef PCH_H | ||
#define PCH_H | ||
|
||
#define WIN32_LEAN_AND_MEAN | ||
#include <windows.h> | ||
|
||
#endif //PCH_H |
File renamed without changes
Oops, something went wrong.