Skip to content
Guest Big Announcement

Help with multiple arguments on MSHooking

Featured Replies

Solved by AnotherLurker

What if I wanted to make an argument pass-through? Do I just ignore it in the code?

Depends, I would recommend doing this:

 

%orig(arg1, MODIFIED, arg3);

 

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

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

Top Posters In This Topic

Most Popular Posts

  • Solution

What if I only wanted to edit the (bool) in this?

 

 

image.jpg

 

%hook DynamicWorld
- (BOOL)doorCanBeUsedByPathUser:(id)pathUser atPos:(id)pos {
   if (GetPrefBool(@"kHack")) {
       return YES;
   }

   return %orig();
}
%end
:)

What if I only wanted to edit the (bool) in this?

 

image.jpg

 

write return TRUE;

or make it FALSE

 

%hook DynamicWorld
- (BOOL)doorCanBeUsedByPathUser:(id)pathUser atPos:(id)pos {
   if (GetPrefBool(@"kHack")) {
       return YES;
   }

   return %orig();
}
%end
:)
where did you get this (id)pathUser atPos

:rofl:

You need to provide names for arguments, you can't leave them nameless and somehow expect the compiler to properly reference them.

I know

just your code (id)pathUser atPos

is wrong because you need to change pathUser to arg1

also the pic only have (id)atPos

Updated by ITz_kser

  • Author

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

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.