Jump to content

How To mod Enum? in hook


6 posts in this topic

Recommended Posts

You cannot directly mod those enums, they're constants

for example, 

1 = Gold
2 = Gems, etc..

Instead of wasting your time and writing strings, you can use integers to identify those strings

You should look for functions that make use of these enums

  • Like 1
Link to comment
Share on other sites

On 10/04/2022 at 10:38, Zahir said:

Você não pode modificar diretamente esses enums, eles são constantes

por exemplo, 

1 = Ouro
2 = Gemas, etc.

Em vez de desperdiçar seu tempo e escrever strings, você pode usar números inteiros para identificar essas strings

Você deve procurar funções que fazem uso dessas enumerações

send me script example, pls

Link to comment
Share on other sites

DamageType.Generic is equal to int damageType = 0; (same as DamageType damageType = DamageType.Generic)
DamageType.Hunger is equal to int damageType = 1;
DamageType.Thirst
is equal to int damageType = 2;

void MakeDamage(int damage, DamageType damageType) - > MakeDamage(100, DamageType.Generic) -> MakeDamage(100, 0)

hook function
 

void (*MakeDamage)(void *instance, int damage, int damageType) = nil;
void _MakeDamage(void *instance, int damage, int damageType){
  if(damageType == 0)
  {
    damageType = 1;
    MakeDamage(instance, damage, damageType);
  }
  else if(damageType == 1)
  {
    MakeDamage(instance, 0, damageType);
  }
  else
  {
    MakeDamage(instance, damage, damageType);
  }
}

 

Updated by gogigogi1
Link to comment
Share on other sites

2 hours ago, gogigogi1 said:

DamageType.Generic is equal to int damageType = 0; (same as DamageType damageType = DamageType.Generic)
DamageType.Hunger is equal to int damageType = 1;
DamageType.Thirst
is equal to int damageType = 2;

void MakeDamage(int damage, DamageType damageType) - > MakeDamage(100, DamageType.Generic) -> MakeDamage(100, 0)

hook function
 

void (*MakeDamage)(void *instance, int damage, int damageType) = nil;
void _MakeDamage(void *instance, int damage, int damageType){
  if(damageType == 0)
  {
    damageType = 1;
    MakeDamage(instance, damage, damageType);
  }
  else if(damageType == 1)
  {
    MakeDamage(instance, 0, damageType);
  }
  else
  {
    MakeDamage(instance, damage, damageType);
  }
}

 

 

 

 

I tried but it didn't work, see my script

i want to do fall damage when i jump high

 

	// Token: 0x06001E39 RID: 7737 RVA: 0x00002053 File Offset: 0x00000253
		[Token(Token = "0x6001E39")]
		[Address(RVA = "0x6E2D68", Offset = "0x6E2D68", VA = "0x6E2D68")]
		public void Hurt(float amount, ET.DamageType type, [Optional] PlayerManager attacker)
		{
		}


// Oxide.ET.DamageType
// Token: 0x04001A78 RID: 6776
[Token(Token = "0x4001A78")]
public const ET.DamageType Fall = 12;


// its my code in mod menu



void (*orig_Update) (void* instance);
void Update(void* instance) {


    if (instance != NULL && hack1)

    {

        *(float*)((uint64_t)instance + 0x90) = 12.0f; // jump height
        *(float*)((uint64_t)instance + 0x88) = 12.0f; //speed

    }


    return orig_Update(instance);
}

void (*orig_Hurt)(void *instance,float amount, int DamageType , int attacker) ;
void Hurt(void *instance, float amount, int DamageType,int attacker){
    if(hack1 && DamageType == 12)
    {
        DamageType = 12; // fall
        Hurt(instance, 0, DamageType ,attacker);
    }
        else if(DamageType == 12)
        {
            Hurt(instance, 0, DamageType,attacker);
        }
        else
        {
            Hurt(instance,amount,DamageType,attacker);
        }
    }


// hook


 MSHookFunction((void *)getAbsoluteAddress(targetLibName,string2Offset(OBFUSCATE_KEY("0x6E2D2C",'?'))),(void *) Hurt,(void **)&orig_Hurt);

 MSHookFunction((void *)getAbsoluteAddress(targetLibName,string2Offset(OBFUSCATE_KEY("0x737570",'?'))),(void *) Update,(void **)&orig_Update);


