diff --git a/include/Luna/Hook/LunaHook.hpp b/include/Luna/Hook/LunaHook.hpp index 23d0ad2..f8ea6bf 100644 --- a/include/Luna/Hook/LunaHook.hpp +++ b/include/Luna/Hook/LunaHook.hpp @@ -37,6 +37,7 @@ class LunaHookThread static void DetourHeader(LunaHookThread*); static void DetourFooter(LunaHookThread*); class CodeBuffer; + public: typedef unsigned int (__cdecl* LunaWrapper)(...); @@ -58,6 +59,7 @@ class LunaHookThread size_t GetCodeSize(); unsigned char AddToBuffer(unsigned char* BufferStart, unsigned short StackOffset); void Encode(CodeBuffer*, char StackOffset = 0); + char EncodeIn(CodeBuffer*, char StackOffset); Parameter(u8 StackOffset = 0); Parameter(Register32); }; @@ -88,6 +90,7 @@ class LunaHookThread void Finalize(void* DetourTo); LunaWrapper AllocateWrapper(); + LunaWrapper FinalizeAndWrap(void* DetourTo); static FunctionSignature* New(LunaHookThread*, DWORD Address); }; diff --git a/include/Lunacy/Lawn.h b/include/Lunacy/Lawn.h index 6b8d523..457f992 100644 --- a/include/Lunacy/Lawn.h +++ b/include/Lunacy/Lawn.h @@ -281,20 +281,25 @@ class Lawn : Sexy::UIElement, Sexy::ButtonListener bool IsPoolCell(int Col, int Row); bool IsIceCell(int Col, int Row); + void PlantHitTest(int MouseX, int MouseY, HitResult*); + void MouseHitTest(int, int, HitResult*); + GridItem* GridItemHitTest(int MouseX, int MouseY); Zombie* ZombieHitTest(int MouseX, int MouseY); Plant* PlantHitTest(int MouseX, int MouseY); Plant* SpecialPlantHitTest(int MouseX, int MouseY); - bool MouseHitTest(int X, int Y, HitResult* Out); void PickUpTool(GameObjectType); bool CanInteractWithButtons(); void SetPause(bool); void ClearCursor(); + void HighlightPlantsForMouse(int X, int Y); + void PickSpecialGraveStone(); void UpdateMousePosition(); void UpdateToolTip(); void MouseDownWithPlant(int X, int Y, ClickCode); + void MouseDownCobcannonFire(int X, int Y, ClickCode); void MouseDownWithTool(int X, int Y, ClickCode, CursorType); void ShowTutorialArrow(int X, int Y); @@ -309,6 +314,9 @@ class Lawn : Sexy::UIElement, Sexy::ButtonListener void __inline ZombiesWon() { ZombiesWon(NewZombie(ZOMBIE_NORMAL, 0)); } bool IsFinalSurvivalStage(); + bool IsFinalScaryPotterStage(); + bool IsSurvivalStageWithRepick(); + bool IsLastStandStageWithRepick(); bool LevelAwardDropped(); void UpdateSunSkyfall(); void UpdateZombieSpawning(); @@ -321,7 +329,8 @@ class Lawn : Sexy::UIElement, Sexy::ButtonListener void ClearFogAroundPlant(Plant*, int Size); void UpdateFog(); - void DrawIce(Sexy::Graphics*); + void DrawZenWheelBarrowButton(Sexy::Graphics*, int YOffset); + void DrawIce(Sexy::Graphics*, int Lane); void DrawBackground(Sexy::Graphics*); void DrawProgressMeter(Sexy::Graphics*); void DrawHouseDoorBottom(Sexy::Graphics*); @@ -350,6 +359,8 @@ class Lawn : Sexy::UIElement, Sexy::ButtonListener int GetSunBeingCollected(); int GetCoinsBeingCollected(); int GetNumSeedsInBank(); + int GetNumWavesPerSurvivalStage(); + void RemoveParticleSystemByType(ParticleEffect); bool IsConveyorBeltLevel(); bool StageHasGraves(); @@ -361,6 +372,7 @@ class Lawn : Sexy::UIElement, Sexy::ButtonListener bool StageHasZombiesWalkInFromRight(); int GetSeedPacketXPosition(int PacketIndex); int GetSeedBankExtraWidth(); + Plant* FindUmbrellaPlant(int Col, int Row); bool SeedNotRecommendedForLevel(SeedType); bool CanDropLoot(); @@ -369,6 +381,8 @@ class Lawn : Sexy::UIElement, Sexy::ButtonListener void DoFwoosh(int Row); void UpdateFwoosh(); bool PlantingRequirementsMet(SeedType); + bool PlantUsesAcceleratedPricing(SeedType); + int GetCurrentPlantCost(SeedType Type, SeedType ImitaterType = SeedType::SEED_NONE); #pragma endregion diff --git a/include/Lunacy/Rect.h b/include/Lunacy/Rect.h index 2eca6cb..aa85407 100644 --- a/include/Lunacy/Rect.h +++ b/include/Lunacy/Rect.h @@ -27,10 +27,8 @@ class Sexy::Rect Rect(N X = 0, N Y = 0, N W = 0, N H = 0) { - mX = X; - mY = Y; - mW = W; - mH = H; + mPosition = Vector2(0, 0); + mSize = Vector2(0, 0); } Rect(Vector2 Position, Vector2 Size) diff --git a/include/Lunacy/Zombie.h b/include/Lunacy/Zombie.h index ca8fb46..7452220 100644 --- a/include/Lunacy/Zombie.h +++ b/include/Lunacy/Zombie.h @@ -164,6 +164,7 @@ class Zombie : public GameObject GetTrackPosition(TrackName, out.mX, out.mY); return out; } + int GetBobsledPosition(); void DropLoot(); void Die(bool DropLoot = true); @@ -196,6 +197,9 @@ class Zombie : public GameObject void ReanimIgnoreClipRect(const char* TrackName, bool DoIgnore = true); void EnableClipping(); void LoadPlainZombieReanim(); + void TrySpawnLevelAward(); + void RemoveIceTrap(); + void HitIceTrap(); void PickBungeeZombieTarget(int Column = -1); void BungeeDropZombie(Zombie*, int Col, int Row); @@ -258,6 +262,11 @@ class Zombie : public GameObject void UpdateZombiePosition(); void UpdateZombieInChimney(); void UpdateZombieHighGround(); + void UpdateZombieChimney(); + void BossPlayIdle(); + void DrawBossFireBall(Sexy::Graphics*); + void UpdateDamageStates(DamageFlag); + void UpdateActions(); bool IsTangleKelpTarget(); bool IsWalkingBackwards(); @@ -268,13 +277,14 @@ class Zombie : public GameObject bool IsOnBoard(); bool IsFlying(); - void DropShield(); + void DropShield(DamageFlag); + void DropHelm(DamageFlag); + void DropHead(DamageFlag); + void DropArm(DamageFlag); void DropFlag(); void DropPole(); - void DropHead(); - void DropArm(); - bool CanTargetPlant(ZombieAttackType, Plant*); + bool CanTargetPlant(Plant*, ZombieAttackType = ZombieAttackType::ATTACKTYPE_CHEW); Plant* FindPlantTarget(ZombieAttackType); Zombie* FindZombieTarget(); void StartWalking(int BlendTime); diff --git a/src/Luna/Hook/LunaHook.cpp b/src/Luna/Hook/LunaHook.cpp index 90a037b..c136634 100644 --- a/src/Luna/Hook/LunaHook.cpp +++ b/src/Luna/Hook/LunaHook.cpp @@ -36,6 +36,12 @@ class LunaHookThread::CodeBuffer iPtr++; } + void EncodeByte(char Value) + { + *cPtr = Value; + cPtr++; + } + void EncodePop(LunaHookThread::Register32 Reg) { *cPtr = (0x58 + Reg); @@ -233,6 +239,26 @@ void LunaHookThread::Parameter::Encode(CodeBuffer* Buffer, char StackOffset) Buffer->EncodeStackPush(mStackOffset + StackOffset); } +char LunaHookThread::Parameter::EncodeIn(CodeBuffer* Buffer, char StackOffset) +{ + if (isRegister) + { + Buffer->EncodeByte(0x8B); + Buffer->EncodeByte(0x44 + 0x8 * mRegister); + Buffer->EncodeByte(0x24); + Buffer->EncodeByte(StackOffset); + return 0x00; + } + else + { + Buffer->EncodeByte(0xFF); + Buffer->EncodeByte(0x74); + Buffer->EncodeByte(0x24); + Buffer->EncodeByte(StackOffset); + return 0x04; + } +} + void LunaHookThread::SetReturn(DWORD Value) { _registers[EAX] = Value; @@ -443,20 +469,19 @@ void LunaHookThread::FunctionSignature::Finalize(void* DetourTo) LunaHookThread::LunaWrapper LunaHookThread::FunctionSignature::AllocateWrapper() { /* Base Wrapper: - * push non-volatile registers (ebx, ebp, esi, edi) // Preserving non-volatile registers + * push non-volatile registers (ebx, ebp, esi, edi) // Preserving non-volatile registers (0x04) * - * mov & push params in correct order // Moving and pushing function parameters - * push L0 // Pushing return address for cleanup (L0) + * mov & push params in correct order // Moving and pushing function parameters (_paramCodeSize) + * push L0 // Pushing return address for cleanup (L0) (0x05) * - * original hook code // Executing the code that was overwritten + * original hook code // Executing the code that was overwritten (_origCodeSize) * - * push funcaddr + hook code size // Pushing the address to return to after the original function call - * ret // Returning from the function + * push funcaddr + hook code size // Pushing the address to return to after the original function call (0x05) + * ret // Returning from the function (0x01) * * L0: - * pop non-volatile registers // Restoring the saved registers - * add esp PopBytes // Cleaning up the stack if necessary (for __stdcall convention) - * ret // Returning from the wrapper + * pop non-volatile registers // Restoring the saved registers (0x04) + * ret // Returning from the wrapper (0x01) */ // Unlock bytes near hook for execution @@ -468,8 +493,11 @@ LunaHookThread::LunaWrapper LunaHookThread::FunctionSignature::AllocateWrapper() // Backup the original code memcpy(_origCode, (const void*)_addr, _origCodeSize); + // Calculate _paramCodeSize + _paramCodeSize = _paramCount * 4; + // Calculate the total size of the generated wrapper - size_t WrapperSize = 0x20 + _paramCodeSize + _origCodeSize; // Base size + params + original overwritten code + size_t WrapperSize = 0x0F + _paramCodeSize + _origCodeSize; // Base size + params + original overwritten code CodeBuffer Wrapper(WrapperSize); // 1. Push non-volatile registers (ebx, ebp, esi, edi) @@ -480,17 +508,23 @@ LunaHookThread::LunaWrapper LunaHookThread::FunctionSignature::AllocateWrapper() // 2. Push all parameters in reverse order (stack parameters first, then registers) int cParam = _paramCount - 1; - size_t StackOffset = 0; + size_t StackOffset = 0x14;// non-volatile registers padded the stack by 0x10 bytes. Return address +0x04 bytes. while (cParam >= 0) { + // Param = StackOffset + 0x4 * ParamIndex + size_t ParamLocation = StackOffset + (0x04 * cParam);// Location of the parameter on the stack auto aParam = _parameters[cParam]; - aParam.Encode(&Wrapper, StackOffset); - StackOffset += 0x4; + StackOffset += aParam.EncodeIn(&Wrapper, ParamLocation); cParam--; + + // aParam._isRegister: + // Encodes a mov reg, [esp + ParamLocation] and returns 0 + // else: + // Encodes a push [esp + ParamLocation] and returns 4 } // 3. Push L0 (return address for cleanup after function call) - Wrapper.EncodePush(Wrapper.oPtr + 0x10 + _paramCodeSize); + Wrapper.EncodePush(Wrapper.oPtr + 0x0F + _paramCodeSize + _origCodeSize); // 4. Copy the original code (that was overwritten by the hook) into the wrapper Wrapper.Copy(_origCode, _origCodeSize); @@ -512,4 +546,11 @@ LunaHookThread::LunaWrapper LunaHookThread::FunctionSignature::AllocateWrapper() // Return the wrapper function (cast it as a LunaWrapper function pointer) return (LunaWrapper)Wrapper.oPtr; +} + +LunaHookThread::LunaWrapper LunaHookThread::FunctionSignature::FinalizeAndWrap(void* DetourTo) +{ + auto Wrapper = AllocateWrapper(); + Finalize(DetourTo); + return Wrapper; } \ No newline at end of file diff --git a/src/Lunacy/Lawn.cpp b/src/Lunacy/Lawn.cpp index ec34a50..bb7bbdf 100644 --- a/src/Lunacy/Lawn.cpp +++ b/src/Lunacy/Lawn.cpp @@ -663,6 +663,35 @@ int Lawn::CountPlants(SeedType Filter) return Count; } +Plant* Lawn::PlantHitTest(int X, int Y) +{ + HitResult aRes; + PlantHitTest(X, Y, &aRes); + return (Plant*)aRes.aObject; +} + +GridItem* Lawn::GridItemHitTest(int X, int Y) +{ + auto aItem = mGridItems.GetNext(); + GridItem* aRes = nullptr; + int aResRenderOrder = -RENDER_ITEM_GRID_ITEM; + while (aItem) + { + auto aHitbox = GridToPixelArea(aItem->mCol, aItem->mRow, 1, 1); + if (!aHitbox.Contains(Sexy::IVector2(X, Y))) goto Skip; + if (aRes == nullptr || (aResRenderOrder < aItem->mRenderOrder)) + { + aRes = aItem; + aResRenderOrder = aItem->mRenderOrder; + } + + Skip: + aItem = mGridItems.GetNext(aItem); + } + + return aRes; +} + #pragma region Base Functions __declspec(naked) void __stdcall ConstructLawn(Lawn*, LawnApp*) { @@ -1071,4 +1100,1359 @@ __declspec(naked) void Lawn::RemoveAllZombies() ret } } -#pragma endregion \ No newline at end of file +#pragma endregion + +#pragma region Autogen Functions +constexpr unsigned int LAWN_REMOVEZOMBIESFORREPICK = 0x40DF00; +__declspec(naked) void Lawn::RemoveZombiesForRepick() +{ + __asm + { + push edi + + mov edi, ecx + call LAWN_REMOVEZOMBIESFORREPICK + + pop edi + ret 0x0 + } +} + +constexpr unsigned int LAWN_REMOVECUTSCENEZOMBIES = 0x40DF70; +__declspec(naked) void Lawn::RemoveCutsceneZombies() +{ + __asm + { + push ebx + + mov ebx, ecx + call LAWN_REMOVECUTSCENEZOMBIES + + pop ebx + ret 0x0 + } +} + +constexpr unsigned int LAWN_PICKZOMBIEWAVES = 0x4092E0; +__declspec(naked) void Lawn::PickZombieWaves() +{ + __asm + { + push edi + + mov edi, ecx + call LAWN_PICKZOMBIEWAVES + + pop edi + ret 0x0 + } +} + +constexpr unsigned int LAWN_CANPLANTAT = 0x40E020; +__declspec(naked) bool Lawn::CanPlantAt(int, int, SeedType) +{ + __asm + { + + push[esp + 0xC] + push[esp + 0xC] + mov eax, [esp + 0xC] + push ecx + call LAWN_CANPLANTAT + + ret 0xC + } +} + +constexpr unsigned int LAWN_ISICEAT = 0x40DFC0; +__declspec(naked) bool Lawn::IsIceCell(int, int) +{ + __asm + { + push esi + + mov eax, [esp + 0xC] + push[esp + 0x8] + mov esi, ecx + call LAWN_ISICEAT + + pop esi + ret 0x8 + } +} + +constexpr unsigned int LAWN_ZOMBIEHITTEST = 0x40E780; +__declspec(naked) Zombie* Lawn::ZombieHitTest(int, int) +{ + __asm + { + + push[esp + 0x8] + push[esp + 0x8] + push ecx + call LAWN_ZOMBIEHITTEST + + ret 0x8 + } +} + +constexpr unsigned int LAWN_HIGHLIGHTPLANTSFORMOUSE = 0x40E940; +__declspec(naked) void Lawn::HighlightPlantsForMouse(int, int) +{ + __asm + { + push edi + + push[esp + 0xC] + push[esp + 0xC] + mov edi, ecx + call LAWN_HIGHLIGHTPLANTSFORMOUSE + + pop edi + ret 0x8 + } +} + +constexpr unsigned int LAWN_SPECIALPLANTHITTEST = 0x411280; +__declspec(naked) Plant* Lawn::SpecialPlantHitTest(int, int) +{ + __asm + { + push edi + + push[esp + 0xC] + push[esp + 0xC] + mov edi, ecx + call LAWN_SPECIALPLANTHITTEST + + pop edi + ret 0x8 + } +} + +constexpr unsigned int LAWN_MOUSEHITTESTPLANT = 0x411470; +__declspec(naked) void Lawn::PlantHitTest(int, int, HitResult*) +{ + __asm + { + push esi + + push[esp + 0x10] + push[esp + 0x10] + push[esp + 0x10] + mov esi, ecx + call LAWN_MOUSEHITTESTPLANT + + pop esi + ret 0xC + } +} + +constexpr unsigned int LAWN_MOUSEHITTEST = 0x411730; +__declspec(naked) void Lawn::MouseHitTest(int, int, HitResult*) +{ + __asm + { + + push[esp + 0xC] + push[esp + 0xC] + push[esp + 0xC] + push ecx + call LAWN_MOUSEHITTEST + + ret 0xC + } +} + +constexpr unsigned int LAWN_PICKUPTOOL = 0x411C10; +__declspec(naked) void Lawn::PickUpTool(GameObjectType) +{ + __asm + { + push ebx + + mov edx, [esp + 0x8] + mov ebx, ecx + call LAWN_PICKUPTOOL + + pop ebx + ret 0x4 + } +} + +constexpr unsigned int LAWN_CLEARCURSOR = 0x412330; +__declspec(naked) void Lawn::ClearCursor() +{ + __asm + { + push edi + + mov edi, ecx + call LAWN_CLEARCURSOR + + pop edi + ret 0x0 + } +} + +constexpr unsigned int LAWN_CANINTERACTWITHLAWNBUTTONS = 0x412490; +__declspec(naked) bool Lawn::CanInteractWithButtons() +{ + __asm + { + push esi + + mov esi, ecx + call LAWN_CANINTERACTWITHLAWNBUTTONS + + pop esi + ret 0x0 + } +} + +constexpr unsigned int LAWN_PAUSE = 0x4127A0; +__declspec(naked) void Lawn::SetPause(bool) +{ + __asm + { + push al + + mov al, [esp + 0x8] + mov ecx, ecx + call LAWN_PAUSE + + pop al + ret 0x4 + } +} + +constexpr unsigned int LAWN_PICKSPECIALGRAVESTONE = 0x412890; +__declspec(naked) void Lawn::PickSpecialGraveStone() +{ + __asm + { + + mov edx, ecx + call LAWN_PICKSPECIALGRAVESTONE + + ret 0x0 + } +} + +constexpr unsigned int LAWN_TOTALZOMBIESHEALTHINWAVE = 0x412E30; +__declspec(naked) int Lawn::GetWaveHealth(int) +{ + __asm + { + push ebx + + push[esp + 0x8] + mov ebx, ecx + call LAWN_TOTALZOMBIESHEALTHINWAVE + + pop ebx + ret 0x4 + } +} + +constexpr unsigned int LAWN_SPAWNZOMBIEWAVE = 0x412EE0; +__declspec(naked) void Lawn::SpawnNextWave() +{ + __asm + { + push edi + + mov edi, ecx + call LAWN_SPAWNZOMBIEWAVE + + pop edi + ret 0x0 + } +} + +constexpr unsigned int LAWN_STOPALLZOMBIESOUNDS = 0x413220; +__declspec(naked) void Lawn::StopZombieSounds() +{ + __asm + { + push edi + + mov edi, ecx + call LAWN_STOPALLZOMBIESOUNDS + + pop edi + ret 0x0 + } +} + +constexpr unsigned int LAWN_GETSURVIVALFLAGSCOMPLETED = 0x413260; +__declspec(naked) int Lawn::GetSurvivalFlagsCompleted() +{ + __asm + { + push esi + + mov esi, ecx + call LAWN_GETSURVIVALFLAGSCOMPLETED + + pop esi + ret 0x0 + } +} + +constexpr unsigned int LAWN_ZOMBIESWON = 0x413400; +__declspec(naked) void Lawn::ZombiesWon(Zombie*) +{ + __asm + { + pop eax + push ecx + push eax + + jmp LAWN_ZOMBIESWON + } +} + +constexpr unsigned int LAWN_ISFINALSCARYPOTTERSTAGE = 0x4138D0; +__declspec(naked) bool Lawn::IsFinalScaryPotterStage() +{ + __asm + { + + mov edx, ecx + call LAWN_ISFINALSCARYPOTTERSTAGE + + ret 0x0 + } +} + +constexpr unsigned int LAWN_ISFINALSURVIVALSTAGE = 0x413920; +__declspec(naked) bool Lawn::IsFinalSurvivalStage() +{ + __asm + { + push edi + + mov edi, ecx + call LAWN_ISFINALSURVIVALSTAGE + + pop edi + ret 0x0 + } +} + +constexpr unsigned int LAWN_ISSURVIVALSTAGEWITHREPICK = 0x4139E0; +__declspec(naked) bool Lawn::IsSurvivalStageWithRepick() +{ + __asm + { + + mov eax, ecx + call LAWN_ISSURVIVALSTAGEWITHREPICK + + ret 0x0 + } +} + +constexpr unsigned int LAWN_ISLASTSTANDSTAGEWITHREPICK = 0x413A10; +__declspec(naked) bool Lawn::IsLastStandStageWithRepick() +{ + __asm + { + + mov eax, ecx + call LAWN_ISLASTSTANDSTAGEWITHREPICK + + ret 0x0 + } +} + +constexpr unsigned int LAWN_HASLEVELAWARDDROPPED = 0x413A40; +__declspec(naked) bool Lawn::LevelAwardDropped() +{ + __asm + { + + mov eax, ecx + call LAWN_HASLEVELAWARDDROPPED + + ret 0x0 + } +} + +constexpr unsigned int LAWN_UPDATESUNSPAWNING = 0x413A70; +__declspec(naked) void Lawn::UpdateSunSkyfall() +{ + __asm + { + push esi + + mov esi, ecx + call LAWN_UPDATESUNSPAWNING + + pop esi + ret 0x0 + } +} + +constexpr unsigned int LAWN_UPDATEZOMBIESPAWNING = 0x413D00; +__declspec(naked) void Lawn::UpdateZombieSpawning() +{ + __asm + { + + mov ecx, ecx + call LAWN_UPDATEZOMBIESPAWNING + + ret 0x0 + } +} + +constexpr unsigned int LAWN_UPDATEICE = 0x414100; +__declspec(naked) void Lawn::UpdateIce() +{ + __asm + { + + push ecx + call LAWN_UPDATEICE + + ret 0x0 + } +} + +constexpr unsigned int LAWN_UPDATEPROGRESSMETER = 0x414270; +__declspec(naked) void Lawn::UpdateProgressMeter() +{ + __asm + { + + mov eax, ecx + call LAWN_UPDATEPROGRESSMETER + + ret 0x0 + } +} + +constexpr unsigned int LAWN_ROWCANHAVEZOMBIES = 0x416110; +__declspec(naked) bool Lawn::CanSpawnZombiesInLane(int) +{ + __asm + { + + mov eax, [esp + 0x4] + mov ecx, ecx + call LAWN_ROWCANHAVEZOMBIES + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWICE = 0x416140; +__declspec(naked) void Lawn::DrawIce(Sexy::Graphics*, int) +{ + __asm + { + + mov eax, [esp + 0x8] + push[esp + 0x4] + mov ecx, ecx + call LAWN_DRAWICE + + ret 0x8 + } +} + +constexpr unsigned int LAWN_DRAWBACKDROP = 0x416290; +__declspec(naked) void Lawn::DrawBackground(Sexy::Graphics*) +{ + __asm + { + + push[esp + 0x4] + push ecx + call LAWN_DRAWBACKDROP + + ret 0x4 + } +} + +constexpr unsigned int LAWN_HASPROGRESSMETER = 0x4173C0; +__declspec(naked) bool Lawn::HasProgressMeter() +{ + __asm + { + + mov edx, ecx + call LAWN_HASPROGRESSMETER + + ret 0x0 + } +} + +constexpr unsigned int LAWN_PROGRESSMETERHASFLAGS = 0x417450; +__declspec(naked) bool Lawn::ProgressMeterHasFlags() +{ + __asm + { + + mov edx, ecx + call LAWN_PROGRESSMETERHASFLAGS + + ret 0x0 + } +} + +constexpr unsigned int LAWN_DRAWPROGRESSMETER = 0x417500; +__declspec(naked) void Lawn::DrawProgressMeter(Sexy::Graphics*) +{ + __asm + { + + push[esp + 0x4] + push ecx + call LAWN_DRAWPROGRESSMETER + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWHOUSEDOORBOTTOM = 0x417C80; +__declspec(naked) void Lawn::DrawHouseDoorBottom(Sexy::Graphics*) +{ + __asm + { + + mov eax, [esp + 0x4] + mov ecx, ecx + call LAWN_DRAWHOUSEDOORBOTTOM + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWHOUSEDOORTOP = 0x417CF0; +__declspec(naked) void Lawn::DrawHouseDoorTop(Sexy::Graphics*) +{ + __asm + { + + mov eax, [esp + 0x4] + mov ecx, ecx + call LAWN_DRAWHOUSEDOORTOP + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWZENWHEELBARROWBUTTON = 0x4182D0; +__declspec(naked) void Lawn::DrawZenWheelBarrowButton(Sexy::Graphics*, int) +{ + __asm + { + + push[esp + 0x8] + push[esp + 0x8] + push ecx + call LAWN_DRAWZENWHEELBARROWBUTTON + + ret 0x8 + } +} + +constexpr unsigned int LAWN_DRAWZENBUTTONS = 0x418500; +__declspec(naked) void Lawn::DrawZenButtons(Sexy::Graphics*) +{ + __asm + { + + push[esp + 0x4] + push ecx + call LAWN_DRAWZENBUTTONS + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWSHOVEL = 0x418B70; +__declspec(naked) void Lawn::DrawShovel(Sexy::Graphics*) +{ + __asm + { + + push[esp + 0x4] + push ecx + call LAWN_DRAWSHOVEL + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWDEBUGTEXT = 0x418C70; +__declspec(naked) void Lawn::DrawDebugText(Sexy::Graphics*) +{ + __asm + { + push edi + + push[esp + 0x8] + mov edi, ecx + call LAWN_DRAWDEBUGTEXT + + pop edi + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWDEBUGOBJECTRECTS = 0x419AE0; +__declspec(naked) void Lawn::DrawObjectRects(Sexy::Graphics*) +{ + __asm + { + + push[esp + 0x4] + push ecx + call LAWN_DRAWDEBUGOBJECTRECTS + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWFADEOUT = 0x419EB0; +__declspec(naked) void Lawn::DrawFadeOut(Sexy::Graphics*) +{ + __asm + { + push ebx + + mov ebx, [esp + 0x8] + mov eax, ecx + call LAWN_DRAWFADEOUT + + pop ebx + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWTOPRIGHTUI = 0x419F60; +__declspec(naked) void Lawn::DrawTopRightUI(Sexy::Graphics*) +{ + __asm + { + push ebx + + push[esp + 0x8] + mov ebx, ecx + call LAWN_DRAWTOPRIGHTUI + + pop ebx + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWUIBOTTOM = 0x41A0A0; +__declspec(naked) void Lawn::DrawBottomUI(Sexy::Graphics*) +{ + __asm + { + push edi + + mov edi, [esp + 0x8] + push ecx + call LAWN_DRAWUIBOTTOM + + pop edi + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWUICOINBANK = 0x41A2A0; +__declspec(naked) void Lawn::DrawCoinBank(Sexy::Graphics*) +{ + __asm + { + push edi + + mov edi, [esp + 0x8] + push ecx + call LAWN_DRAWUICOINBANK + + pop edi + ret 0x4 + } +} + +constexpr unsigned int LAWN_CLEARFOGAROUNDPLANT = 0x41A430; +__declspec(naked) void Lawn::ClearFogAroundPlant(Plant*, int) +{ + __asm + { + push ebx + + mov ebx, [esp + 0xC] + push[esp + 0x8] + push ecx + call LAWN_CLEARFOGAROUNDPLANT + + pop ebx + ret 0x8 + } +} + +constexpr unsigned int LAWN_UPDATEFOG = 0x41A5D0; +__declspec(naked) void Lawn::UpdateFog() +{ + __asm + { + + push ecx + call LAWN_UPDATEFOG + + ret 0x0 + } +} + +constexpr unsigned int LAWN_DRAWFOG = 0x41A730; +__declspec(naked) void Lawn::DrawFog(Sexy::Graphics*) +{ + __asm + { + + push [esp + 0x4] + push ecx + call LAWN_DRAWFOG + + ret 0x4 + } +} + +constexpr unsigned int LAWN_DRAWUITOP = 0x41AA40; +__declspec(naked) void Lawn::DrawTopUI(Sexy::Graphics*) +{ + __asm + { + + push[esp + 0x4] + push ecx + call LAWN_DRAWUITOP + + ret 0x4 + } +} + +constexpr unsigned int LAWN_SETMUSTACHEMODE = 0x41AE60; +__declspec(naked) void Lawn::SetMustacheMode(bool) +{ + __asm + { + push bl + push edi + + mov bl, [esp + 0xC] + mov edi, ecx + call LAWN_SETMUSTACHEMODE + + pop edi + pop bl + ret 0x4 + } +} + +constexpr unsigned int LAWN_SETFUTUREMODE = 0x41AF00; +__declspec(naked) void Lawn::SetFutureMode(bool) +{ + __asm + { + push bl + push edi + + mov bl, [esp + 0xC] + mov edi, ecx + call LAWN_SETFUTUREMODE + + pop edi + pop bl + ret 0x4 + } +} + +constexpr unsigned int LAWN_SETPINATAMODE = 0x41AF60; +__declspec(naked) void Lawn::SetPinataMode(bool) +{ + __asm + { + push bl + push esi + + mov bl, [esp + 0xC] + mov esi, ecx + call LAWN_SETPINATAMODE + + pop esi + pop bl + ret 0x4 + } +} + +constexpr unsigned int LAWN_SETDANCEMODE = 0x41AFD0; +__declspec(naked) void Lawn::SetDanceMode(bool) +{ + __asm + { + push bl + + mov bl, [esp + 0x8] + push ecx + call LAWN_SETDANCEMODE + + pop bl + ret 0x4 + } +} + +constexpr unsigned int LAWN_SETSUPERMOWERMODE = 0x41B0D0; +__declspec(naked) void Lawn::SetSuperMowerMode(bool) +{ + __asm + { + push bl + push edi + + mov bl, [esp + 0xC] + mov edi, ecx + call LAWN_SETSUPERMOWERMODE + + pop edi + pop bl + ret 0x4 + } +} + +constexpr unsigned int LAWN_ADDSUNMONEY = 0x41B960; +__declspec(naked) void Lawn::AddSun(int) +{ + __asm + { + + mov ecx, [esp + 0x4] + mov eax, ecx + call LAWN_ADDSUNMONEY + + ret 0x4 + } +} + +constexpr unsigned int LAWN_COUNTSUNBEINGCOLLECTED = 0x41B980; +__declspec(naked) int Lawn::GetSunBeingCollected() +{ + __asm + { + + mov edx, ecx + call LAWN_COUNTSUNBEINGCOLLECTED + + ret 0x0 + } +} + +constexpr unsigned int LAWN_COUNTCOINSBEINGCOLLECTED = 0x41B9F0; +__declspec(naked) int Lawn::GetCoinsBeingCollected() +{ + __asm + { + + mov edx, ecx + call LAWN_COUNTCOINSBEINGCOLLECTED + + ret 0x0 + } +} + +constexpr unsigned int LAWN_TAKESUNMONEY = 0x41BA60; +__declspec(naked) bool Lawn::TakeSun(int) +{ + __asm + { + push ebx + push edi + + mov ebx, [esp + 0xC] + mov edi, ecx + call LAWN_TAKESUNMONEY + + pop edi + pop ebx + ret 0x4 + } +} + +constexpr unsigned int LAWN_CANTAKESUNMONEY = 0x41BAB0; +__declspec(naked) bool Lawn::CanTakeSun(int) +{ + __asm + { + + push[esp + 0x4] + mov edx, ecx + call LAWN_CANTAKESUNMONEY + + ret 0x4 + } +} + +constexpr unsigned int LAWN_ISCONVEYORBELTLEVEL = 0x41BE50; +__declspec(naked) bool Lawn::IsConveyorBeltLevel() +{ + __asm + { + + mov eax, ecx + call LAWN_ISCONVEYORBELTLEVEL + + ret 0x0 + } +} + +constexpr unsigned int LAWN_GETNUMSEEDSINBANK = 0x41BEE0; +__declspec(naked) int Lawn::GetNumSeedsInBank() +{ + __asm + { + push edi + + mov edi, ecx + call LAWN_GETNUMSEEDSINBANK + + pop edi + ret 0x0 + } +} + +constexpr unsigned int LAWN_STAGEISNIGHT = 0x41C010; +__declspec(naked) bool Lawn::IsNightStage() +{ + __asm + { + + mov eax, ecx + call LAWN_STAGEISNIGHT + + ret 0x0 + } +} + +constexpr unsigned int LAWN_STAGEHASGRAVESTONES = 0x41C040; +__declspec(naked) bool Lawn::StageHasGraves() +{ + __asm + { + + mov edx, ecx + call LAWN_STAGEHASGRAVESTONES + + ret 0x0 + } +} + +constexpr unsigned int LAWN_STAGEHASROOF = 0x41C0B0; +__declspec(naked) bool Lawn::StageHasRoof() +{ + __asm + { + + mov eax, ecx + call LAWN_STAGEHASROOF + + ret 0x0 + } +} + +constexpr unsigned int LAWN_STAGEHASPOOL = 0x41C0D0; +__declspec(naked) bool Lawn::StageHasPool() +{ + __asm + { + + mov eax, ecx + call LAWN_STAGEHASPOOL + + ret 0x0 + } +} + +constexpr unsigned int LAWN_STAGEHASZOMBIEWALKINFROMRIGHT = 0x41C0F0; +__declspec(naked) bool Lawn::StageHasZombiesWalkInFromRight() +{ + __asm + { + + mov eax, ecx + call LAWN_STAGEHASZOMBIEWALKINFROMRIGHT + + ret 0x0 + } +} + +constexpr unsigned int LAWN_STAGEHASFOG = 0x41C170; +__declspec(naked) bool Lawn::StageHasFog() +{ + __asm + { + + mov edx, ecx + call LAWN_STAGEHASFOG + + ret 0x0 + } +} + +constexpr unsigned int LAWN_LEFTFOGCOLUMN = 0x41C1C0; +__declspec(naked) int Lawn::LeftFogColumn() +{ + __asm + { + + mov ecx, ecx + call LAWN_LEFTFOGCOLUMN + + ret 0x0 + } +} + +constexpr unsigned int LAWN_GETSEEDPACKETPOSITIONX = 0x41C210; +__declspec(naked) int Lawn::GetSeedPacketXPosition(int) +{ + __asm + { + push edi + + mov edi, [esp + 0x8] + mov eax, ecx + call LAWN_GETSEEDPACKETPOSITIONX + + pop edi + ret 0x4 + } +} + +constexpr unsigned int LAWN_GETSEEDBANKEXTRAWIDTH = 0x41C290; +__declspec(naked) int Lawn::GetSeedBankExtraWidth() +{ + __asm + { + + mov eax, ecx + call LAWN_GETSEEDBANKEXTRAWIDTH + + ret 0x0 + } +} + +constexpr unsigned int LAWN_SEEDNOTRECOMMENDEDFORLEVEL = 0x41CC60; +__declspec(naked) bool Lawn::SeedNotRecommendedForLevel(SeedType) +{ + __asm + { + push esi + + mov esi, [esp + 0x8] + mov edx, ecx + call LAWN_SEEDNOTRECOMMENDEDFORLEVEL + + pop esi + ret 0x4 + } +} + +constexpr unsigned int LAWN_PLANTINGREQUIREMENTSMET = 0x41D7D0; +__declspec(naked) bool Lawn::PlantingRequirementsMet(SeedType) +{ + __asm + { + + mov eax, [esp + 0x4] + mov edx, ecx + call LAWN_PLANTINGREQUIREMENTSMET + + ret 0x4 + } +} + +constexpr unsigned int LAWN_FINDUNBRELLAPLANT = 0x41D3D0; +__declspec(naked) Plant* Lawn::FindUmbrellaPlant(int, int) +{ + __asm + { + push edi + push ebx + + mov edi, [esp + 0x10] + mov ebx, [esp + 0xC] + mov edx, ecx + call LAWN_FINDUNBRELLAPLANT + + pop ebx + pop edi + ret 0x8 + } +} + +constexpr unsigned int LAWN_DOFWOOSH = 0x41D450; +__declspec(naked) void Lawn::DoFwoosh(int) +{ + __asm + { + push ebx + + push[esp + 0x8] + mov ebx, ecx + call LAWN_DOFWOOSH + + pop ebx + ret 0x4 + } +} + +constexpr unsigned int LAWN_UPDATEFWOOSH = 0x41D630; +__declspec(naked) void Lawn::UpdateFwoosh() +{ + __asm + { + push ebx + + mov ebx, ecx + call LAWN_UPDATEFWOOSH + + pop ebx + ret 0x0 + } +} + +constexpr unsigned int LAWN_GETNUMWAVESPERSURVIVALSTAGE = 0x41DA10; +__declspec(naked) int Lawn::GetNumWavesPerSurvivalStage() +{ + __asm + { + + mov eax, ecx + call LAWN_GETNUMWAVESPERSURVIVALSTAGE + + ret 0x0 + } +} + +constexpr unsigned int LAWN_REMOVEPARTICLESYSTEMBYTYPE = 0x41DA50; +__declspec(naked) void Lawn::RemoveParticleSystemByType(ParticleEffect) +{ + __asm + { + push edi + push ebx + + mov edi, [esp + 0xC] + mov ebx, ecx + call LAWN_REMOVEPARTICLESYSTEMBYTYPE + + pop ebx + pop edi + ret 0x4 + } +} + +constexpr unsigned int LAWN_PLANTUSESACCELERATEDPRICING = 0x41DA90; +__declspec(naked) bool Lawn::PlantUsesAcceleratedPricing(SeedType) +{ + __asm + { + + mov eax, [esp + 0x4] + push ecx + call LAWN_PLANTUSESACCELERATEDPRICING + + ret 0x4 + } +} + +constexpr unsigned int LAWN_GETCURRENTPLANTCOST = 0x41DAE0; +__declspec(naked) int Lawn::GetCurrentPlantCost(SeedType, SeedType) +{ + __asm + { + push edi + + mov edx, [esp + 0xC] + mov eax, [esp + 0x8] + mov edi, ecx + call LAWN_GETCURRENTPLANTCOST + + pop edi + ret 0x8 + } +} + +constexpr unsigned int LAWN_UPDATEMOUSEPOSITION = 0x40EAB0; +__declspec(naked) void Lawn::UpdateMousePosition() +{ + __asm + { + + mov eax, ecx + call LAWN_UPDATEMOUSEPOSITION + + ret 0x0 + } +} + +constexpr unsigned int LAWN_UPDATETOOLTIP = 0x40EF00; +__declspec(naked) void Lawn::UpdateToolTip() +{ + __asm + { + + push ecx + call LAWN_UPDATETOOLTIP + + ret 0x0 + } +} + +constexpr unsigned int LAWN_MOUSEDOWNCOBCANNONFIRE = 0x40FC70; +__declspec(naked) void Lawn::MouseDownCobcannonFire(int, int, ClickCode) +{ + __asm + { + + push[esp + 0xC] + push[esp + 0xC] + push[esp + 0xC] + mov eax, ecx + call LAWN_MOUSEDOWNCOBCANNONFIRE + + ret 0xC + } +} + +constexpr unsigned int LAWN_MOUSEDOWNWITHPLANT = 0x40FD30; +__declspec(naked) void Lawn::MouseDownWithPlant(int, int, ClickCode) +{ + __asm + { + + mov ecx, [esp + 0xC] + push[esp + 0x8] + push[esp + 0x8] + push ecx + call LAWN_MOUSEDOWNWITHPLANT + + ret 0xC + } +} + +constexpr unsigned int LAWN_MOUSEDOWNWITHTOOL = 0x411060; +__declspec(naked) void Lawn::MouseDownWithTool(int, int, ClickCode, CursorType) +{ + __asm + { + + push[esp + 0x10] + push[esp + 0x10] + mov ecx, [esp + 0x10] + mov edx, [esp + 0xC] + mov eax, ecx + call LAWN_MOUSEDOWNWITHTOOL + + ret 0x10 + } +} + +constexpr unsigned int LAWN_TUTORIALARROWSHOW = 0x410FA0; +__declspec(naked) void Lawn::ShowTutorialArrow(int, int) +{ + __asm + { + push edi + + push[esp + 0xC] + push[esp + 0xC] + mov edi, ecx + call LAWN_TUTORIALARROWSHOW + + pop edi + ret 0x8 + } +} + +constexpr unsigned int LAWN_TUTORIALARROWREMOVE = 0x411020; +__declspec(naked) void Lawn::RemoveTutorialArrow() +{ + __asm + { + push esi + + mov esi, ecx + call LAWN_TUTORIALARROWREMOVE + + pop esi + ret 0x0 + } +} + +constexpr unsigned int LAWN_DRAWLEVEL = 0x417DA0; +__declspec(naked) void Lawn::DrawLevelName(Sexy::Graphics*) +{ + __asm + { + + push[esp + 0x4] + push ecx + call LAWN_DRAWLEVEL + + ret 0x4 + } +} + +constexpr unsigned int LAWN_CANDROPLOOT = 0x41D2C0; +__declspec(naked) bool Lawn::CanDropLoot() +{ + __asm + { + + mov edx, ecx + call LAWN_CANDROPLOOT + + ret 0x0 + } +} + +constexpr unsigned int LAWN_BUNGEEISTARGETINGCELL = 0x41D320; +__declspec(naked) bool Lawn::IsBungeeTargetingCell(int, int) +{ + __asm + { + push edi + push ebx + + mov edi, [esp + 0x10] + mov ebx, [esp + 0xC] + mov edx, ecx + call LAWN_BUNGEEISTARGETINGCELL + + pop ebx + pop edi + ret 0x8 + } +} + +constexpr unsigned int LAWN_GETBOSSZOMBIE = 0x41D390; +__declspec(naked) Zombie* Lawn::GetZomboss() +{ + __asm + { + + mov edx, ecx + call LAWN_GETBOSSZOMBIE + + ret 0x0 + } +} +#pragma endregion diff --git a/src/Lunacy/Zombie.cpp b/src/Lunacy/Zombie.cpp index 44afac6..9dc0b26 100644 --- a/src/Lunacy/Zombie.cpp +++ b/src/Lunacy/Zombie.cpp @@ -954,4 +954,664 @@ __declspec(naked) void Zombie::UpdateZomboss() jmp ecx } } -#pragma endregion \ No newline at end of file +#pragma endregion + +// Cant guarantee these functions will work or are optimized. They were auto generated. +#pragma region Autogen functions +constexpr unsigned int ZOMBIE_ISTANGLEKELPTARGET = 0x526190; +__declspec(naked) bool Zombie::IsTangleKelpTarget() +{ + __asm + { + push edi + + mov edi, ecx + call ZOMBIE_ISTANGLEKELPTARGET + + pop edi + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_DROPFLAG = 0x529870; +__declspec(naked) void Zombie::DropFlag() +{ + __asm + { + push ebx + + mov ebx, ecx + call ZOMBIE_DROPFLAG + + pop ebx + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_DROPPOLE = 0x529970; +__declspec(naked) void Zombie::DropPole() +{ + __asm + { + push esi + + mov esi, ecx + call ZOMBIE_DROPPOLE + + pop esi + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_DROPHEAD = 0x529A30; +__declspec(naked) void Zombie::DropHead(DamageFlag) +{ + __asm + { + + push[esp + 0x4] + push ecx + call ZOMBIE_DROPHEAD + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_DROPARM = 0x529EF0; +__declspec(naked) void Zombie::DropArm(DamageFlag) +{ + __asm + { + push ebx + + push[esp + 0x8] + mov ebx, ecx + call ZOMBIE_DROPARM + + pop ebx + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_UPDATEDAMAGESTATES = 0x52A470; +__declspec(naked) void Zombie::UpdateDamageStates(DamageFlag) +{ + __asm + { + push edi + + mov edi, [esp + 0x8] + mov eax, ecx + call ZOMBIE_UPDATEDAMAGESTATES + + pop edi + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_UPDATEACTIONS = 0x52B110; +__declspec(naked) void Zombie::UpdateActions() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_UPDATEACTIONS + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_CHECKFORLAWNEDGE = 0x52B280; +__declspec(naked) void Zombie::CheckForLawnEdge() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_CHECKFORLAWNEDGE + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_ISWALKINGBACKWARDS = 0x52BEE0; +__declspec(naked) bool Zombie::IsWalkingBackwards() +{ + __asm + { + + mov ecx, ecx + call ZOMBIE_ISWALKINGBACKWARDS + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_CANTARGETPLANT = 0x52E4C0; +__declspec(naked) bool Zombie::CanTargetPlant(Plant*, ZombieAttackType) +{ + __asm + { + + push[esp + 0x8] + push[esp + 0x8] + mov ecx, ecx + call ZOMBIE_CANTARGETPLANT + + ret 0x8 + } +} + +constexpr unsigned int ZOMBIE_FINDPLANTTARGET = 0x52E780; +__declspec(naked) Plant* Zombie::FindPlantTarget(ZombieAttackType) +{ + __asm + { + + push[esp + 0x4] + push ecx + call ZOMBIE_FINDPLANTTARGET + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_FINDZOMBIETARGET = 0x52E840; +__declspec(naked) Zombie* Zombie::FindZombieTarget() +{ + __asm + { + + push ecx + call ZOMBIE_FINDZOMBIETARGET + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_ZAMBONIDEATH = 0x52E9A0; +__declspec(naked) void Zombie::ZamboniDeath(DamageFlag) +{ + __asm + { + + push[esp + 0x4] + mov eax, ecx + call ZOMBIE_ZAMBONIDEATH + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_CATAPULTDEATH = 0x52EC00; +__declspec(naked) void Zombie::CatapultDeath(DamageFlag) +{ + __asm + { + + push[esp + 0x4] + mov eax, ecx + call ZOMBIE_CATAPULTDEATH + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_ISIMMOBILIZED = 0x52EEF0; +__declspec(naked) bool Zombie::IsImmobilized() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_ISIMMOBILIZED + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_ISMOVINGATCHILLEDSPEED = 0x52EF10; +__declspec(naked) bool Zombie::IsChilled() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_ISMOVINGATCHILLEDSPEED + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_SETANIMRATE = 0x52EFD0; +__declspec(naked) void Zombie::SetFPS(float) +{ + __asm + { + + push[esp + 0x4] + mov eax, ecx + call ZOMBIE_SETANIMRATE + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_APPLYANIMRATE = 0x52EFF0; +__declspec(naked) void Zombie::ApplyFPS(float) +{ + __asm + { + + push[esp + 0x4] + mov eax, ecx + call ZOMBIE_APPLYANIMRATE + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_STARTEATING = 0x52F250; +__declspec(naked) void Zombie::StartEating() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_STARTEATING + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_STARTWALKANIM = 0x52F2E0; +__declspec(naked) void Zombie::StartWalking(int) +{ + __asm + { + push esi + + mov esi, [esp + 0x8] + mov eax, ecx + call ZOMBIE_STARTWALKANIM + + pop esi + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_STOPEATING = 0x52F440; +__declspec(naked) void Zombie::StopEating() +{ + __asm + { + push edi + + mov edi, ecx + call ZOMBIE_STOPEATING + + pop edi + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_POOLSPLASH = 0x52F6D0; +__declspec(naked) void Zombie::PoolSplash(bool) +{ + __asm + { + + push[esp + 0x4] + mov eax, ecx + call ZOMBIE_POOLSPLASH + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_EATPLANT = 0x52FB40; +__declspec(naked) void Zombie::EatPlant(Plant*) +{ + __asm + { + + mov ecx, [esp + 0x4] + push ecx + call ZOMBIE_EATPLANT + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_EATZOMBIE = 0x52FE10; +__declspec(naked) void Zombie::EatZombie(Zombie*) +{ + __asm + { + push edi + + mov eax, [esp + 0x8] + mov edi, ecx + call ZOMBIE_EATZOMBIE + + pop edi + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_TRYSPAWNLEVELAWARD = 0x52FE50; +__declspec(naked) void Zombie::TrySpawnLevelAward() +{ + __asm + { + + push ecx + call ZOMBIE_TRYSPAWNLEVELAWARD + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_DROPSHIELD = 0x530A00; +__declspec(naked) void Zombie::DropShield(DamageFlag) +{ + __asm + { + + push[esp + 0x4] + push ecx + call ZOMBIE_DROPSHIELD + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_DROPHELM = 0x530E30; +__declspec(naked) void Zombie::DropHelm(DamageFlag) +{ + __asm + { + + push[esp + 0x4] + mov eax, ecx + call ZOMBIE_DROPHELM + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_GETPOSYBASEDONROW = 0x531880; +__declspec(naked) float Zombie::GetZombieYPos(int) +{ + __asm + { + + push[esp + 0x4] + mov eax, ecx + call ZOMBIE_GETPOSYBASEDONROW + + ret 0x4 + } +} + +constexpr unsigned int ZOMBIE_RISEFROMGRAVE = 0x531C90; +__declspec(naked) void Zombie::RiseFromGrave(int, int) +{ + __asm + { + push ebx + + push[esp + 0xC] + mov eax, [esp + 0xC] + mov ebx, ecx + call ZOMBIE_RISEFROMGRAVE + + pop ebx + ret 0x8 + } +} + +constexpr unsigned int ZOMBIE_REMOVEICETRAP = 0x532350; +__declspec(naked) void Zombie::RemoveIceTrap() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_REMOVEICETRAP + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_HITICETRAP = 0x5323C0; +__declspec(naked) void Zombie::HitIceTrap() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_HITICETRAP + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_REMOVEBUTTER = 0x532570; +__declspec(naked) void Zombie::RemoveButter() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_REMOVEBUTTER + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_APPLYBUTTER = 0x5326D0; +__declspec(naked) void Zombie::ApplyButter() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_APPLYBUTTER + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_MOWDOWN = 0x5327E0; +__declspec(naked) void Zombie::MowDown() +{ + __asm + { + push edi + + mov edi, ecx + call ZOMBIE_MOWDOWN + + pop edi + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_REMOVECOLDEFFECTS = 0x532B40; +__declspec(naked) void Zombie::RemoveCold() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_REMOVECOLDEFFECTS + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_APPLYBURN = 0x532B70; +__declspec(naked) void Zombie::ApplyBurn() +{ + __asm + { + + mov ecx, ecx + call ZOMBIE_APPLYBURN + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_ATTACHSHIELD = 0x533000; +__declspec(naked) void Zombie::AttachShield() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_ATTACHSHIELD + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_DETACHSHIELD = 0x5330E0; +__declspec(naked) void Zombie::DetachShield() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_DETACHSHIELD + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_DODAISIES = 0x5335A0; +__declspec(naked) void Zombie::DoDaisies() +{ + __asm + { + push esi + + mov esi, ecx + call ZOMBIE_DODAISIES + + pop esi + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_HASSHADOW = 0x533F70; +__declspec(naked) bool Zombie::HasShadow() +{ + __asm + { + + mov ecx, ecx + call ZOMBIE_HASSHADOW + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_ISFLYING = 0x534680; +__declspec(naked) bool Zombie::IsFlying() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_ISFLYING + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_GETBOBSLEDPOSITION = 0x5346A0; +__declspec(naked) int Zombie::GetBobsledPosition() +{ + __asm + { + + mov ecx, ecx + call ZOMBIE_GETBOBSLEDPOSITION + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_ISDEADORDYING = 0x534700; +__declspec(naked) bool Zombie::IsDeadOrDying() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_ISDEADORDYING + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_UPDATEZOMBIECHIMNEY = 0x534730; +__declspec(naked) void Zombie::UpdateZombieChimney() +{ + __asm + { + push esi + + mov esi, ecx + call ZOMBIE_UPDATEZOMBIECHIMNEY + + pop esi + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_WALKINTOHOUSE = 0x534780; +__declspec(naked) void Zombie::WalkIntoHouse() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_WALKINTOHOUSE + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_BOSSPLAYIDLE = 0x534920; +__declspec(naked) void Zombie::BossPlayIdle() +{ + __asm + { + + mov eax, ecx + call ZOMBIE_BOSSPLAYIDLE + + ret 0x0 + } +} + +constexpr unsigned int ZOMBIE_DRAWBOSSFIREBALL = 0x534960; +__declspec(naked) void Zombie::DrawBossFireBall(Sexy::Graphics*) +{ + __asm + { + push esi + + mov esi, [esp + 0x8] + mov eax, ecx + call ZOMBIE_DRAWBOSSFIREBALL + + pop esi + ret 0x4 + } +} +#pragma endregion diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 50773c3..1e00518 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -3,7 +3,6 @@ #include using Luna::Application; - BOOL APIENTRY DllMain ( HMODULE ModuleHandle,