1
0
mirror of synced 2025-01-20 17:48:51 +01:00

fix pattern stuff

This commit is contained in:
avail 2019-06-05 03:09:39 +02:00
parent b7fe2026cd
commit a4ab956477
3 changed files with 12 additions and 2 deletions

View File

@ -78,7 +78,8 @@ static InitFunction PokkenFunc([]()
for (auto cha : chars)
{
auto patterns = hook::pattern(va("%02X 3A 5C", cha));
std::string pat = va("%02X 3A 5C", cha);
auto patterns = hook::pattern(pat);
if (patterns.size() > 0)
{

View File

@ -1280,7 +1280,8 @@ static InitFunction Wmmt5Func([]()
for (auto cha : chars)
{
auto patterns = hook::pattern(va("%02X 3A 2F", cha));
std::string pat = va("%02X 3A 2F", cha);
auto patterns = hook::pattern(pat);
if (patterns.size() > 0)
{

View File

@ -9,6 +9,7 @@
#include <cassert>
#include <vector>
#include <string>
#pragma warning(push)
#pragma warning(disable:4201)
@ -91,6 +92,13 @@ namespace hook
Initialize(pattern, Len);
}
pattern(std::string &pattern)
: pattern(GetModuleHandle(NULL))
{
auto len = pattern.length();
Initialize(pattern.c_str(), len);
}
inline pattern& count(uint32_t expected) &
{
EnsureMatches(expected);