Jump to content

H5GG Enhanced Menu Tutorial - JSPlug-in 101


Happy Secret

45 posts in this topic

Recommended Posts

3 minutes ago, Gay 228 said:
  Hide contents


/*
    H5GG Plugin Mod Menu logic should enable easier Mod Menu development for non-jailbroken. It preserve existing H5GG UI and features, while adding new cheat menu.
    Cheat implemented using a patch free approach, the game binary does not required to patch. 
    
    Contribute by Happy Secret on iOSGods (2023)
*/
var script = initializeUnitySupport();

//[MODIFY] Configure Cheat Here
var cheats = {
    JumpHeight: ["CCDrivenController", "m_JumpHeight", "50", "SELF", "ON"],
};

var intervalID;
var aryObj
var cheatState = false;
var cheatMode = "recurrent";
var recurrentInterval = 1200; //try not to be small than 1000, prevent system freeze

function toogleCheat() {
    cheatState = !cheatState;
    document.getElementById("applybutton").textContent = ' Toggle OFF ';
    document.getElementById("applybutton").style.backgroundColor = '#E8E8E850';

    if (cheatState) {
        intervalID = setInterval(function () {
            if (cheatState) {
                try {
                    script = initializeUnitySupport();
                    //[MODIFY]Find core object object list
                    aryObj = script.call("findUnityObjectOfType", ["Oxide$CCDrivenController", true]);
                } catch (e) {
                    //reset Unity Support
                    gIl2cppInit = false;
                    var script = initializeUnitySupport();
                    appendLog("Unity support crashed and reset complete");
                }

                if (!aryObj) {
                    appendLog("Cannot find object to cheat. Engine stopped.");
                    cheatState = false;
                    document.getElementById("applybutton").textContent = ' Toggle Cheat ';
                    return;
                } else if (aryObj.length == 0) {
                    appendLog("Cheat waiting for core object.");
                    return;
                }
                
                for (let i = 0; i < aryObj.length; i++) {
                    //[MODIFY]Start prepare core object for delink / filtering here
                    let CharacterMotor = new UnityObject(aryObj[i]);
                    //debugInfo("BattleCharacter (" + aryObj[i].toString(16) + ") with UnityObject:" + BattleCharacter, [aryObj[i]])
                    CharacterMotor.loadFields(["_config"]);
                    //debugInfo("BattleCharacter (" + aryObj[i].toString(16) + ") with player:" + BattleCharacter.Status, [aryObj[i]])
                    
                    //debugInfo("BattleCharacter (0x" + aryObj[i].toString(16) + ") with CurrentUnitType:" + BattleCharacter.CurrentUnitType, [aryObj[i]])
                    
                    //[MODIFY]Locate the right object to cheat (SELF)
                    let isSelf = true//BattleCharacter.CurrentUnitType==100? true:false;
                    let cheatObj = {};
                    //End prepare core object for delink / filtering here
                    
                    //[MODIFY]Start prepare cheat object here
                    let CharacterMotorConfig = new UnityObject(CharacterMotor._config)
                    CharacterMotorConfig.loadFields(["m_JumpHeight"])
                    cheatObj["CCDrivenController"] = CharacterMotorConfig
                    
                    //End prepare cheat object
                    for (var prop in cheats) {
                        if (Object.prototype.hasOwnProperty.call(cheats, prop)) {
                            let obj;
                            let addr;
                            let oldValue = 0;
                            if (isNaN(cheats[prop][2])){
                                switch (cheats[prop][2]){
                                    case "ONE":
                                        cheats[prop][2] = 1
                                        break;
                                }
                            }
                            if (isSelf && cheats[prop][3] == "SELF" && cheats[prop][4] == "ON") {
                                cheatObj[cheats[prop][0]][cheats[prop][1]] = isNaN(cheats[prop][2]) ? cheatObj[cheats[prop][0]][cheats[prop][2]] : cheats[prop][2];
                            } else if (isSelf==false && cheats[prop][3] == "ENEMY" && cheats[prop][4] == "ON") {
                                cheatObj[cheats[prop][0]][cheats[prop][1]] = isNaN(cheats[prop][2]) ? cheatObj[cheats[prop][0]][cheats[prop][2]] : cheats[prop][2];
                            }//end if TURN ON
                        }
                    }//end For cheat item
                }//end For core object list
                appendLog("Cheat applied successfully");
            } else {
                clearInterval(intervalID);
            }
        }, recurrentInterval);
    } else {
        //code will stop on next coming iteration
        document.getElementById("applybutton").textContent = ' Toggle Cheat ';
        appendLog("Cheat stopped");
    }

    if (cheatMode != "recurrent") clearInterval(intervalID);
}

