Skip to content
Guest Big Announcement

Help with multiple arguments on MSHooking

Featured Replies

Solved by AnotherLurker

  • Replies 32
  • Views 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

Both.

 

Heres my code:

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
 if (GetPrefBool(@"key6")) {
arg2 = 0;
%orig (arg1, arg2, arg3);
}
return %orig;

%end

 

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
    if (GetPrefBool(@"key6")) {
        %orig (arg1, 0, INT_MAX);
    }
    
    return %orig;
}

%end
Buys Infinite Items at 0 price. :drink:

Updated by Dwayne Johnson

  • Author

 

I'm going to test run it now.

 

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
    if (GetPrefBool(@"key6")) {
        %orig (arg1, 0, INT_MAX);
    }
    
    return %orig;
}

%end
Buys Infinite Items at 0 price. :drink:

Lol no, my inventory cant fit them all xD.

You don't have to name it arg1... you can name it whatever you want.

idk about this but I see arg is better

 

Both.

Heres my code:

%hook TradePortal
- (void) buyItem:(int)arg1 atTotalPrice:(int)arg2 count:(int)arg3 {
 if (GetPrefBool(@"key6")) {
arg2 = 0;
%orig (arg1, arg2, arg3);
}
return %orig;

%end
it's work with you right ^_^
  • Author

Depends, I would recommend doing this:

 

%orig(arg1, MODIFIED, arg3);
 

Here, only arg2 (MODIFIED) is modified, arg1 and arg3 are "pass-through" values.

Could you give me a code for that?

Might need to use it to fix that "buy one free one" bug.

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.