Ad
  • Custom User Avatar

    This is a C challenge, but I don't believe it's possible purely in C, for x64 - is it?

    Since the first six arguments in SYS-V ABI are passed in registers rdi, rsi, rdx, rcx, r8, r9 and not on the stack, there's no real way to get them without using __asm or other non-C mechanisms perhaps.

    I can find some arguments on the stack by abusing*,&. However, some arguments don't appear to be available without using __asm to try and extract it from registers directly. I could however be wrong. I do see n on the stack, which also confuses me as I would think it would only be in RDI, but past that I don't see anything until argument six of the variadic part. Am I wrong or is the challenge? Is it supposed to be solved with __asm?