Skip to content

Commit

Permalink
Possible fix for thread pools
Browse files Browse the repository at this point in the history
  • Loading branch information
SaneEngineer committed Jun 20, 2020
1 parent ef91eb7 commit 0259e6a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OpenVHook/Scripting/Pools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bool CPools::Initialize()
LOG_ERROR("Unable to find pedPoolPattern");
return false;
}
m_pPedPool = reinterpret_cast<decltype(m_pPedPool)>(location + *(int32_t*)location + 4);
m_pPedPool = reinterpret_cast<decltype(m_pPedPool)>(location + *(int32_t*)location + 7);
LOG_DEBUG("pedPool\t 0x%p (0x%.8X)", m_pPedPool, reinterpret_cast<uintptr_t>(m_pPedPool) - executable.begin());

auto objectPoolPattern = pattern("48 8B 05 ? ? ? ? 8B 78 10 85 FF");
Expand All @@ -30,7 +30,7 @@ bool CPools::Initialize()
LOG_ERROR("Unable to find objectPoolPattern");
return false;
}
m_pObjectPool = reinterpret_cast<decltype(m_pObjectPool)>(location + *(int32_t*)location + 4);
m_pObjectPool = reinterpret_cast<decltype(m_pObjectPool)>(location + *(int32_t*)location + 7);
LOG_DEBUG("objectPool\t 0x%p (0x%.8X)", m_pObjectPool, reinterpret_cast<uintptr_t>(m_pObjectPool) - executable.begin());

auto pickupPoolPattern = pattern("4C 8B 05 ? ? ? ? 40 8A F2 8B E9");
Expand All @@ -41,7 +41,7 @@ bool CPools::Initialize()
LOG_ERROR("Unable to find pickupsPoolPattern");
return false;
}
m_pPickupsPool = reinterpret_cast<decltype(m_pPickupsPool)>(location + *(int32_t*)location + 4);
m_pPickupsPool = reinterpret_cast<decltype(m_pPickupsPool)>(location + *(int32_t*)location + 7);
LOG_DEBUG("pickupsPool\t 0x%p (0x%.8X)", m_pPickupsPool, reinterpret_cast<uintptr_t>(m_pPickupsPool) - executable.begin());

auto vehiclePoolPattern = pattern("48 8B 05 ? ? ? ? F3 0F 59 F6 48 8B 08");
Expand All @@ -52,7 +52,7 @@ bool CPools::Initialize()
LOG_ERROR("Unable to find vehiclePoolPattern");
return false;
}
m_pVehiclePool = reinterpret_cast<decltype(m_pVehiclePool)>(location + *(int32_t*)location + 4);
m_pVehiclePool = reinterpret_cast<decltype(m_pVehiclePool)>(location + *(int32_t*)location + 7);
LOG_DEBUG("vehiclePool\t 0x%p (0x%.8X)", m_pVehiclePool, reinterpret_cast<uintptr_t>(m_pVehiclePool) - executable.begin());

auto entityPoolPattern = pattern("4C 8B 0D ? ? ? ? 44 8B C1 49 8B 41 08");
Expand All @@ -63,7 +63,7 @@ bool CPools::Initialize()
LOG_ERROR("Unable to find entityPoolPattern");
return false;
}
m_pEntityPool = reinterpret_cast<decltype(m_pEntityPool)>(location + *(int32_t*)location + 4);
m_pEntityPool = reinterpret_cast<decltype(m_pEntityPool)>(location + *(int32_t*)location + 7);
LOG_DEBUG("entityPool\t 0x%p (0x%.8X)", m_pEntityPool, reinterpret_cast<uintptr_t>(m_pEntityPool) - executable.begin());

LOG_PRINT("Pool Init Finished");
Expand Down

0 comments on commit 0259e6a

Please sign in to comment.