mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-08 10:23:34 +08:00
parent
915b2e7b7f
commit
85a45ae6c9
@ -106,6 +106,24 @@ namespace memory
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
handle range::bruteforce_scan(pattern const& sig)
|
||||
{
|
||||
auto data = sig.m_bytes.data();
|
||||
auto length = sig.m_bytes.size();
|
||||
|
||||
const auto scan_end = m_size - length;
|
||||
for (std::uintptr_t i{}; i != scan_end; ++i)
|
||||
{
|
||||
if (pattern_matches(m_base.add(i).as<std::uint8_t*>(), data, length))
|
||||
{
|
||||
return m_base.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<handle> range::scan_all(pattern const &sig)
|
||||
{
|
||||
std::vector<handle> result{};
|
||||
|
@ -17,6 +17,7 @@ namespace memory
|
||||
bool contains(handle h);
|
||||
|
||||
handle scan(pattern const& sig);
|
||||
handle bruteforce_scan(pattern const& sig);
|
||||
std::vector<handle> scan_all(pattern const& sig);
|
||||
protected:
|
||||
handle m_base;
|
||||
|
@ -345,13 +345,13 @@ namespace big
|
||||
* Freemode thread restorer through VM patch
|
||||
*/
|
||||
|
||||
if (auto pat1 = mem_region.scan("3b 0a 0f 83 ? ? ? ? 48 ff c7"))
|
||||
if (auto pat1 = mem_region.bruteforce_scan("3b 0a 0f 83 ? ? ? ? 48 ff c7"))
|
||||
{
|
||||
*pat1.add(2).as<uint32_t*>() = 0xc9310272;
|
||||
*pat1.add(6).as<uint16_t*>() = 0x9090;
|
||||
}
|
||||
|
||||
if (auto pat2 = mem_region.scan("3b 0a 0f 83 ? ? ? ? 49 03 fa"))
|
||||
if (auto pat2 = mem_region.bruteforce_scan("3b 0a 0f 83 ? ? ? ? 49 03 fa"))
|
||||
{
|
||||
*pat2.add(2).as<uint32_t*>() = 0xc9310272;
|
||||
*pat2.add(6).as<uint16_t*>() = 0x9090;
|
||||
|
Loading…
x
Reference in New Issue
Block a user