As the title says. I have tried FreeBSD's stack structure but it looks as though Mac does not use that structure. Also, how could I get their value into a particular register (ecx)?

Thanks in advance!

Recommended Answers

All 3 Replies

Funny, I thought I posted something here some hours ago...
Where did it go?

OK, here it is again:

I don't know anything about MACs, but maybe this is of some help:

If you assemble with GAS or GCC the stack is different due to the C program prologue (cinit).

# GCC
# Stack is:
#ESP -> ret addr
#       argc
#       argv -> argv[0] -> "program name"
#               argv[1] -> "Key"
#               argv[2] -> "Infile"
#               argv[3] -> "Outfile"

# GAS
# Stack is:
#ESP -> argc
#       argv[0] -> "program name"
#       argv[1] -> "Key"
#       argv[2] -> "Infile"
#       argv[3] -> "Outfile"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.