forked from ThirteenAG/GTAIV.EFLC.FusionFix
-
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
5ce2503
commit 123a3f3
Showing
6 changed files
with
104 additions
and
6 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
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,55 @@ | ||
module; | ||
|
||
#include <common.hxx> | ||
|
||
export module extrainfo; | ||
|
||
import common; | ||
import comvars; | ||
|
||
class ExtraInfo | ||
{ | ||
public: | ||
ExtraInfo() | ||
{ | ||
FusionFix::onInitEvent() += []() | ||
{ | ||
CIniReader iniReader(""); | ||
|
||
auto bExraInfo = iniReader.ReadInteger("MISC", "ExraInfo", 1) != 0; | ||
|
||
if (bExraInfo) | ||
{ | ||
auto pattern = hook::pattern("05 ? ? ? ? E9 ? ? ? ? E8 ? ? ? ? 84 C0"); | ||
if (!pattern.empty()) | ||
{ | ||
struct MS_PAUSED_HOOK | ||
{ | ||
void operator()(SafetyHookContext& regs) | ||
{ | ||
static std::wstring extra = L""; | ||
regs.eax += 0x78; | ||
auto s = std::wstring_view((wchar_t*)regs.eax); | ||
|
||
auto imgNum = 0; | ||
auto imgArrSize = 0; | ||
for (auto& it : *pCGameConfigReader__ms_imgFiles) | ||
{ | ||
if (it.m_hFile != -1) | ||
imgNum++; | ||
imgArrSize++; | ||
} | ||
extra = s; | ||
extra += L"~n~"; | ||
extra += L" "; | ||
extra += L"IMG Files: " + std::to_wstring(imgNum) + L" / " + std::to_wstring(imgArrSize); | ||
if (imgNum >= imgArrSize) extra += L"; WARNING: IMG Files limit reached!"; | ||
|
||
regs.eax = (uintptr_t)extra.c_str(); | ||
} | ||
}; injector::MakeInline2<MS_PAUSED_HOOK>(pattern.get_first(0)); | ||
} | ||
} | ||
}; | ||
} | ||
} ExtraInfo; |
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