Where can I find technical documentation that explains how to add a cover image to a mobi file? I've googled extensively, but can't find anything that describes how it's actually done, and sadly the wiki page doesn't go into enough detail in this area.
Note that I'm looking for documentation on how this is internally represented within the file, I'm not looking for instructions on how to use another program to do this job.
Thanks

.
Edit: Documentation on creating an embedded TOC (i.e. in the metadata rather than inline) would also be useful, I can't find anything on this either.