i think stack reordering is interesting. regarding writing a function to determine which direction the stack grows, I can think of a few ways, but how would you do it?
When I was asked that a million years ago, I said I'd pass a reference to a local variable to a second function, then compare the address of a local variable in that function to the passed pointer address (in C). If you were writing in ASM you could just save the stack pointer register, increment it, and compare. There's more, but I primarily used the question to see if people understood stack and heap allocation and then could move into stack overflows, swapping, recursion, or a variety of other topics.
@@made-up-of-wires i had a similar idea about calling alloca and checking if the allocation address was higher or lower than a local variable, but your idea is more robust i think.
Thank you for all your hard work. With the current state decompilation, I can do more crazy stuff for my SOTN tool.
I need to check out your SotN & Nightmare Creatures videos!
also, thanks for making these streams. I think I’ll pop into the discord and see if I can help with the decomp too.
Nice to see you in the discord!
i think stack reordering is interesting. regarding writing a function to determine which direction the stack grows, I can think of a few ways, but how would you do it?
When I was asked that a million years ago, I said I'd pass a reference to a local variable to a second function, then compare the address of a local variable in that function to the passed pointer address (in C). If you were writing in ASM you could just save the stack pointer register, increment it, and compare. There's more, but I primarily used the question to see if people understood stack and heap allocation and then could move into stack overflows, swapping, recursion, or a variety of other topics.
@@made-up-of-wires i had a similar idea about calling alloca and checking if the allocation address was higher or lower than a local variable, but your idea is more robust i think.
the man the myth the legend.... *YOU*, not dracula
"Behold my true power!"