3 #include "magicfunction.h"
4 #define MAX 4194304/sizeof(uint64_t)
5 uint64_t determine_start()
11 uint64_t filler
= 0x123412341234;
15 /*Fill the stack with a filler value*/
16 for(p
= &stack
-1; p
>= &stack
- 1 - MAX
; p
--)
18 /*Find the beginning of the function stack with the function*/
20 for(q
= &stack
-1; q
>=&stack
-1-MAX
; q
--)
21 if(*q
== 0x567856785678)
23 /*Run the function and find the last occurance of non stack filler */
25 for(p
= &stack
- 1 - MAX
; p
<= q
; p
++)
28 printf("%td byte stack size used\n", (char*)p
-(char*)q
);