Normally, in Delphi one would declare a function with a variable number of arguments using the 'array of const' method. However, for compatibility with code written in C, there's an much-unknown 'varargs' directive that can be added to a function declaration (I learned this while reading Rudy's excellent '[Pitfalls of convering](http://rvelthuis.de/articles/articles-convert.html#varargs)' document).

As an example, one could have a function in C, declared like this :

```
void printf(const char *fmt, ...)

```

In Delphi, this would become :

```
procedure printf(const fmt: PChar); varargs;

```

My question is : How can I get to the contents of the stack when implementing a method which is defined with the 'varargs' directive?

I would expect that some tooling for this exists, like Dephi translations of the va\_start(), va\_arg() and va\_end() functions, but I can't find this anywhere.

Please help!

PS: Please don't drift off in discussions about the 'why' or the 'array of const' alternative - I need this to write C-like patches for functions inside Xbox games (see the Delphi Xbox emulator project 'Dxbx' on sourceforge for details).