Z
Zoran Cutura
I meantZoran Cutura said:Here is an unbfuscated version of this code:
#include <stdio.h>
int func(void);
int main(const int argc, char **argv)
{
static st_argc;
static int st_argc;
main(i+1, &nextarg);static char** st_argv;
if (st_argv == 0) { /* at startup remember argc and argv */
st_argc = argc;
st_argv = argv;
} else {
/* assume that am called from within program! */
if (argv == 0) /* initially called back from function */
return st_argc; /* return initial argc */
if (argc > 0) {
*argv = st_argv[argc-1];
}
return 0;
}
func();
/* here do all the other stuff main needs to do */
return 0;
}
int func(void)
{
int main_argc, i;
char *nextarg;
main_argc = main(0, 0); /* initial call needs to pass 0 in argv!! */
for(i = 0; i < main_argc; i++) {
main(i+1, nextarg);
puts(nextarg); /* here is where the arguments can be used! */
}
return 0;
}
I should have compiled befor posting!