Skip to content

Commit

Permalink
killing myself aaaaa my eyes burn so much
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Nov 12, 2024
1 parent 3f14f9e commit 87f23cf
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 43 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.7.5

- Fixed best run not working
- Ported to **2.2074**

# 1.7.4

Expand Down
8 changes: 4 additions & 4 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"geode": "3.9.0",
"version": "v1.7.5",
"gd": {
"win": "2.2073",
"android": "2.206",
"mac": "2.207",
"ios": "2.206"
"win": "2.2074",
"android": "2.2074",
"mac": "2.2074",
"ios": "2.2074"
},
"early-load": true,
"id": "thesillydoggo.qolmod",
Expand Down
3 changes: 1 addition & 2 deletions src/Client/AndroidUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ bool AndroidUI::setup()
versionInfo->setScale(0.55f);
versionInfo->setOpacity(125);

checkingSprite = LoadingCircleSprite::create();
checkingSprite->runAction(CCRepeatForever::create(CCRotateBy::create(1, 360)));
checkingSprite = LoadingCircleSprite::create(1);
checkingSprite->setScale(versionInfo->getScaledContentHeight() / checkingSprite->getContentHeight());

versionParent->addChild(versionInfo);
Expand Down
4 changes: 2 additions & 2 deletions src/Client/Types/SetValueModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void SetValueModule::makeAndroid(CCNode* menu, CCPoint pos)

void SetValueModule::onSet(CCObject* sender)
{
auto mod = as<SetValueModule*>(as<CCNode*>(sender)->getUserData());
/*auto mod = as<SetValueModule*>(as<CCNode*>(sender)->getUserData());
if (LevelEditorLayer::get() && LevelEditorLayer::get()->m_editorUI && (LevelEditorLayer::get()->m_editorUI->m_selectedObject || LevelEditorLayer::get()->m_editorUI->m_selectedObjects->count() > 0))
{
Expand Down Expand Up @@ -145,7 +145,7 @@ void SetValueModule::onSet(CCObject* sender)
}
}
}
}
}*/
}

void SetValueModule::onScaleToggle(CCObject* sender)
Expand Down
2 changes: 1 addition & 1 deletion src/Hacks/Frame Stepper/FrameStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void SteppedUILayer::onTogglePaused(CCObject*)
fields->paused = !fields->paused;

if (fields->paused)
FMODAudioEngine::get()->pauseAllMusic();
FMODAudioEngine::get()->pauseAllMusic(true);
else
FMODAudioEngine::get()->resumeAllMusic();
}
Expand Down
4 changes: 4 additions & 0 deletions src/Hacks/Patches/EditorExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ using namespace geode::prelude;
// first address is found in CCPoint * EditorUI::getLimitedPosition(EditorUI *this,CCPoi nt *__return,CCPoint param_3)
// second address is found in void EditorUI::constrainGameLayerPosition(EditorUI *this,fl oat param_2,float param_3)

// todo: port to 2.207

static_assert(false, "this fucking sucks btw");

std::vector<geode::Patch*> patches = {};

#ifdef GEODE_IS_WINDOWS
Expand Down
5 changes: 3 additions & 2 deletions src/Hacks/RandomSeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include "../Client/Client.h"
#include "../Utils/OffsetManager.hpp"

using namespace geode::prelude;

Expand All @@ -26,7 +27,7 @@ class $modify (GJBaseGameLayer)
seed = x.value();

#ifdef GEODE_IS_WINDOWS
*(int*)((char*)geode::base::get() + 0x6a4e20) = seed;
*(int*)((char*)geode::base::get() + OffsetManager::get()->offsetForRandomSeed()) = seed;
#else
GameToolbox::fast_srand(seed);
#endif
Expand All @@ -53,7 +54,7 @@ class $modify (PlayLayer)
seed = x.value();

#ifdef GEODE_IS_WINDOWS
*(int*)((char*)geode::base::get() + 0x6a4e20) = seed;
*(int*)((char*)geode::base::get() + OffsetManager::get()->offsetForRandomSeed()) = seed;
#else
GameToolbox::fast_srand(seed);
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/Hacks/ScaleTextInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class $modify (InputScaleControl, GJScaleControl)
auto wrappedValue = unscaleFloat(value, m_lowerBound, m_upperBound);

m_sliderXY->setValue(clamp<float>(wrappedValue, 0, 1));
this->sliderChanged(m_sliderXY->m_touchLogic);
//this->sliderChanged(m_sliderXY->m_touchLogic);

