If you missed it, an Adobe engineer, Scott Petersen, gave a talk at Chicago Max a couple of months ago, showcasing some crazy side project of his, that allows him to run c/c++ code on top of an unmodified Flash player.
This has various implications, one of which is one could someday interface their as3 code directly with a library like openSSL.
Anyway, it’s neat, and so I’m kinda starting on a quest to figure out how it’s done. So far, I can see 2 big chunks to this:
- map those bytecodes to those bytecodes.
- put together an actionscript runtime that lets C code feel at home. That includes reconciling the asynchronousness of as3 with the synchronousness of a C program. Also things like arbitrary pointer arithmetic would need to be handled.
Beside this crazy but fun exploration, I’m also reading some specs on ASN.1 and such, so it’s possible as3crypto might sprout a ASN.1 parser that doesn’t suck.
Part of the fun here is mapping the ASN.1 type notation to something very similar-looking, yet valid as AS3 code. The other part is having a DER parser that doesn’t think typing is optional or fuzzy.