Fix x64 Lame way, pls do better later
Fix x64 Lame way, pls do better later
This commit is contained in:
parent
d130815f0d
commit
c37e00d98b
@ -74,27 +74,9 @@ static InitFunction PokkenFunc([]()
|
||||
// 18: imageBase + 0x661820
|
||||
injector::MakeNOP(hook::get_pattern("48 8D 8F F8 00 00 00 88 9F 05 01 00 00", -0x2), 2);
|
||||
|
||||
auto chars = { 'F', 'G', 'J' };
|
||||
ScanMyPattern("F:\\", 'F');
|
||||
ScanMyPattern("G:\\", 'G');
|
||||
ScanMyPattern("H:\\", 'H');
|
||||
|
||||
for (auto cha : chars)
|
||||
{
|
||||
auto patterns = hook::pattern(va("%02X 3A 5C", cha));
|
||||
|
||||
if (patterns.size() > 0)
|
||||
{
|
||||
for (int i = 0; i < patterns.size(); i++)
|
||||
{
|
||||
char* text = patterns.get(i).get<char>(0);
|
||||
std::string text_str(text);
|
||||
|
||||
std::string to_replace = va("%c:\\", cha);
|
||||
std::string replace_with = va(".\\%c", cha);
|
||||
|
||||
std::string replaced = text_str.replace(0, to_replace.length(), replace_with);
|
||||
|
||||
injector::WriteMemoryRaw(text, (char*)replaced.c_str(), replaced.length() + 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, GameID::PokkenTournament);
|
||||
#endif
|
@ -1276,28 +1276,8 @@ static InitFunction Wmmt5Func([]()
|
||||
}
|
||||
}
|
||||
|
||||
auto chars = { 'F', 'G' };
|
||||
|
||||
for (auto cha : chars)
|
||||
{
|
||||
auto patterns = hook::pattern(va("%02X 3A 2F", cha));
|
||||
|
||||
if (patterns.size() > 0)
|
||||
{
|
||||
for (int i = 0; i < patterns.size(); i++)
|
||||
{
|
||||
char* text = patterns.get(i).get<char>(0);
|
||||
std::string text_str(text);
|
||||
|
||||
std::string to_replace = va("%c:/", cha);
|
||||
std::string replace_with = va("./%c", cha);
|
||||
|
||||
std::string replaced = text_str.replace(0, to_replace.length(), replace_with);
|
||||
|
||||
injector::WriteMemoryRaw(text, (char*)replaced.c_str(), replaced.length() + 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
ScanMyPattern("F:\\", 'F');
|
||||
ScanMyPattern("G:\\", 'G');
|
||||
|
||||
if (ToBool(config["General"]["SkipMovies"]))
|
||||
{
|
||||
|
@ -232,7 +232,6 @@ void InitializeHints()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static InitFunction globalFunc([]()
|
||||
{
|
||||
InitializeHints();
|
||||
|
@ -86,7 +86,7 @@ T iatHook(const char* moduleName, T function, TOrdinal ordinal)
|
||||
{
|
||||
if (iat_matches_ordinal(nameTableEntry, ordinal))
|
||||
{
|
||||
T origEntry = (T)*addressTableEntry;
|
||||
T origEntry = (T)* addressTableEntry;
|
||||
injector::WriteMemory(addressTableEntry, (uintptr_t)function, true);
|
||||
|
||||
return origEntry;
|
||||
|
@ -332,17 +332,6 @@ namespace hook
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void pattern::hint(uint64_t hash, uintptr_t address)
|
||||
{
|
||||
auto range = GetHints().equal_range(hash);
|
||||
@ -359,3 +348,23 @@ namespace hook
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ScanMyPattern(hook::pattern patternToScan, char cha)
|
||||
{
|
||||
auto patterns = hook::pattern(patternToScan);
|
||||
if (patterns.size() > 0)
|
||||
{
|
||||
for (int i = 0; i < patterns.size(); i++)
|
||||
{
|
||||
char* text = patterns.get(i).get<char>(0);
|
||||
std::string text_str(text);
|
||||
|
||||
std::string to_replace = va("%c:\\", cha);
|
||||
std::string replace_with = va(".\\%c", cha);
|
||||
|
||||
std::string replaced = text_str.replace(0, to_replace.length(), replace_with);
|
||||
|
||||
injector::WriteMemoryRaw(text, (char*)replaced.c_str(), replaced.length() + 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -198,4 +198,6 @@ namespace hook
|
||||
}
|
||||
}
|
||||
|
||||
extern void ScanMyPattern(hook::pattern patternToScan, char cha);
|
||||
|
||||
#pragma warning(pop)
|
||||
|
Loading…
Reference in New Issue
Block a user