/* Add button on H5GG UI to open the Cheat UI, if it does not exist */
if ($("#cheatpluginmodmenu").length == 0) {
    var btn = $('<button id="cheatpluginmodmenu">Cheat</button>');
    btn.attr("credit", "Happy Secret");
    btn.click(function () {
        $("#cheatpluginpage").show();
    });
    //backward compatible with standard H5GG menu
    if ($("#frontview").length == 0) {
        $('#results_count').after(btn);
    } else {
        $("#frontview").append(btn);
    }
}

/* Create the Cheat UI Layer, if it does not exist */
if ($("#cheatpluginpage").length == 0) {
    var popup_pixelfancheat_html = $('<div id="cheatpluginpage"  style="background-color: #FDFDFD; width:100%; height:100%; position:absolute; left:0; top:0; border:1px solid #B8B8B880; border-radius: 5px; padding: 0px; z-index: 99999;-webkit-user-select: all;-webkit-touch-callout: default;"></div>');
    $(document.body).append(popup_pixelfancheat_html);
}

/* Generate Clean Cheat Menu UI */
var html = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cheat by Happy Secret';
html += '<br><div style="float:right; font-size:16px; font-family: Arial, sans-serif;" onclick="closecheatpluginpage()">&nbsp;X&nbsp;</div>';

/* Prepare Cheat Item */
for (var prop in cheats) {
    if (Object.prototype.hasOwnProperty.call(cheats, prop)) {
        if (isNaN(cheats[prop][2]))
            html += '<label><input name="' + prop + '"type="checkbox" ' + '" onchange="checkchange(this)" checked/>' + prop + '<output>(' + cheats[prop][4] + ')</output></label>';
        else
            html += '<br><label><input name="' + prop + '"type="range" min="0" max="' + cheats[prop][2] * 2 + '" value="' + cheats[prop][2] + '" style="width:50%" onchange="rangechange(this)" />' + prop + '<output>(' + cheats[prop][2] + ')</output></label>';
    }
}

html += '<p align="center"><button onclick="toogleCheat()" id="applybutton">&nbsp;Toggle Cheat&nbsp;</button>';
html += '</hr><div id="cheatpluginpagelog" class="scrollbar" ></div>';


$("#cheatpluginpage").html(html);
$("#cheatpluginpage").hide();

function closecheatpluginpage() {
    $("#cheatpluginpage").hide();
}

function rangechange(input) {
    cheats[input.name][2] = Number(input.value);

    input.nextElementSibling.value = '(' + input.value + ')';
    //input.previousElementSibling.value = '(' + input.value + ')';

    //Change Apply Button Color to remind user to press Apply
    document.getElementById("applybutton").style.backgroundColor = 'yellow';
}

function checkchange(input) {
    cheats[input.name][4] = input.checked ? "ON" : "OFF"

    input.nextElementSibling.value = '(' + cheats[input.name][4] + ')';

    //Change Apply Button Color to remind user to press Apply
    document.getElementById("applybutton").style.backgroundColor = 'yellow';
}

/* Create Cheat Log */
function appendLog(msg) {
    var oldmsg = $("#cheatpluginpagelog").html();
    if (oldmsg.length > 300) oldmsg = "";
    oldmsg = getCurTime() + ' - ' + msg + '<br>' + oldmsg;
    $("#cheatpluginpagelog").html(oldmsg);
}

