2

I'm trying to swizzle a function and call the original implementation with the function args. the new IMP is of the form:

static id WrapperFunction(id self, SEL _cmd, ...) {
     va_list args;
     va_start(args, _cmd);

     originalImp(self, _cmd, args);
     ...
}

This is clearly wrong since args now contains _cmd while ... did not.

How can I pass ... to originalImp?

Tomer Shiri
  • 949
  • 1
  • 10
  • 19

1 Answers1

0

Gcc has: http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html

clang has nothing and you must do assembly to do that (basically if you know the address of originalImp, you just want to "jmp" to it).

JTAS
  • 431
  • 4
  • 6