Skip to content

Commit

Permalink
fix: Entity struct and remove Vacuum temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiga74164 committed Jun 21, 2024
1 parent 0f2afb1 commit 4a3606f
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 30 deletions.
3 changes: 3 additions & 0 deletions cheat/src/appdata/il2cpp-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ DO_APP_FUNC(0x03A12E40, void, Transform_set_forward, (Transform* __this, Vector3
DO_APP_FUNC(0x03A11F70, int32_t, Transform_get_childCount, (Transform* __this, MethodInfo* method));
DO_APP_FUNC(0x03A2C200, String*, Scene_GetNameInternal, (int32_t sceneHandle, MethodInfo* method));
DO_APP_FUNC(0x03A2ABD0, Scene, SceneManager_GetActiveScene, (MethodInfo* method));
DO_APP_FUNC(0x039B6E20, int32_t, Application_get_targetFrameRate, (MethodInfo* method));
DO_APP_FUNC(0x039B7540, void, Application_set_targetFrameRate, (int32_t value, MethodInfo* method));
DO_APP_FUNC(0x03A0E380, void, Time_3_set_timeScale, (float value, MethodInfo* method));

// No Cooldown
DO_APP_FUNC(0x009B7980, void/*KAAIFMKPKAG*/*, KAAIFMKPKAG_IOFMGMJCCFO, (KAAIFMKPKAG* __this, bool DEJNILEHENL, MethodInfo* method));
Expand Down
36 changes: 21 additions & 15 deletions cheat/src/appdata/il2cpp-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3569,8 +3569,9 @@ namespace app
ECharacterType__Enum AJEHLIOMMJN;
struct CharCommonInfoData* KFIFBINFDPB;
struct CharResourceData* PEFKKKBMDKN;
bool NGLCGPAJJGK;
bool DPJNONIOAFH;
bool GBPOIDLOHNJ;
bool JPBGFNKOFHP;
bool FOEDEMGDJKF;
struct GBJHLCNJLOJ* ILDKBCNAELG;
struct CDCHBPIDJCD* NKONPDBOBAG;
struct PMDPIAPKIOH* KJCAKAHDGIH;
Expand All @@ -3591,19 +3592,24 @@ namespace app
float CLAAFELIGIC;
eCharDeadStep__Enum KKFDEBKACEJ;
eCharDeadStep__Enum BNJHNGLKFPL;
float KEOJBAGNEEL;
int32_t LICJAPCPLEB;
int32_t JHHNIFHFEKM;
struct NmssSvInt* HDOOADICLPI;
bool BKIJFOEGAJI;
struct List_1_NGame_SkillUnitIdentity_* DMMKIMMGCND;
struct List_1_ENNEJEPMJLJ_* NEDACNMODEB;
struct NPPEDAMJEJN* DLMMJPACLJA;
bool GFDMJEPIKAI;
int32_t FJNGPGFMHBC;
int32_t PMLDLGALKKL;
int32_t JPFAPNECDGA;
struct GDGHJFBGAKC* FFDMOEIKOLA;
float BNOGNCGFJDL;
int32_t LDHKJNBHKHM;
int32_t LHDKJIGLOBL;
struct NmssSvInt* HPBMNIPEIFJ;
bool GODMHNKIDMM;
struct List_1_NGame_SkillUnitIdentity_* HEAPGLGMOFJ;
struct List_1_DOMJFCNEJMK_* CNFEIDKBMGP;
struct AIDDAOICKLF* BMEMLFJAJCA;
bool PCENLAEDFLI;
int32_t NFNOGFNAIFI;
int32_t BKJPEKIKLPI;
int32_t NACMOENBDMK;
struct NmssSvLong* OOFCBNHHAJP;
struct DBDAGCOEKFH* BLGJDOKOAKM;
float HKPPLOMKGEO;
float CBHPPAEFDBE;
bool NGHOPOBNIBG;
struct POGEGLODJOC* HGPHIMABFAF;
};

struct ENNEJEPMJLJ
Expand Down
2 changes: 1 addition & 1 deletion cheat/src/cheat/cheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void init_cheat()
INIT_FEATURE(NoCooldown);
INIT_FEATURE(DamageHack);
INIT_FEATURE(GodMode);
INIT_FEATURE(MobVacuum);
//INIT_FEATURE(MobVacuum);
INIT_FEATURE(DumbEnemies);
INIT_FEATURE(MissionTime);
INIT_FEATURE(TimeScale);
Expand Down
24 changes: 15 additions & 9 deletions cheat/src/cheat/features/EntityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Cheat::Features

void EntityManager::OnEnemyUpdate()
{
if (m_pPlayer && m_pEnemiesVec.empty())
if (m_pPlayer == nullptr && m_pEnemiesVec.empty())
return;

for (auto& enemy : m_pEnemiesVec)
Expand All @@ -55,6 +55,10 @@ namespace Cheat::Features

bool EntityManager::IsCharacterAlive(app::ENNEJEPMJLJ* character)
{
if (character == nullptr &&
character->fields.NKONPDBOBAG->fields.IALANALADIL->fields.HOAFECEANLC->fields._.m_CachedPtr == nullptr)
return false;

return app::PCILGJOEPJM_PPAKPBOJLIP(character, nullptr);
}

Expand Down Expand Up @@ -86,21 +90,23 @@ namespace Cheat::Features
auto ret = CALL_ORIGIN(ENNEJEPMJLJ_FIGHFBNIDJA_Hook, __this, method);

if (__this != nullptr &&
__this->fields.NKONPDBOBAG->fields.IALANALADIL->fields.HOAFECEANLC->fields._.m_CachedPtr != nullptr)
__this->fields.NKONPDBOBAG->fields.IALANALADIL->fields.HOAFECEANLC->fields._.m_CachedPtr != nullptr &&
__this->fields.AJEHLIOMMJN != app::ECharacterType__Enum::None)
{
//LOG(xorstr("resourceName %s"), il2cppi_to_string(__this->fields.PEFKKKBMDKN->fields.m_ResourceName).c_str());
//LOG(xorstr("CharType %s"), magic_enum::enum_name(__this->fields.AJEHLIOMMJN).data());

if (__this->fields.FHNGHHPLPGD == app::eCharGroup__Enum::PLAYER)
if (__this->fields.FHNGHHPLPGD == app::eCharGroup__Enum::PLAYER &&
__this->fields.AJEHLIOMMJN == app::ECharacterType__Enum::Hunter)
{
em.m_pPlayer = __this;
em.m_pPlayerGO = __this->fields.NKONPDBOBAG->fields.IALANALADIL->fields.HOAFECEANLC;
//em.m_pPlayer = __this;
//em.m_pPlayerGO = __this->fields.NKONPDBOBAG->fields.IALANALADIL->fields.HOAFECEANLC;
}

if (__this->fields.FHNGHHPLPGD == app::eCharGroup__Enum::ENEMY)
else if (__this->fields.FHNGHHPLPGD == app::eCharGroup__Enum::ENEMY &&
__this->fields.AJEHLIOMMJN == app::ECharacterType__Enum::Monster)
{
if (std::find(em.m_pEnemiesVec.begin(), em.m_pEnemiesVec.end(), __this) == em.m_pEnemiesVec.end())
em.m_pEnemiesVec.push_back(__this);
//if (std::find(em.m_pEnemiesVec.begin(), em.m_pEnemiesVec.end(), __this) == em.m_pEnemiesVec.end())
// em.m_pEnemiesVec.push_back(__this);
}
}

Expand Down
4 changes: 2 additions & 2 deletions cheat/src/cheat/features/FPSUnlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ namespace Cheat::Features

if (m_LastEnableStatus && !vars.FPSUnlock.value())
{
methods::Application::SetTargetFrameRate(m_OriginFPS);
app::Application_set_targetFrameRate(m_OriginFPS, nullptr);
}
else if (!m_LastEnableStatus && vars.FPSUnlock.value())
{
m_OriginFPS = methods::Application::GetTargetFrameRate();
m_OriginFPS = app::Application_get_targetFrameRate(nullptr);
}
m_LastEnableStatus = vars.FPSUnlock.value();
if (vars.FPSUnlock.value())
Expand Down
6 changes: 3 additions & 3 deletions cheat/src/cheat/features/TimeScale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ namespace Cheat::Features
{
auto& vars = Vars::GetInstance();

if (vars.TimeScale.value())
if (vars.TimeScale.value() && !m_DidSpeed)
{
UnityResolve::UnityType::Time::SetTimeScale(vars.TimeScaleSpeed.value());
app::Time_3_set_timeScale(vars.TimeScaleSpeed.value(), nullptr);
m_DidSpeed = true;
}
else
{
if (m_DidSpeed)
{
UnityResolve::UnityType::Time::SetTimeScale(1.0f);
app::Time_3_set_timeScale(1.0f, nullptr);
m_DidSpeed = false;
}
}
Expand Down

0 comments on commit 4a3606f

Please sign in to comment.