yes, of course, the script is in the spoiler

If you want to test out Unity User Object wrapper, I suggest you to use Option 2 first.

 

from you script, I have few questions.

1. Are you sure you can get object pointer for this class Oxide$CCDrivenController

2. Your step 3, doesn’t look right. You are also using _config??CharacterMotor.loadFields(["_config"]);

3. Your step 5, doesn’t look right as well. 
let CharacterMotorConfig = new UnityObject(CharacterMotor._config)???

 

What game is it? 
If you are using you can get an object from Oxide$CCDrivenController. And you just need to update m_JumpHeight from this object. 
 

Your step 3 should be 

CharacterMotor.loadFields(["m_JumpHeight"]); /l

 

You may simplify step 5, to just put CCDrivenController object to cheatObj["CCDrivenController"] = CharacterMotor (or you should rename it) 

 

  • Like 1
Link to comment
Share on other sites

1 час назад Happy Secret сказал:

Если вы хотите протестировать обертку Unity User Object, я предлагаю сначала использовать вариант 2.

 

от твоего сценария, у меня мало вопросов.

1. Вы уверены, что можете получить указатель объекта для этого класса Oxide$CCDrivenController?

2. Ваш шаг 3 выглядит неправильно. Вы также используете _config?? CharacterMotor.loadFields(["_config"]);

3. Ваш шаг 5 тоже выглядит неправильно.
пусть CharacterMotorConfig = новый UnityObject(CharacterMotor._config)???

 

Что это за игра?
Если вы используете, вы можете получить объект из Oxide$CCDrivenController. И вам просто нужно обновить m_JumpHeight с этого объекта.
 

Ваш шаг 3 должен быть

CharacterMotor.loadFields(["m_JumpHeight"]); /l

 

Вы можете упростить шаг 5, чтобы просто поместить объект CCDrivenController в cheatObj["CCDrivenController"] = CharacterMotor (или вы должны переименовать его)


 

 

I need to change the height of the jump
yes i can get everything from ccdrivencontroller
this game: Oxide survival island (survival)
what about _config, I don't quite understand what it is responsible for in the code, can you explain?

Link to comment
Share on other sites

48 minutes ago, Gay 228 said:

I need to change the height of the jump
yes i can get everything from ccdrivencontroller
this game: Oxide survival island (survival)
what about _config, I don't quite understand what it is responsible for in the code, can you explain?

Can you cheat this high jump with H5GG enhanced menu alone?

if the only class object you need is ccdrivencontroller. Then you don’t need to travel to other class object.

 

_config is just an example that I need to travel from CharacterMotor object to CharacterMotorConfig object 

Link to comment
Share on other sites

10 минут назад Happy Secret сказал:

Можете ли вы обмануть этот прыжок в высоту только с улучшенным меню H5GG?

если единственным нужным объектом класса является ccdrivencontroller. Тогда вам не нужно ехать на объект другого класса.

 

_config - это всего лишь пример того, как мне нужно переходить от объекта CharacterMotor к объекту CharacterMotorConfig

i can modify jump with improved h5gg from you.
I just need to push this modification into a java script

Link to comment
Share on other sites

1 hour ago, Happy Secret said:

Можете ли вы обмануть этот прыжок в высоту только с улучшенным меню H5GG?

если единственным нужным объектом класса является ccdrivencontroller. Тогда вам не нужно ехать на объект другого класса.

 

_config - это всего лишь пример того, как мне нужно переходить от объекта CharacterMotor к объекту CharacterMotorConfig

the field I need is in the CCDrivencontroller
do i need a config??

Updated by Gay 228
Link to comment
Share on other sites

14 минут назад Happy Secret сказал:

Тогда вам не нужно.
 

Можете ли вы сначала обмануть вариантом 2?

i want to hack games with your java script i thought it was multitasking, you can just make a menu mod which also h5gg is cool.
what about option 2 i will try. but I don't want to test I want to make a cheat.
can you do esp in java? I would like to see esp just html is already outdated in my opinion

Link to comment
Share on other sites

2 minutes ago, Gay 228 said:

