Re:Hack your way through Stripe's Capture the Flag
by mjijackson on Wednesday February 22, 2012 @06:25PM
(#3622988)
Read this if you're stuck on level 3: http://destroy.net/machines/security/P49-14-Aleph-One
[ Parent
| on HN ]
Re:Hack your way through Stripe's Capture the Flag
by dthunt on Wednesday February 22, 2012 @06:37PM
(#3623045)
<3
I read this back in college, ages ago. Still relevant - not quite up there with K&R as far as technical writing goes, but it does indeed do the job of making a theoretical problem into an understandable & exploitable one, and for that reason "Smashing the Stack For Fun And Profit" is a phrase that has a special place in my heart.
Re:Hack your way through Stripe's Capture the Flag
by mirkules on Thursday February 23, 2012 @12:56PM
(#3625920)
Thanks for that link. Reading through one of the first sections about pushing parameters to the stack, I noticed the call:
gcc -S -o example1.s example1.c
However, example1.s looks very different on Mac than on Linux, in particular, on Mac the parameters are pushed in reverse order:
Leh_func_begin2: ...
movl $1, %eax
movl $2, %ecx
movl $3, %edx
movl %eax, %edi
movl %ecx, %esi
callq _function
Whereas on Linux, they are pushed in the order specified in that link: movl $3, %edx
movl $2, %esi
movl $1, %edi
call function
What is the reason behind this? Is it that the stack on OS X is implemented to grow up instead of down?