, .
C ( cdecl) , :
void myfunc(int one, int two, int three)
( , 0):
. . 0x00000000
. .
. .
| current frame |
|----------------|
| return address |
|----------------| ^
| one | | stack
|----------------| | growth
| two | | direction
|----------------| |
| three |
|----------------|
| previous frame |
...
... 0xFFFFFFFF
So, the first argument can be selected first (because we know its location, it is just before the return address), and I hope it contains enough information about how many other arguments are present. For example, in printf(3)and related functions, all information about other arguments is present in the format string, which is the first argument.
source
share