I also changed the DamageType to type but it didn't work..
  
  
  

 

https://www.youtube.com/watch?v=Tgx4vIDO_kY

game :  https://play.google.com/store/apps/details?id=com.catsbit.oxidesurvivalisland&hl=pt_BR&gl=US

Updated by fdhbyfgd
Link to comment
Share on other sites

first of all its seems thats u hook wrong function

because u hook is wrong and will not work at all

 

void (*orig_Hurt)(void *instance,float amount, int DamageType , int attacker) ;
void Hurt(void *instance, float amount, int DamageType,int attacker){
    if(hack1 && DamageType == 12)
    {
        DamageType = 12; // fall
        orig_Hurt(instance, 0, DamageType ,attacker);
    }
        else if(DamageType == 12)
        {
            orig_Hurt(instance, 0, DamageType,attacker);
        }
        else
        {
            orig_Hurt(instance,amount,DamageType,attacker);
        }
}


 

with ur mistake u not able take damage at all but u take

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

    • West Escape v1.0.15 +7++ Jailed Cheats [ Unlimited Everything ]
      Modded/Hacked App: West Escape By Estoty LLC
      Bundle ID: com.western.escape
      iTunes Store Link: https://apps.apple.com/us/app/west-escape/id6474681724?uo=4


      Hack Features:
      - Unlimited Everything
      - God Mode
      - God Mode - Horse
      - One-Hit Kill
      - No Ads -> Head into Settings and toggle the Discord Support button.


      Jailbreak required hack(s): [Mod Menu Hack] West Escape v1.0.13 +7++ Cheats [ Unlimited Everything ] - 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/
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 44 replies
    • Merge 2 Survive: Zombie Game v1.1.2 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Merge 2 Survive: Zombie Game By Pixodust Aplicativos LTDA
      Bundle ID: com.pixodust.games.merge.survive.puzzle.game
      iTunes Store Link: https://apps.apple.com/us/app/merge-2-survive-zombie-game/id6468487156?uo=4


      Hack Features:
      - Unlimited Coins
      - Unlimited Diamonds
      - Unlimited Energy


      Jailbreak required hack(s): [Mod Menu Hack] Merge 2 Survive: Zombie Game v1.0.3 +3 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/
        • Agree
        • Thanks
        • Like
      • 10 replies
    • Merge 2 Survive: Zombie Game v1.1.2 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Merge 2 Survive: Zombie Game By Pixodust Aplicativos LTDA
      Bundle ID: com.pixodust.games.merge.survive.puzzle.game
      iTunes Store Link: https://apps.apple.com/us/app/merge-2-survive-zombie-game/id6468487156?uo=4


      Hack Features:
      - Unlimited Coins
      - Unlimited Diamonds
      - Unlimited Energy


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Merge 2 Survive: Zombie Game v1.0.3 +3 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/
        • Informative
        • Thanks
        • Winner
        • Like
      • 16 replies
    • West Escape v1.0.15 +7++ Cheats [ Unlimited Everything ]
      Modded/Hacked App: West Escape By Estoty LLC
      Bundle ID: com.western.escape
      iTunes Store Link: https://apps.apple.com/us/app/west-escape/id6474681724?uo=4


      Hack Features:
      - Unlimited Everything
      - God Mode
      - God Mode - Horse
      - One-Hit Kill
      - One-Hit w/ Tool
      - No Tool Level Requirement
      - No Ads -> Head into Settings and toggle the Discord Support button.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] West Escape v1.0.13 +5++ Cheats [ Unlimited Everything ] - 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 25 replies
    • Hoosegow: Prison Survival v2.6.7 +40++ Jailed Cheats [ Debug Menu ]
      Modded/Hacked App: Hoosegow: Prison Survival By D.DREAM GAMES LLC
      Bundle ID: com.ddreamgames.hoosegow
      iTunes Store Link: https://apps.apple.com/us/app/hoosegow-prison-survival/id1587312327?uo=4


      Hack Features:
      - Debug Menu -> Head into Settings and toggle the Report a problem button.


      Jailbreak required hack(s): [Mod Menu Hack] Hoosegow: Prison Survival v2.2.4 +40++ Cheats [ Debug Menu ] - 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 57 replies
    • Hoosegow: Prison Survival v2.6.7 +40++ Cheats [ Debug Menu ]
      Modded/Hacked App: Hoosegow: Prison Survival By D.DREAM GAMES LLC
      Bundle ID: com.ddreamgames.hoosegow
      iTunes Store Link: https://apps.apple.com/us/app/hoosegow-prison-survival/id1587312327?uo=4


      Hack Features:
      - Debug Menu -> Head over to Settings and toggle the Report a problem button.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Hoosegow: Prison Survival v2.2.4 +40++ Jailed Cheats [ Debug Menu ] - 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 36 replies
    • Supermarket Manager Simulator v1.0.9 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Supermarket Manager Simulator By Digital Melody S.A.
      Bundle ID: com.dmg.supermarket.simulator
      iTunes Store Link: https://apps.apple.com/us/app/supermarket-manager-simulator/id6479982512?uo=4


      Hack Features:
      - Unlimited Cash -> Will increase instead of decrease.
      - Unlimited Energy -> Will increase instead of decrease.
      - No Ads


      Jailbreak required hack(s): [Mod Menu Hack] Supermarket Manager Simulator v1.0.6 +3 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 48 replies
    • Supermarket Manager Simulator v1.0.9 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Supermarket Manager Simulator By Digital Melody S.A.
      Bundle ID: com.dmg.supermarket.simulator
      iTunes Store Link: https://apps.apple.com/us/app/supermarket-manager-simulator/id6479982512?uo=4


      Hack Features:
      - Unlimited Cash -> Will increase instead of decrease.
      - Unlimited Energy -> Will increase instead of decrease.
      -- No Ads


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Supermarket Manager Simulator v1.0.6 +3 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/
        • Informative
        • Agree
        • Thanks
        • Like
      • 21 replies
    • Stealth Master: Assassin Ninja v1.12.15 +4++ Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Stealth Master: Assassin Ninja By SayGames LTD
      Bundle ID: io.highcore.stealthmaster
      iTunes Store Link: https://apps.apple.com/us/app/stealth-master-assassin-ninja/id1518389230
       

      Hack Features:
      - God Mode
      - One-Hit Kill
      - Unlimited Currencies
      - All Characters Unlocked


      Jailbreak required hack(s): https://iosgods.com/topic/173267-stealth-master-assassin-ninja-v1128-4-cheats-damage-defence/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 13 replies
    • Mighty DOOM v1.13.1 +2 Jailed Cheats [ God & OHK ]
      Modded/Hacked App: Mighty DOOM By Bethesda
      Bundle ID: com.bethsoft.ubu
      iTunes Store Link: https://apps.apple.com/us/app/mighty-doom/id1535673981
       

      Hack Features:
      - God Mode -> You will take damage but you won't die.
      - One-Hit Kill


      Jailbreak required hack(s): https://iosgods.com/topic/170017-mighty-doom-v100-2-cheats-damage-multiplier/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 127 replies
    • Mighty DOOM v1.13.1 +2 Cheats [ Damage Multiplier ]
      Modded/Hacked App: Mighty DOOM By Bethesda
      Bundle ID: com.bethsoft.ubu
      iTunes Store Link: https://apps.apple.com/us/app/mighty-doom/id1535673981
       

      Hack Features:
      - God Mode -> You will take damage but you won't die.
      - Damage Multiplier


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/170103-mighty-doom-v100-2-jailed-cheats-one-hit-kill/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 157 replies
    • Stealth Master: Assassin Ninja v1.12.15 +4++ Cheats [ Damage & Defence ]
      Modded/Hacked App: Stealth Master: Assassin Ninja By SayGames LTD
      Bundle ID: io.highcore.stealthmaster
      iTunes Store Link: https://apps.apple.com/us/app/stealth-master-assassin-ninja/id1518389230
       

      Hack Features:
      - Damage Multiplier
      - Defence Multiplier
      - Unlimited Currencies -> Restart the app for it to take effect.
      - All Characters Unlocked


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 25 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