├── settings.gradle ├── app ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── values-v21 │ │ │ └── styles.xml │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── drawable │ │ │ ├── capsule.xml │ │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ │ ├── activity_main2.xml │ │ │ └── activity_main.xml │ │ └── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ ├── jni │ │ ├── Application.mk │ │ ├── Substrate │ │ │ ├── SymbolFinder.h │ │ │ ├── SubstrateHook.h │ │ │ ├── SubstrateDebug.hpp │ │ │ ├── Buffer.hpp │ │ │ ├── SubstrateLog.hpp │ │ │ ├── SubstrateARM.hpp │ │ │ ├── SubstratePosixMemory.cpp │ │ │ ├── hde64.h │ │ │ ├── SubstrateDebug.cpp │ │ │ ├── table64.h │ │ │ ├── CydiaSubstrate.h │ │ │ ├── SubstrateX86.hpp │ │ │ ├── hde64.c │ │ │ └── SymbolFinder.cpp │ │ ├── KittyMemory │ │ │ ├── KittyUtils.h │ │ │ ├── MemoryBackup.h │ │ │ ├── MemoryPatch.h │ │ │ ├── MemoryBackup.cpp │ │ │ ├── KittyUtils.cpp │ │ │ ├── KittyMemory.cpp │ │ │ ├── MemoryPatch.cpp │ │ │ └── KittyMemory.h │ │ ├── And64InlineHook │ │ │ ├── README.md │ │ │ ├── LICENSE │ │ │ ├── And64InlineHook.hpp │ │ │ └── And64InlineHook.cpp │ │ ├── Includes │ │ │ ├── Vector3.h │ │ │ ├── Rect.h │ │ │ ├── Logger.h │ │ │ ├── Color.h │ │ │ ├── Quaternion.h │ │ │ ├── Unity.h │ │ │ ├── Utils.h │ │ │ ├── obfuscate.h │ │ │ └── Vector2.h │ │ ├── Android.mk │ │ └── Main.cpp │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── simplefucker │ │ ├── source │ │ └── SavedPrefs.java │ │ └── MainActivity.java ├── proguard-rules.pro ├── build.gradle └── app.iml ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── local.properties ├── README.md ├── gradle.properties ├── FloatingModMenu.iml ├── gradlew.bat └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Anti Clown By Kolan and Ise 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #202020 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SliceCast/Android-Mod-SubMenu/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi-v7a arm64-v8a x86 2 | #APP_PLATFORM := android-18 #APP_PLATFORM does not need to be set. It will automatically defaulting 3 | APP_STL := c++_static 4 | APP_OPTIM := release 5 | APP_THIN_ARCHIVE := true 6 | APP_PIE := true 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 24 18:32:28 CEST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/jni/Substrate/SymbolFinder.h: -------------------------------------------------------------------------------- 1 | #ifndef SYMBOL_FINDER 2 | #define SYMBOL_FINDER 3 | 4 | #include 5 | 6 | extern int find_name(pid_t pid, const char *name,const char *libn, unsigned long *addr); 7 | extern int find_libbase(pid_t pid, const char *libn, unsigned long *addr); 8 | #endif -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/capsule.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/jni/KittyMemory/KittyUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace KittyUtils { 7 | 8 | bool validateHexString(std::string &xstr); 9 | void toHex(void *const data, const size_t dataLength, std::string &dest); 10 | void fromHex(const std::string &in, void *const data); 11 | 12 | } -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Sun Apr 18 15:06:47 YEKT 2021 8 | sdk.dir=C\:\\Users\\vaka\\AppData\\Local\\Android\\Sdk 9 | -------------------------------------------------------------------------------- /app/src/main/jni/Substrate/SubstrateHook.h: -------------------------------------------------------------------------------- 1 | #ifndef __SUBSTRATEHOOK_H__ 2 | #define __SUBSTRATEHOOK_H__ 3 | 4 | 5 | #include 6 | 7 | #define _extern extern "C" __attribute__((__visibility__("hidden"))) 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | void MSHookFunction(void *symbol, void *replace, void **result); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/jni/And64InlineHook/README.md: -------------------------------------------------------------------------------- 1 | # And64InlineHook 2 | Lightweight ARMv8-A(ARM64, AArch64, Little-Endian) Inline Hook Library for Android C/C++ 3 | 4 | # References 5 | [Arm Compiler armasm User Guide](http://infocenter.arm.com/help/topic/com.arm.doc.100069_0610_00_en/pge1427898258836.html) 6 | [Procedure Call Standard for the Arm® 64-bit Architecture (AArch64)](https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst) 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/jni/Includes/Vector3.h: -------------------------------------------------------------------------------- 1 | class Vector3 { 2 | public: 3 | float x; 4 | float y; 5 | float z; 6 | Vector3() 7 | : x(0) 8 | , y(0) 9 | , z(0) 10 | { 11 | } 12 | Vector3(float x1, float y1, float z1) 13 | : x(x1) 14 | , y(y1) 15 | , z(z1) 16 | { 17 | } 18 | Vector3(const Vector3& v); 19 | ~Vector3(); 20 | }; 21 | Vector3::Vector3(const Vector3& v) 22 | : x(v.x) 23 | , y(v.y) 24 | , z(v.z) 25 | { 26 | } 27 | Vector3::~Vector3() {} -------------------------------------------------------------------------------- /app/src/main/jni/Includes/Rect.h: -------------------------------------------------------------------------------- 1 | class Rect { 2 | public: 3 | float x; 4 | float y; 5 | float w; 6 | float h; 7 | Rect() 8 | : x(0) 9 | , y(0) 10 | , w(0) 11 | , h(0) 12 | { 13 | } 14 | Rect(float x1, float y1, float w1, float h1) 15 | : x(x1) 16 | , y(y1) 17 | , w(w1) 18 | , h(h1) 19 | { 20 | } 21 | Rect(const Rect& v); 22 | ~Rect(); 23 | }; 24 | Rect::Rect(const Rect& v) 25 | : x(v.x) 26 | , y(v.y) 27 | , w(v.w) 28 | , h(v.h) 29 | { 30 | } 31 | Rect::~Rect() {} -------------------------------------------------------------------------------- /app/src/main/jni/Includes/Logger.h: -------------------------------------------------------------------------------- 1 | #ifndef DAWN_LOGGER_H 2 | #define DAWN_LOGGER_H 3 | 4 | #include 5 | 6 | enum daLogType { 7 | daDEBUG = 3, 8 | daERROR = 6, 9 | daINFO = 4, 10 | daWARN = 5 11 | }; 12 | 13 | //Change this to another Log Tag if ya want. IN the batch script I provide you change the log tag then too 14 | #define TAG OBFUSCATE("Mod_Menu") 15 | 16 | #define LOGD(...) ((void)__android_log_print(daDEBUG, TAG, __VA_ARGS__)) 17 | #define LOGE(...) ((void)__android_log_print(daERROR, TAG, __VA_ARGS__)) 18 | #define LOGI(...) ((void)__android_log_print(daINFO, TAG, __VA_ARGS__)) 19 | #define LOGW(...) ((void)__android_log_print(daWARN, TAG, __VA_ARGS__)) 20 | 21 | #endif //DAWN_LOGGER_H -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Disclaimer 2 | Hello, this is a mod menu template from LGL's and KolanHacker(Hard-Android-Menu), a version with SubMenus now. 3 | 4 | I just improved the menu a bit to make it more readable and easier to modify. 5 | 6 | Note: To be easier for submenus, we have an optional case numbers. 7 | Example: "150_Toggle_Unlimited Ammo", use different numbers to get your mods working in a different submenu section. 8 | 9 | # Credits 10 | LGL's Template: https://github.com/LGLTeam/Android-Mod-Menu 11 | 12 | KolanHacker Original Template: https://github.com/KolanHacker/-Hard-Android-Menu- 13 | 14 | # ARM64 DISCLAIMER! 15 | Fixed! 16 | 17 | 18 | ![](https://i.imgur.com/q4KTFED.jpeg) 19 | 20 | ![](https://i.imgur.com/SY6djkG.jpeg) 21 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | 16 | -------------------------------------------------------------------------------- /FloatingModMenu.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | #-dontobfuscate 23 | -keepclassmembers class ** { 24 | public static void Start (***); 25 | } 26 | -keep public class uk.lgl.MainActivity 27 | -------------------------------------------------------------------------------- /app/src/main/jni/And64InlineHook/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 RLib 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /app/src/main/jni/Includes/Color.h: -------------------------------------------------------------------------------- 1 | 2 | class Color { 3 | public: 4 | float r, b, g, a; 5 | 6 | Color() { 7 | SetColor( 0 , 0 , 0 , 255 ); 8 | } 9 | 10 | Color( float r , float g , float b ) { 11 | SetColor( r , g , b , 255 ); 12 | } 13 | 14 | Color( float r, float g, float b, float a) { 15 | SetColor( r , g , b , a ); 16 | } 17 | 18 | void SetColor( float r1 , float g1 , float b1 , float a1 = 255 ) { 19 | r = r1; 20 | g = g1; 21 | b = b1; 22 | a = a1; 23 | } 24 | 25 | static Color Black(float a = 255){ return Color(0, 0, 0, a); } 26 | static Color White(float a = 255){ return Color(255 , 255 , 255, a); } 27 | static Color Red(float a = 255){ return Color(255 , 0 , 0, a); } 28 | static Color Green(float a = 255){ return Color(0 , 255 , 0, a); } 29 | static Color Blue(float a = 255){ return Color(0 , 0 , 255, a); } 30 | static Color Yellow(float a = 255){ return Color(255 , 255 , 0, a); } 31 | static Color Cyan(float a = 255){ return Color(0 , 255 , 255, a); } 32 | static Color Magenta(float a = 255){ return Color(255 , 0 , 255, a); } 33 | }; 34 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 30 5 | defaultConfig { 6 | applicationId "com.simplefucker.source" 7 | minSdkVersion 19 8 | targetSdkVersion 30 9 | versionCode 1 10 | versionName "2.0" 11 | ndk { 12 | abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86' 13 | } 14 | signingConfig signingConfigs.debug 15 | } 16 | buildTypes { 17 | release { 18 | shrinkResources false 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | debug { 23 | shrinkResources false 24 | minifyEnabled false 25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 26 | } 27 | } 28 | externalNativeBuild { 29 | ndkBuild { 30 | path file('src/main/jni/Android.mk') 31 | } 32 | } 33 | ndkVersion = '22.0.7026061' 34 | } 35 | 36 | //aide 37 | dependencies { 38 | implementation fileTree(dir: 'libs', include: ['*.jar']) 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/jni/KittyMemory/MemoryBackup.h: -------------------------------------------------------------------------------- 1 | // 2 | // MemoryBackup.h 3 | // 4 | // Created by MJ (Ruit) on 4/19/20. 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "KittyMemory.h" 12 | using KittyMemory::Memory_Status; 13 | using KittyMemory::ProcMap; 14 | 15 | 16 | class MemoryBackup { 17 | private: 18 | uintptr_t _address; 19 | size_t _size; 20 | 21 | std::vector _orig_code; 22 | 23 | std::string _hexString; 24 | 25 | public: 26 | MemoryBackup(); 27 | 28 | /* 29 | * expects library name and relative address 30 | */ 31 | MemoryBackup(const char *libraryName, uintptr_t address, size_t backup_size, bool useMapCache=true); 32 | 33 | /* 34 | * expects absolute address 35 | */ 36 | MemoryBackup(uintptr_t absolute_address, size_t backup_size); 37 | 38 | 39 | ~MemoryBackup(); 40 | 41 | 42 | /* 43 | * Validate patch 44 | */ 45 | bool isValid() const; 46 | 47 | 48 | size_t get_BackupSize() const; 49 | 50 | /* 51 | * Returns pointer to the target address 52 | */ 53 | uintptr_t get_TargetAddress() const; 54 | 55 | 56 | /* 57 | * Restores backup code 58 | */ 59 | bool Restore(); 60 | 61 | 62 | /* 63 | * Returns current target address bytes as hex string 64 | */ 65 | std::string get_CurrBytes(); 66 | }; 67 | -------------------------------------------------------------------------------- /app/src/main/jni/Substrate/SubstrateDebug.hpp: -------------------------------------------------------------------------------- 1 | /* Cydia Substrate - Powerful Code Insertion Platform 2 | * Copyright (C) 2008-2011 Jay Freeman (saurik) 3 | */ 4 | 5 | /* GNU Lesser General Public License, Version 3 {{{ */ 6 | /* 7 | * Substrate is free software: you can redistribute it and/or modify it under 8 | * the terms of the GNU Lesser General Public License as published by the 9 | * Free Software Foundation, either version 3 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * Substrate is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 15 | * License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with Substrate. If not, see . 19 | **/ 20 | /* }}} */ 21 | 22 | #ifndef SUBSTRATE_DEBUG_HPP 23 | #define SUBSTRATE_DEBUG_HPP 24 | 25 | #include "SubstrateLog.hpp" 26 | #define lprintf(format, ...) \ 27 | MSLog(MSLogLevelNotice, format, ## __VA_ARGS__) 28 | 29 | extern "C" bool MSDebug; 30 | void MSLogHexEx(const void *vdata, size_t size, size_t stride, const char *mark = 0); 31 | void MSLogHex(const void *vdata, size_t size, const char *mark = 0); 32 | 33 | #endif//SUBSTRATE_DEBUG_HPP 34 | -------------------------------------------------------------------------------- /app/src/main/jni/Substrate/Buffer.hpp: -------------------------------------------------------------------------------- 1 | /* Cydia Substrate - Powerful Code Insertion Platform 2 | * Copyright (C) 2008-2011 Jay Freeman (saurik) 3 | */ 4 | 5 | /* GNU Lesser General Public License, Version 3 {{{ */ 6 | /* 7 | * Substrate is free software: you can redistribute it and/or modify it under 8 | * the terms of the GNU Lesser General Public License as published by the 9 | * Free Software Foundation, either version 3 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * Substrate is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 15 | * License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with Substrate. If not, see . 19 | **/ 20 | /* }}} */ 21 | 22 | #ifndef SUBSTRATE_BUFFER_HPP 23 | #define SUBSTRATE_BUFFER_HPP 24 | 25 | #include 26 | 27 | template 28 | _disused static _finline void MSWrite(uint8_t *&buffer, Type_ value) { 29 | *reinterpret_cast(buffer) = value; 30 | buffer += sizeof(Type_); 31 | } 32 | 33 | _disused static _finline void MSWrite(uint8_t *&buffer, uint8_t *data, size_t size) { 34 | memcpy(buffer, data, size); 35 | buffer += size; 36 | } 37 | 38 | #endif//SUBSTRATE_BUFFER_HPP 39 | -------------------------------------------------------------------------------- /app/src/main/jni/Substrate/SubstrateLog.hpp: -------------------------------------------------------------------------------- 1 | /* Cydia Substrate - Powerful Code Insertion Platform 2 | * Copyright (C) 2008-2011 Jay Freeman (saurik) 3 | */ 4 | 5 | /* GNU Lesser General Public License, Version 3 {{{ */ 6 | /* 7 | * Substrate is free software: you can redistribute it and/or modify it under 8 | * the terms of the GNU Lesser General Public License as published by the 9 | * Free Software Foundation, either version 3 of the License, or (at your 10 | * option) any later version. 11 | * 12 | * Substrate is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 15 | * License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with Substrate. If not, see . 19 | **/ 20 | /* }}} */ 21 | 22 | #ifndef SUBSTRATE_LOG_HPP 23 | #define SUBSTRATE_LOG_HPP 24 | 25 | #if 0 26 | #include 27 | 28 | #define MSLog(level, format, ...) ((void)__android_log_print(level, "NNNN", format, __VA_ARGS__)) 29 | 30 | #define MSLogLevelNotice ANDROID_LOG_INFO 31 | #define MSLogLevelWarning ANDROID_LOG_WARN 32 | #define MSLogLevelError ANDROID_LOG_ERROR 33 | 34 | #else 35 | 36 | #define MSLog(level, format, ...) printf(format, __VA_ARGS__) 37 | 38 | #endif 39 | 40 | #endif//SUBSTRATE_LOG_HPP 41 | -------------------------------------------------------------------------------- /app/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | MAIN_LOCAL_PATH := $(call my-dir) 3 | include $(CLEAR_VARS) 4 | 5 | # Here is the name of your lib. 6 | # When you change the lib name, change also on System.loadLibrary("") under OnCreate method on StaticActivity.java 7 | # Both must have same name 8 | LOCAL_MODULE := KISE 9 | 10 | # Code optimization 11 | # -std=c++17 is required to support AIDE app with NDK 12 | LOCAL_CFLAGS := -Wno-error=format-security -fvisibility=hidden -ffunction-sections -fdata-sections -w 13 | LOCAL_CFLAGS += -fno-rtti -fno-exceptions -fpermissive 14 | LOCAL_CPPFLAGS := -Wno-error=format-security -fvisibility=hidden -ffunction-sections -fdata-sections -w -Werror -s -std=c++17 15 | LOCAL_CPPFLAGS += -Wno-error=c++11-narrowing -fms-extensions -fno-rtti -fno-exceptions -fpermissive 16 | LOCAL_LDFLAGS += -Wl,--gc-sections,--strip-all, -llog 17 | LOCAL_ARM_MODE := arm 18 | 19 | LOCAL_C_INCLUDES += $(MAIN_LOCAL_PATH) 20 | 21 | # Here you add the cpp file 22 | LOCAL_SRC_FILES := Main.cpp \ 23 | Substrate/hde64.c \ 24 | Substrate/SubstrateDebug.cpp \ 25 | Substrate/SubstrateHook.cpp \ 26 | Substrate/SubstratePosixMemory.cpp \ 27 | Substrate/SymbolFinder.cpp \ 28 | KittyMemory/KittyMemory.cpp \ 29 | KittyMemory/MemoryPatch.cpp \ 30 | KittyMemory/MemoryBackup.cpp \ 31 | KittyMemory/KittyUtils.cpp \ 32 | And64InlineHook/And64InlineHook.cpp \ 33 | 34 | LOCAL_LDLIBS := -llog -landroid -lGLESv2 35 | 36 | include $(BUILD_SHARED_LIBRARY) 37 | -------------------------------------------------------------------------------- /app/src/main/jni/And64InlineHook/And64InlineHook.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @date : 2018/04/18 3 | * @author : Rprop (r_prop@outlook.com) 4 | * https://github.com/Rprop/And64InlineHook 5 | */ 6 | /* 7 | MIT License 8 | 9 | Copyright (c) 2018 Rprop (r_prop@outlook.com) 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | SOFTWARE. 28 | */ 29 | #pragma once 30 | #define A64_MAX_BACKUPS 256 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | void A64HookFunction(void *const symbol, void *const replace, void **result); 37 | void *A64HookFunctionV(void *const symbol, void *const replace, void *const rwx, const uintptr_t rwx_size); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif -------------------------------------------------------------------------------- /app/src/main/jni/KittyMemory/MemoryPatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // MemoryPatch.h 3 | // 4 | // Created by MJ (Ruit) on 1/1/19. 5 | // 6 | 7 | #pragma once 8 | 9 | #include 10 | #include "KittyUtils.h" 11 | #include "KittyMemory.h" 12 | using KittyMemory::Memory_Status; 13 | using KittyMemory::ProcMap; 14 | 15 | class MemoryPatch { 16 | private: 17 | uintptr_t _address; 18 | size_t _size; 19 | 20 | std::vector _orig_code; 21 | std::vector _patch_code; 22 | 23 | std::string _hexString; 24 | 25 | public: 26 | MemoryPatch(); 27 | 28 | /* 29 | * expects library name and relative address 30 | */ 31 | MemoryPatch(const char *libraryName, uintptr_t address, 32 | const void *patch_code, size_t patch_size, bool useMapCache=true); 33 | 34 | 35 | /* 36 | * expects absolute address 37 | */ 38 | MemoryPatch(uintptr_t absolute_address, 39 | const void *patch_code, size_t patch_size); 40 | 41 | 42 | ~MemoryPatch(); 43 | 44 | /* 45 | * compatible hex format (0xffff & ffff & ff ff) 46 | */ 47 | static MemoryPatch createWithHex(const char *libraryName, uintptr_t address, std::string hex, bool useMapCache=true); 48 | static MemoryPatch createWithHex(uintptr_t absolute_address, std::string hex); 49 | 50 | /* 51 | * Validate patch 52 | */ 53 | bool isValid() const; 54 | 55 | 56 | size_t get_PatchSize() const; 57 | 58 | /* 59 | * Returns pointer to the target address 60 | */ 61 | uintptr_t get_TargetAddress() const; 62 | 63 | 64 | /* 65 | * Restores patch to original value 66 | */ 67 | bool Restore(); 68 | 69 | 70 | /* 71 | * Applies patch modifications to target address 72 | */ 73 | bool Modify(); 74 | 75 | 76 | /* 77 | * Returns current patch target address bytes as hex string 78 | */ 79 | std::string get_CurrBytes(); 80 | }; 81 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/jni/KittyMemory/MemoryBackup.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // MemoryBackup.cpp 3 | // 4 | // Created by MJ (Ruit) on 4/19/20. 5 | // 6 | 7 | #include 8 | #include "MemoryBackup.h" 9 | 10 | 11 | MemoryBackup::MemoryBackup() { 12 | _address = 0; 13 | _size = 0; 14 | _orig_code.clear(); 15 | } 16 | 17 | MemoryBackup::MemoryBackup(const char *libraryName, uintptr_t address, size_t backup_size, bool useMapCache) { 18 | MemoryBackup(); 19 | 20 | if (libraryName == NULL || address == 0 || backup_size < 1) 21 | return; 22 | 23 | _address = KittyMemory::getAbsoluteAddress(libraryName, address, useMapCache); 24 | if(_address == 0) return; 25 | 26 | _size = backup_size; 27 | 28 | _orig_code.resize(backup_size); 29 | 30 | // backup current content 31 | KittyMemory::memRead(&_orig_code[0], reinterpret_cast(_address), backup_size); 32 | } 33 | 34 | 35 | MemoryBackup::MemoryBackup(uintptr_t absolute_address, size_t backup_size) { 36 | MemoryBackup(); 37 | 38 | if (absolute_address == 0 || backup_size < 1) 39 | return; 40 | 41 | _address = absolute_address; 42 | 43 | _size = backup_size; 44 | 45 | _orig_code.resize(backup_size); 46 | 47 | // backup current content 48 | KittyMemory::memRead(&_orig_code[0], reinterpret_cast(_address), backup_size); 49 | } 50 | 51 | MemoryBackup::~MemoryBackup() { 52 | // clean up 53 | _orig_code.clear(); 54 | } 55 | 56 | 57 | bool MemoryBackup::isValid() const { 58 | return (_address != 0 && _size > 0 59 | && _orig_code.size() == _size); 60 | } 61 | 62 | size_t MemoryBackup::get_BackupSize() const{ 63 | return _size; 64 | } 65 | 66 | uintptr_t MemoryBackup::get_TargetAddress() const{ 67 | return _address; 68 | } 69 | 70 | bool MemoryBackup::Restore() { 71 | if (!isValid()) return false; 72 | return KittyMemory::memWrite(reinterpret_cast(_address), &_orig_code[0], _size) == Memory_Status::SUCCESS; 73 | } 74 | 75 | std::string MemoryBackup::get_CurrBytes() { 76 | if (!isValid()) 77 | _hexString = std::string(OBFUSCATE("0xInvalid")); 78 | else 79 | _hexString = KittyMemory::read2HexStr(reinterpret_cast(_address), _size); 80 | 81 | return _hexString; 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/jni/Includes/Quaternion.h: -------------------------------------------------------------------------------- 1 | class Quaternion { 2 | public: 3 | float a; 4 | float b; 5 | float c; 6 | float d; 7 | 8 | Quaternion() {a = 1; b = c = d = 0;} 9 | 10 | // This is a vector that can be rotated in Quaternion space. 11 | Quaternion(float x, float y, float z) {a = 0; b = x; c = y; d = z;} 12 | 13 | // This returns a Quaternion that rotates in each given axis in radians. 14 | // We use standard right hand rule for rotations and coordinates. 15 | static const Quaternion from_euler_rotation(float x, float y, float z); 16 | 17 | // This is like from_euler_rotation but for small angles (less than 45 deg (PI/4)) 18 | static const Quaternion from_euler_rotation_approx(float x, float y, float z); 19 | 20 | Quaternion & operator=(const Quaternion &rhs) { 21 | a = rhs.a; 22 | b = rhs.b; 23 | c = rhs.c; 24 | d = rhs.d; 25 | return *this; 26 | } 27 | 28 | // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/arithmetic/index.htm 29 | Quaternion & operator*=(const Quaternion &q); 30 | const Quaternion operator* (const Quaternion& q) const { return Quaternion(*this) *= q; } 31 | Quaternion & operator+=(const Quaternion &q); 32 | const Quaternion operator+(const Quaternion& q) const { return Quaternion(*this) += q; } 33 | Quaternion & operator*=(float scale); 34 | const Quaternion operator*(float scale) const { return Quaternion(*this) *= scale; } 35 | float norm() const; 36 | Quaternion & normalize(); 37 | const Quaternion conj() const; 38 | // This method takes two vectors and computes the rotation vector between them. 39 | // Both the left and right hand sides must be pure vectors (a == 0) 40 | // Both the left and right hand sides must normalized already. 41 | // This computes the rotation that will tranform this to q. 42 | const Quaternion rotation_between_vectors(const Quaternion& v) const; 43 | float dot_product(const Quaternion& q) const; 44 | 45 | // This method takes one vector and rotates it using this Quaternion. 46 | // The input must be a pure vector (a == 0) 47 | const Quaternion rotate(const Quaternion& q) const; 48 | Quaternion & fractional(float f); 49 | }; 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 14 | 15 | 26 | 27 | 38 | 39 | 43 | 44 |