Ha! Last night I read your comment, assumed you were right, and then came up with a solution that did not assume an executable stack. ;P (I'm actually quite glad, as messing around with the stack would have been much harder.)
https://gist.github.com/807e81ad64c4e84a7770 (SPOILERS)