Skip to content

Commit

Permalink
Fixed AlbumUnlock added Always on DLC unlocker
Browse files Browse the repository at this point in the history
  • Loading branch information
Omega172 committed May 3, 2023
1 parent df3e0ee commit 6f3c041
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<ClInclude Include="Features\ModifyGiftQuantity.hpp" />
<ClInclude Include="Features\NSFW.hpp" />
<ClInclude Include="Features\PhoneSkip.hpp" />
<ClInclude Include="Features\Unlocker.hpp" />
<ClInclude Include="Features\Quit.hpp" />
<ClInclude Include="Features\SpeedHack.hpp" />
<ClInclude Include="Features\Watermark.hpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<ClInclude Include="Features\HobbiesUnlock.hpp" />
<ClInclude Include="Utils\MiscUtils.hpp" />
<ClInclude Include="Features\Quit.hpp" />
<ClInclude Include="Features\Unlocker.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="Hooking\Keiro\minhook\dll_resources\MinHook.def" />
Expand Down
14 changes: 7 additions & 7 deletions Crush Crush Cheat/Crush Crush Cheat/Features/AlbumUnlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include "../Includes.hpp"

// Album
// Token: 0x0600060D RID: 1549 RVA: 0x00030258 File Offset: 0x0002E458
// public bool IsPinupUnlocked(int pinupPage, int image)
// Album::IsPinupUnlocked(int pinupPage, int image)
// Token: 0x060006C8 RID: 1736 RVA: 0x00036854 File Offset: 0x00034A54
// public static bool IsPinupUnlocked(int pinupRewardAmount)
// Album::IsPinupUnlocked(int pinupRewardAmount)

// Album
// Token: 0x06000602 RID: 1538 RVA: 0x0002FC9C File Offset: 0x0002DE9C
Expand Down Expand Up @@ -43,7 +43,7 @@ class AlbumUnlock

void Create()
{
Album_IsPinupUnlocked = Mono::Instance().GetCompiledMethod("Album", "IsPinupUnlocked", 2);
Album_IsPinupUnlocked = Mono::Instance().GetCompiledMethod("Album", "IsPinupUnlocked", 1);
if (Album_IsPinupUnlocked == nullptr)
return;

Expand Down Expand Up @@ -125,10 +125,10 @@ class AlbumUnlock
}
}

HOOK_DEF(bool, Album_IsPinupUnlocked, (void* __this, int pinupPage, int image))
HOOK_DEF(bool, Album_IsPinupUnlocked, (void* __this, int pinupRewardAmount))
{
if (image != 0 && bExtraDebug)
LogHook(HookLogReason::Called, "Album_IsPinupUnlocked", "pinupPage = " + std::to_string(pinupPage) + " image = " + std::to_string(image));
if (bExtraDebug)
LogHook(HookLogReason::Called, "Album_IsPinupUnlocked", "pinupRewardAmount = " + std::to_string(pinupRewardAmount));

return true;
}
Expand Down
34 changes: 34 additions & 0 deletions Crush Crush Cheat/Crush Crush Cheat/Features/ModGirls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
// private void Update()
// Girl::Update()

// Girls
// Token: 0x04000495 RID: 1173
// public static Girl CurrentGirl;
// Girls::CurrentGirl;