i want to hack games with your java script i thought it was multitasking, you can just make a menu mod which also h5gg is cool.
what about option 2 i will try. but I don't want to test I want to make a cheat.
can you do esp in java? I would like to see esp just html is already outdated in my opinion


if you success in creating cheat script with option 2…the. Option 3 is not far away.

if you can’t even make cheat with option 2, don’t even think about option 3. Option 3 is much advanced 

Link to comment
Share on other sites

52 минуты назад Happy Secret сказал:


если вам удастся создать чит-скрипт с вариантом 2... Вариант 3 находится недалеко.

если вы даже не можете обмануть вариант 2, даже не думайте о варианте 3. Вариант 3 очень продвинутый

unity 5d is not very good, it allows you to create an esp, but I need it in the mod menu

Link to comment
Share on other sites

1 час назад Happy Secret сказал:


если вам удастся создать чит-скрипт с вариантом 2... Вариант 3 находится недалеко.

если вы даже не можете обмануть вариант 2, даже не думайте о варианте 3. Вариант 3 очень продвинутый

yes I tried and advanced to:
get value failed: address format error
What is wrong with me?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Our picks

    • TAIMANIN RPG Extasy v1.0.22 +2 Cheats [ Damage & Defence ]
      Modded/Hacked App: TAIMANIN RPG Extasy By INFINI BRAIN.INC
      Bundle ID: jp.co.infini-brain.taimanin.rpg-extasy
      iTunes Store Link: https://apps.apple.com/us/app/taimanin-rpg-extasy/id6466156741?uo=4


      Hack Features:
      - Damage Multiplier
      - Defence Multiplier
      • 7 replies
    • Battle Mage Idle Cheats v1.2.1 +3
      Modded/Hacked App: Battle Mage Idle By SuperPlanet corp.
      Bundle ID: com.superplanet.battlemage
      iTunes Store Link: https://apps.apple.com/us/app/battle-mage-idle/id6474856084?uo=4


      Hack Features:
      - Multiply Attack
      - God Mode
      - Freeze Currencies
      - Other minor things
      NOTE: Do not abuse or buy ViP for just this cheat


      iOS Hack Download Link: https://iosgods.com/topic/183601-battle-mage-idle-cheats-v121-3/
      • 22 replies
    • Grow Shooter : Survivor RPG v1.0.24 +2 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Grow Shooter : Survivor RPG By DongSik Moon
      Bundle ID: com.eastmoon.growshooterlive
      iTunes Store Link: https://apps.apple.com/us/app/grow-shooter-survivor-rpg/id6480362458?uo=4


      Hack Features:
      - Unlimited Coins -> Will not decrease.
      - Unlimited Rubies -> Will not decrease.


      Jailbreak required hack(s): [Mod Menu Hack] Grow Shooter : Survivor RPG v1.0.10 +4 Cheats [ Damage ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 33 replies
    • Grow Shooter : Survivor RPG v1.0.24 +4 Cheats [ Damage ]
      Modded/Hacked App: Grow Shooter : Survivor RPG By DongSik Moon
      Bundle ID: com.eastmoon.growshooterlive
      iTunes Store Link: https://apps.apple.com/us/app/grow-shooter-survivor-rpg/id6480362458?uo=4


      Hack Features:
      - Damage Multiplier
      - Move Speed Multiplier
      - Unlimited Coins -> Will not decrease.
      - Unlimited Rubies -> Will not decrease.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Grow Shooter : Survivor RPG v1.0.10 +2 Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 56 replies
    • Survivor Base - Zombie Siege v1.7 +1++ Jailed Cheats [ Unlimited Resources ]
      Modded/Hacked App: Survivor Base - Zombie Siege By Longames TEC Co.,Ltd
      Bundle ID: com.jlyt.deadrising
      iTunes Store Link: https://apps.apple.com/us/app/survivor-base-zombie-siege/id6479394876?uo=4


      Hack Features:
      - Unlimited Resources


      Jailbreak required hack(s): [Mod Menu Hack] Survivor Base - Zombie Siege v1.3 +1++ Cheats [ Unlimited Resources ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 20 replies
    • Survivor Base - Zombie Siege v1.7 +1++ Cheats [ Unlimited Resources ]
      Modded/Hacked App: Survivor Base - Zombie Siege By Longames TEC Co.,Ltd
      Bundle ID: com.jlyt.deadrising
      iTunes Store Link: https://apps.apple.com/us/app/survivor-base-zombie-siege/id6479394876?uo=4


      Hack Features:
      - Unlimited Resources


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Survivor Base - Zombie Siege v1.3 +1++ Jailed Cheats [ Unlimited Resources ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 28 replies
    • Plants vs. Zombies™ 3 v16.1.1 +4 Jailed Cheats [ Freeze Resources ]
      Modded/Hacked App: Plants vs. Zombies™ 3 By EA Swiss Sarl
      Bundle ID: com.ea.ios.pvzn3xt
      iTunes Store Link: https://apps.apple.com/gb/app/plants-vs-zombies-3/id1666636976?uo=4


      Hack Features:
      - Freeze Sun
      - Freeze Plant Food
      - Freeze Promotions
      - No Plant Spawn Cooldown


      Jailbreak required hack(s): [Mod Menu Hack] Plants vs. Zombies™ 3 v8.0.17 +4 Cheats [ Freeze Resources ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 109 replies
    • Dawn of Ages: Medieval Games v1.1.2 +1 Jailed Cheat [ Auto Win ]
      Modded/Hacked App: Dawn of Ages: Medieval Games By BoomBit, Inc.
      Bundle ID: com.stratospheregames.dawnofages
      iTunes Store Link: https://apps.apple.com/us/app/dawn-of-ages-medieval-games/id6477473268?uo=4


      Hack Features:
      - Auto Win


      Jailbreak required hack(s): [Mod Menu Hack] Dawn of Ages: Medieval Games v1.0.3 +1 Cheat [ Auto Win ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 16 replies
    • Dawn of Ages: Medieval Games v1.1.2 +1 Cheat [ Auto Win ]
      Modded/Hacked App: Dawn of Ages: Medieval Games By BoomBit, Inc.
      Bundle ID: com.stratospheregames.dawnofages
      iTunes Store Link: https://apps.apple.com/us/app/dawn-of-ages-medieval-games/id6477473268?uo=4


      Hack Features:
      - Auto Win


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Dawn of Ages: Medieval Games v1.0.3 +1 Jailed Cheat [ Auto Win ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 45 replies
    • Plants vs. Zombies™ 3 v16.1.1 +4 Cheats [ Freeze Resources ]
      Modded/Hacked App: Plants vs. Zombies™ 3 By EA Swiss Sarl
      Bundle ID: com.ea.ios.pvzn3xt
      iTunes Store Link: https://apps.apple.com/gb/app/plants-vs-zombies-3/id1666636976?uo=4


      Hack Features:
      - Freeze Sun
      - Freeze Plant Food
      - Freeze Promotions
      - No Plant Spawn Cooldown


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Plants vs. Zombies™ 3 v8.0.17 +4 Jailed Cheats [ Freeze Resources ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 61 replies
    • Hot in Hollywood v0.98 +1++ Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Hot in Hollywood By SodeePI Labs, LLC
      Bundle ID: com.sodeepilabs.glamsquad
      iTunes Store Link: https://apps.apple.com/gb/app/hot-in-hollywood/id1604253094?uo=4


      Hack Features:
      - Unlimited Currencies


      Jailbreak required hack(s): [Mod Menu Hack] Hot in Hollywood v0.90 +1++ Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 54 replies
    • Hot in Hollywood v0.98 +1++ Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Hot in Hollywood By SodeePI Labs, LLC
      Bundle ID: com.sodeepilabs.glamsquad
      iTunes Store Link: https://apps.apple.com/gb/app/hot-in-hollywood/id1604253094?uo=4


      Hack Features:
      - Unlimited Currencies


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Hot in Hollywood v0.90 +1++ Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 12 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines