Jump to content

error: use of undeclared identifier 'mp'


Go to solution Solved by Sakanya,

3 posts in this topic

Recommended Posts

Posted

Heya

 

So I'm trying to add a hook into the MM, since this worked on shmoo's MM, but the mm is buggy, I wanna do it on Arthurs.

 

This is the code I'm using:

    int (*orig_func)(void *self);

    int new_func(void *self)
    {
        
        BOOL featureIsActive = [menu getBool:@"k02BasicSwitcher"];
        
        if (featureIsActive)
            return 999999;
        else
            return orig_func(self);
    }

%ctor
{
    NSDictionary *hacks =
    @{

        @"k02BasicSwitcher":@{
            @"offsets": @[@"0x0ffset"],
            @"desc": @"This will make the enemy dead within one hit.",
            @"label": @"One Hit Kill"
            },
    };


MSHookFunction((void*)[mp calculateAddress:0x0ffset], (void*)new_func, (void**)&orig_func);

 

What's wrong?

Why I'm getting the error?

  • Solution
Posted (edited)

You're getting this error because the given example for hooking has not been updated to conform with the rest of the changes made to the library and template.

 

You can work around this issue by trying the following :

// You must do this if you're working with a 64-bit binary because of ASLR
MSHookFunction((void*)(_dyld_get_image_vmaddr_slide(0) + 0x000000000), (void*)newFunction, (void**)&oldFunction);

//Otherwise, you can omit "_dyld_get_image_vmaddr_slide(0)"
MSHookFunction((void*)(0x000000000), (void*)newFunction, (void**)&oldFunction);

 

Moreover, if you're only applying a hook, you don't need to define offsets or patches. All you need is the label and description.

Updated by Sakanya
Removed unnecessary comma.
Posted
On 1-11-2017 at 2:38 AM, Sakanya said:

You're getting this error because the given example for hooking has not been updated to conform with the rest of the changes made to the library and template.

 

You can work around this issue by trying the following :


// You must do this if you're working with a 64-bit binary because of ASLR
MSHookFunction((void*)(_dyld_get_image_vmaddr_slide(0) + 0x000000000), (void*)newFunction, (void**)&oldFunction);

//Otherwise, you can omit "_dyld_get_image_vmaddr_slide(0)"
MSHookFunction((void*)(0x000000000), (void*)newFunction, (void**)&oldFunction);

 

Moreover, if you're only applying a hook, you don't need to define offsets or patches. All you need is the label and description.

Never saw someone answered this. I just tried it & worked perfectly. 

Thankyou!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Spin Squad! v1.6.2 [ +2 Cheats ] Battle Coins
      Modded/Hacked App: Lucky Offense By Crater Co., Ltd.
      Bundle ID: com.percent.ios.luckyrolling
      iTunes Store Link: https://apps.apple.com/us/app/lucky-offense/id6511224968?uo=4


      🤩 Hack Features

      - Battle Coins
      - ATK
      - ATK Range
      - ATK Speed

      ATK Linked Enemy
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 89 replies
    • Idle Monkey Bagpack War v1.0.9 [ +3 Jailed ] Battle Coin
      Modded/Hacked App: Idle Monkey: Bagpack War By 永进 何
      Bundle ID: com.letui.backpack.ios
      iTunes Store Link: https://apps.apple.com/us/app/idle-monkey-bagpack-war/id6670150325?uo=4


      🤩 Hack Features

      - ADS
      - Battle Coins
      - HP
        • Like
      • 8 replies
    • Galaxy Pirates - space attack v1.1.1 [ +14 Jailed ] Currency Max
      Modded/Hacked App: Galaxy Pirates - space attack By 军 黄
      Bundle ID: com.allenjoy.galaxypirates
      iTunes Store Link: https://apps.apple.com/us/app/galaxy-pirates-space-attack/id6475720088?uo=4

        

      🤩 Hack Features

      - Gems

      - Coins

      - Energy

      - Mission Rewards

      - Ship Upgrade Cost 0

      - Ship Unlock Cost 0

      - Magnet Range

      - Bullet Max 30

      - Bullet Speed

      - HP [ Linked With Card Just Unlock ]

      - DMG [ Linked With Card Just Unlock ]

      - Coins Bonus [ Linked With Card Just Unlock ]

      - Lucky [ Linked With Card Just Unlock ]

      - Super Time [ Linked With Card Just Unlock ]
        • Like
      • 9 replies
    • Galaxy Pirates - space attack v1.1.1 [ +14 Cheats ] Currency Max
      Modded/Hacked App: Galaxy Pirates - space attack By 军 黄
      Bundle ID: com.allenjoy.galaxypirates
      iTunes Store Link: https://apps.apple.com/us/app/galaxy-pirates-space-attack/id6475720088?uo=4
       

      🤩 Hack Features

      - Gems

      - Coins

      - Energy

      - Mission Rewards

      - Ship Upgrade Cost 0

      - Ship Unlock Cost 0

      - Magnet Range

      - Bullet Max 30

      - Bullet Speed

      - HP [ Linked With Card Just Unlock ]

      - DMG [ Linked With Card Just Unlock ]

      - Coins Bonus [ Linked With Card Just Unlock ]

      - Lucky [ Linked With Card Just Unlock ]

      - Super Time [ Linked With Card Just Unlock ]
        • Winner
        • Like
      • 5 replies
    • Magic Brick Wars v1.4.2 [ +4 Cheats ] Always Win
      Modded/Hacked App: Magic Brick Wars By Halfbrick
      Bundle ID: com.halfbrick.brickwars
      iTunes Store Link: https://apps.apple.com/us/app/magic-brick-wars/id1330800318?uo=4


      🤩 Hack Features

      - Mana Cost 0
      - Units [ Deploy Unlimited ]
      - Enemy No Units
      - Enemy No Blocks
        • Agree
        • Winner
      • 11 replies
    • Magic Brick Wars v1.4.2 [ +4 Jailed ] Always Win
      Modded/Hacked App: Magic Brick Wars By Halfbrick
      Bundle ID: com.halfbrick.brickwars
      iTunes Store Link: https://apps.apple.com/us/app/magic-brick-wars/id1330800318?uo=4


      🤩 Hack Features

      - Mana Cost 0
      - Units [ Deploy Unlimited ]
      - Enemy No Units
      - Enemy No Blocks
        • Like
      • 10 replies
    • Idle Monkey Bagpack War v1.0.9 [ +3 Cheats ] Battle Coin
      Modded/Hacked App: Idle Monkey: Bagpack War By 永进 何
      Bundle ID: com.letui.backpack.ios
      iTunes Store Link: https://apps.apple.com/us/app/idle-monkey-bagpack-war/id6670150325?uo=4
       

      🤩 Hack Features

      - ADS
      - Battle Coins
      - HP
        • Like
      • 3 replies
    • DESERTOPIA v4.20.5 [ +1 Cheats ] Gems Max
      Modded/Hacked App: DESERTOPIA By Gamtropy Co., Ltd.
      Bundle ID: com.gamtropy.desertopia
      iTunes Store Link: https://apps.apple.com/us/app/desertopia/id1265572046?uo=4


      🤩 Hack Features

      - Gems Max [ Earn Some ]
        • Like
      • 3 replies
    • DESERTOPIA v4.20.5 [ +1 Jailed ] Gems Max
      Modded/Hacked App: DESERTOPIA By Gamtropy Co., Ltd.
      Bundle ID: com.gamtropy.desertopia
      iTunes Store Link: https://apps.apple.com/us/app/desertopia/id1265572046?uo=4
       

      🤩 Hack Features

      - Gems Max [ Earn Some ]
        • Like
      • 1 reply
    • [ Arknights China ] 明日方舟 Cheats v2.6.21 +8
      Modded/Hacked App: 明日方舟 By Shanghai Hypergryph Network Technology Co., Ltd.
      Bundle ID: com.hypergryph.arknights
      iTunes Store Link: https://apps.apple.com/cn/app/%E6%98%8E%E6%97%A5%E6%96%B9%E8%88%9F/id1454663939?uo=4


      Hack Features:
      - God Mode
      - Frozen Enemies
      - One Hit Kill
      - Instant - Win
      - No Deploy Cost
      - Multiply Damage
      - Multiply Defense
      - Multiply Character Speed


      iOS Hack Download Link: https://iosgods.com/topic/149509-arknights-china-%E6%98%8E%E6%97%A5%E6%96%B9%E8%88%9F-cheats-v1560-8/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 315 replies
    • Meow Tower - Nonogram Puzzle v3.2.401 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Meow Tower - Nonogram Puzzle By HyperBeard Inc.
      Bundle ID: com.grapetree.meowtower
      iTunes Store Link: https://apps.apple.com/us/app/meow-tower-nonogram-puzzle/id1579122980?uo=4
       

      🚀 Hack Features

      - ADS NO
      - Gold CANS
      - Pencil Max 
      - Hints Max 
        • Like
      • 11 replies
    • Meow Tower - Nonogram Puzzle v3.2.401 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Meow Tower - Nonogram Puzzle By HyperBeard Inc.
      Bundle ID: com.grapetree.meowtower
      iTunes Store Link: https://apps.apple.com/us/app/meow-tower-nonogram-puzzle/id1579122980?uo=4


      🚀 Hack Features

      - ADS NO
      - Gold CANS
      - Pencil Max 
      - Hints Max
        • Thanks
        • Like
      • 5 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