class ModGirls
{
private:
Expand All @@ -24,6 +29,11 @@ class ModGirls

void Render()
{
if (ImGui::Button("Set Current Girl Lover"))
SetLover();

ImGui::SameLine();

ImGui::Checkbox("All Girls lover", &toggle);

Toggle();
Expand Down Expand Up @@ -62,6 +72,30 @@ class ModGirls
DisableHook(Girl_Update);
}

void SetLover()
{
uintptr_t* currentGirl = (uintptr_t*)Mono::Instance().GetStaticFieldValue("Girls", "CurrentGirl");
if (currentGirl == nullptr)
{
Log("Girls_CurrentGirl", "CurrentGirl == nullptr");
return;
}

MonoMethod* Girl_SetLove = Mono::Instance().GetMethod("Girl", "SetLove", 1);
if (Girl_SetLove == nullptr)
{
Log("Girl_SetLove", "Girl_SetLove == nullptr");
return;
}

int loveLevel = LoveLevels::LoveLevel::Lover;
void* args[1] = { &loveLevel };
MonoObject* result = Mono::Instance().Invoke(Girl_SetLove, (uintptr_t*)*currentGirl, args);

if (bExtraDebug)
LogInvoke("Girl_SetLove", "Result = " + (std::stringstream() << result).str());
}

HOOK_DEF(void, Girl_Update, (void* __this))
{
if (__this == nullptr)
Expand Down
93 changes: 93 additions & 0 deletions Crush Crush Cheat/Crush Crush Cheat/Features/Unlocker.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#pragma once
#include "../Includes.hpp"

// Playfab
// Token: 0x060006B3 RID: 1715 RVA: 0x00035C0C File Offset: 0x00033E0C
// public static bool HasItem(Playfab.PlayfabItem item)
// Playfab::HasItem(Playfab.PlayfabItem item)

// Playfab
// Token: 0x060006A9 RID: 1705 RVA: 0x000359B4 File Offset: 0x00033BB4
// public static bool ParticipatedIn(Playfab.EventParticipation e)
// Playfab::ParticipatedIn

class Unlocker
{
private:
bool hookEnabled = false;
bool toggle = false;

void* Playfab_HasItem = nullptr;
void* Playfab_ParticipatedIn = nullptr;

public:

void Render()
{

}

void Create()
{
Playfab_HasItem = Mono::Instance().GetCompiledMethod("Playfab", "HasItem", 1);
if (Playfab_HasItem == nullptr)
return;

LogHook(HookLogReason::Create, "Playfab_HasItem");
CreateHook(Playfab_HasItem);

LogHook(HookLogReason::Enable, "Playfab_HasItem");
EnableHook(Playfab_HasItem);

Playfab_ParticipatedIn = Mono::Instance().GetCompiledMethod("Playfab", "ParticipatedIn", 1);
if (Playfab_ParticipatedIn == nullptr)
return;

LogHook(HookLogReason::Create, "Playfab_ParticipatedIn");
CreateHook(Playfab_ParticipatedIn);

LogHook(HookLogReason::Enable, "Playfab_ParticipatedIn");
EnableHook(Playfab_ParticipatedIn);
}

void Toggle()
{
if (toggle && !hookEnabled)
{
hookEnabled = true;

LogHook(HookLogReason::Enable, "Playfab_HasItem");
EnableHook(Playfab_HasItem);
}

if (!toggle && hookEnabled)
{
hookEnabled = false;

LogHook(HookLogReason::Disable, "Playfab_HasItem");
DisableHook(Playfab_HasItem);
}
}

void Destory()
{
LogHook(HookLogReason::Destroy, "Playfab_HasItem");
DisableHook(Playfab_HasItem);
}

HOOK_DEF(bool, Playfab_HasItem, (void* __this, PlayfabEnums::PlayfabItem item))
{
if (bExtraDebug)
LogHook(HookLogReason::Called, "Playfab_HasItem", "item = " + std::to_string(item));

return true;
}

HOOK_DEF(bool, Playfab_ParticipatedIn, (void* __this, PlayfabEnums::EventParticipation e))
{
if (bExtraDebug)
LogHook(HookLogReason::Called, "Playfab_ParticipatedIn", "e = " + std::to_string(e));

return true;
}
};
1 change: 0 additions & 1 deletion Crush Crush Cheat/Crush Crush Cheat/GUI/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void GUI::Render()
ImGui::Text("Misc");

unlockGirls.Render();
ImGui::SameLine();
modGirls.Render();
phoneSkip.Render();
albumUnlock.Render();
Expand Down
2 changes: 2 additions & 0 deletions Crush Crush Cheat/Crush Crush Cheat/Main/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ DWORD WINAPI MainThread(LPVOID lpReserved)
jobUnlock.Destroy();
hobbiesUnlock.Destroy();
nsfw.Destroy();
unlocker.Destory();

MH_Uninitialize();

Expand Down Expand Up @@ -79,6 +80,7 @@ void Init()
jobUnlock.Create();
hobbiesUnlock.Create();
nsfw.Create();
unlocker.Create();
}

LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Expand Down
71 changes: 70 additions & 1 deletion Crush Crush Cheat/Crush Crush Cheat/SDK/Enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ namespace OutfitTypes
Monster = 1,
Animated = 2,
DeluxeWedding = 4,
Valentine = 8,
Bunny = 16,
Christmas = 262144,
SchoolUniform = 524288,
BathingSuit = 1048576,
Unique = 2097152,
DiamondRing = 4194304,
Lingerie = 536870912,
Nude = 1073741824,
All = 1616642050
All = 1616642074
};
}

Expand Down Expand Up @@ -176,3 +178,70 @@ namespace DateTypes
Beach = 16
};
}

namespace PlayfabEnums
{
enum PlayfabItem
{
NutakuUserOutreach,
Easter2017,
Summer2017,
StarterPack,
July2017,
BackToSchool2017,
Ayano2017,
Darya,
JelleQuillzone,
BonchovySpectrum,
NSFW,
Winter2018,
Charlotte,
Nutaku2019,
Odango,
Shibuki,
Sirina,
Vellatrix,
Roxxy,
Tessa,
Catara,
Claudia,
Juliet,
Rosa,
Wendy,
Ruri,
Generica,
Suzu,
FullVoices,
Lustat,
Winter2020,
Anniversary2021,
Sawyer,
Explora,
Esper,
MioPlush,
QuillPlush,
Renee,
Mallory,
Anniversary2022,
Lake,
Brie,
Ranma,
Lotus,
Cassia,
PESStarterPack,
Yuki,
RosaAnimated,
Nova,
Marybelle,
Babybelle,
Pepper
};

enum EventParticipation
{
Halloween2022,
Holiday2022,
Valentine2023,
Easter2023
};
}
7 changes: 6 additions & 1 deletion Crush Crush Cheat/Crush Crush Cheat/SDK/Girls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

enum Girl_ID
{
Unknown = -1,
Cassie = 0,
Mio,
Quill,
Expand Down Expand Up @@ -60,7 +61,11 @@ enum Girl_ID
Marybelle,
Babybelle,
Pepper = 55,
MAX = 55
ReneePF = 1000,
NovaPF = 1001,
MalloryPF = 1002,
QpiddyIntro = 2000,
QPernikiss = 18
};

struct Girl
Expand Down
2 changes: 2 additions & 0 deletions Crush Crush Cheat/Crush Crush Cheat/includes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ inline JobUnlock jobUnlock;
inline HobbiesUnlock hobbiesUnlock;
#include "Features/NSFW.hpp"
inline NSFW nsfw;
#include "Features/Unlocker.hpp"
inline Unlocker unlocker;

typedef HRESULT(__stdcall* Present) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
typedef LRESULT(CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
Expand Down

0 comments on commit 6f3c041

Please sign in to comment.