Add in file speed.h
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <unistd.h>
#include <sys/mman.h>
uintptr_t GetBSSAddress(const std::string& libraryName) {
uintptr_t address = 0;
std::ifstream maps("/proc/self/maps");
if (!maps.is_open()) return 0;
std::string line;
while (std::getline(maps, line)) {
if (line.find(libraryName) != std::string::npos && line.find("rw-p") != std::string::npos) {
address = std::strtoull(line.substr(0, line.find("-")).c_str(), nullptr, 16);
break;
}
}
maps.close();
return address;
}
uintptr_t ResolvePointerChain(uintptr_t baseAddress, const std::vector<uintptr_t>& offsets, bool is64Bit) {
if (baseAddress == 0) return 0;
uintptr_t currentAddress = baseAddress + offsets[0];
for (size_t i = 1; i < offsets.size(); ++i) {
uintptr_t nextPointer = 0;
if (IsBadReadPtr((void*)currentAddress)) return 0;
if (is64Bit) {
nextPointer = *(uintptr_t*)currentAddress;
} else {
nextPointer = *(uint32_t*)currentAddress & 0xFFFFFFFF;
}
currentAddress = nextPointer + offsets[i];
}
return currentAddress;
}
bool IsBadReadPtr(void* p) {
if (p == nullptr) return true;
return false;
}
void WriteFloatValue(uintptr_t address, float value) {
if (address == 0) return;
*(float*)address = value;
}
// (A1) start speed
void EnableSpeed() {
uintptr_t bssBase = GetBSSAddress("libunity.so");
if (bssBase == 0) return;
std::vector<uintptr_t> offsets = {
0x8df70, 0x0, 0x28, 0x0, 0xB8, 0x1c8, 0x20, 0xb8, 0x18, 0x30, 0x20, 0x18, 0x10, 0xE00
};
uintptr_t finalAddress = ResolvePointerChain(bssBase, offsets, true);
if (finalAddress != 0) {
WriteFloatValue(finalAddress, 2.0f);
}
}
//(A2) stop speed
void DisableSpeed() {
uintptr_t bssBase = GetBSSAddress("libunity.so");
if (bssBase == 0) return;
std::vector<uintptr_t> offsets = {
0x8df70, 0x0, 0x28, 0x0, 0xB8, 0x1c8, 0x20, 0xb8, 0x18, 0x30, 0x20, 0x18, 0x10, 0xE00
};
uintptr_t finalAddress = ResolvePointerChain(bssBase, offsets, true);
if (finalAddress != 0) {
WriteFloatValue(finalAddress, 1.0f);
}
}
Add in imgui
cpp
static bool speedEnabled = false;
if (ImGui::Checkbox("Speed", &speedEnabled))
{
if (speedEnabled)
{
EnableSpeed();
}
else
{
DisableSpeed();
}
}
Cr:- Sanji1_Owner
TGC:-NIKA_SOURCE_MODS