forked from johnathon-walnut/skinchangerStandalone
-
Notifications
You must be signed in to change notification settings - Fork 0
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
fa7be1a
commit 7fc3970
Showing
15 changed files
with
293 additions
and
108 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,47 @@ | ||
#include "../SkinChanger/SkinChanger.h" | ||
|
||
#ifndef _WIN64 | ||
SIGNATURE(CL_CallPostDataUpdates, "engine.dll", "55 8B EC 8B 45 ? 53 33 DB"); | ||
|
||
HOOK(CL_CallPostDataUpdates, Sigs::CL_CallPostDataUpdates, void, __cdecl, void* u) | ||
{ | ||
g_SkinChanger.ApplySkins(); | ||
|
||
CALL_ORIGINAL(u); | ||
} | ||
} | ||
#else | ||
// On x64, CL_CallPostDataUpdates is inlined into CL_ProcessPacketEntities - whereas, ClientDLL_FrameStageNotify is not - we can call this in the same place just before FRAME_NET_UPDATE_POSTDATAUPDATE_END - hoping this doesn't get hooked by anything else like CL_CallPostDataUpdates doesn't | ||
|
||
/* | ||
* engine/cl_ents_parse.cpp - line 664 | ||
* | ||
ClientDLL_FrameStageNotify( FRAME_NET_UPDATE_POSTDATAUPDATE_START ); | ||
// call PostDataUpdate() for each entity | ||
CL_CallPostDataUpdates( u ); | ||
ClientDLL_FrameStageNotify( FRAME_NET_UPDATE_POSTDATAUPDATE_END ); | ||
* | ||
* | ||
*/ | ||
|
||
SIGNATURE(ClientDLL_FrameStageNotify, "engine.dll", "4C 8B DC 56 48 83 EC"); | ||
SIGNATURE(CL_ProcessPacketEntitites_FSN_Call, "engine.dll", "E8 ? ? ? ? 48 8B 0D ? ? ? ? 48 8B 01 FF 50 ? 44 8B F0", 5); // Return address of FSN(3) call | ||
|
||
#include <intrin.h> | ||
|
||
HOOK(ClientDLL_FrameStageNotify, Sigs::ClientDLL_FrameStageNotify, void, __fastcall, int stage) | ||
{ | ||
static bool done = false; | ||
if (I::EngineClient->IsInGame() && !done) | ||
{ | ||
g_Netvars.DumpTables(); | ||
done = true; | ||
} | ||
|
||
if (std::uintptr_t(_ReturnAddress()) == Sigs::CL_ProcessPacketEntitites_FSN_Call.Get()) | ||
g_SkinChanger.ApplySkins(); | ||
|
||
CALL_ORIGINAL(stage); | ||
} | ||
#endif |
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
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.