if (EditorUI::get())
{
Expand All @@ -46,7 +46,7 @@ class $modify (InputScaleControl, GJScaleControl)
auto wrappedValue = unscaleFloat(value, m_lowerBound, m_upperBound);

m_sliderX->setValue(clamp<float>(wrappedValue, 0, 1));
this->sliderChanged(m_sliderX->m_touchLogic);
//this->sliderChanged(m_sliderX->m_touchLogic);

if (EditorUI::get())
{
Expand All @@ -65,7 +65,7 @@ class $modify (InputScaleControl, GJScaleControl)
auto wrappedValue = unscaleFloat(value, m_lowerBound, m_upperBound);

m_sliderY->setValue(clamp<float>(wrappedValue, 0, 1));
this->sliderChanged(m_sliderY->m_touchLogic);
//this->sliderChanged(m_sliderY->m_touchLogic);

if (EditorUI::get())
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hacks/SliderLimit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class $modify (GJScaleControl)
float value = scaleFloat(m_sliderXY->getThumb()->getValue(), m_lowerBound, m_upperBound);

updateLabelXY(value);
this->sliderChanged(m_sliderXY->getThumb());
// this->sliderChanged(m_sliderXY->getThumb());

if (EditorUI::get())
{
Expand Down
39 changes: 11 additions & 28 deletions src/Hacks/TPSBypass.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include "../Client/Client.h"
#include "../Utils/OffsetManager.hpp"

using namespace geode::prelude;

Expand Down Expand Up @@ -87,34 +88,16 @@ void updateTPSPatches(bool tpsEnabled)

if (tpsEnabled)
{
#ifdef GEODE_IS_WINDOWS
auto array = geode::toBytes<float>(1.0f / tps);

//DWORD old_prot;
//VirtualProtect(reinterpret_cast<void*>(geode::base::get() + 0x5ec6d0), array.size(), PAGE_EXECUTE_READWRITE, &old_prot);
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + 0x606f98), array));
//VirtualProtect(reinterpret_cast<void*>(geode::base::get() + 0x5ec6d0), array.size(), old_prot, &old_prot);
#endif

#ifdef GEODE_IS_ANDROID32
patches.push_back(Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + (0x46ce38 - 0x10000)), getBytes<double>(1.0f / tps)).unwrap());
#endif

#ifdef GEODE_IS_ANDROID64
patches.push_back(Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + (0x9384b8 - 0x100000)), getBytes<double>(1.0f / tps)).unwrap());
#endif

#ifdef GEODE_IS_INTEL_MAC
patches.push_back(Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x823b00), getBytes<double>(1.0f / tps)).unwrap());
#endif

#ifdef GEODE_IS_ARM_MAC

#endif

#ifdef GEODE_IS_IOS
patches.push_back(Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x642b60), getBytes<double>(1.0f / tps)).unwrap());
#endif
if (auto offset = OffsetManager::get()->offsetForType(PatchType::PhysicsBypass); offset != 0x80085)
{
#ifdef GEODE_IS_WINDOWS
auto array = geode::toBytes<float>(1.0f / tps);
#else
auto array = geode::toBytes<double>(1.0f / tps);
#endif

patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + offset), array));
}
}
}

Expand Down
67 changes: 67 additions & 0 deletions src/Utils/OffsetManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#include "OffsetManager.hpp"

OffsetManager* OffsetManager::get()
{
static OffsetManager* instance = nullptr;

if (!instance)
instance = new OffsetManager();

return instance;
}

unsigned int OffsetManager::offsetForType(PatchType type)
{
switch (type)
{
case PatchType::PhysicsBypass:
#if GEODE_COMP_GD_VERSION == 22074

GEODE_WINDOWS(return 0x607008);
GEODE_ANDROID32(return - 0x10000);
GEODE_ANDROID64(return - 0x100000);
GEODE_INTEL_MAC(return );
GEODE_IOS(return );

#endif

#if GEODE_COMP_GD_VERSION == 22073

GEODE_WINDOWS(return 0x606f98);

#endif

#if GEODE_COMP_GD_VERSION == 22060

GEODE_WINDOWS(return 0x5ec6d0);
GEODE_ANDROID32(return 0x46ce38 - 0x10000);
GEODE_ANDROID64(return 0x9384b8 - 0x100000);
GEODE_INTEL_MAC(return 0x823b00);
GEODE_IOS(return 0x642b60);

#endif

break;
}

return 0x80085;
}

unsigned int OffsetManager::offsetForRandomSeed()
{
#ifndef GEODE_IS_WINDOWS
return 0x80085;
#endif

#if GEODE_COMP_GD_VERSION == 22074
return 0x6a4e20;
#endif

#if GEODE_COMP_GD_VERSION == 22073
return 0x6a4e20;
#endif

#if GEODE_COMP_GD_VERSION == 22060
return 0x687dd0;
#endif
}
19 changes: 19 additions & 0 deletions src/Utils/OffsetManager.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <Geode/Geode.hpp>

using namespace geode::prelude;

enum class PatchType
{
PhysicsBypass,
};

class OffsetManager
{
public:
static OffsetManager* get();

unsigned int offsetForType(PatchType type);
unsigned int offsetForRandomSeed();
};

0 comments on commit 87f23cf

Please sign in to comment.