The following might help. Some PB code for saving icons and cursors. I actually used the information on the website pointed to in dare's post above to decipher the file format which is actually quite simple. At least it was simple until Vista came along and added png compression!
Thanks Dare, that's the best layout for describing the ico format I've seen so far. Also, srod's code just needs a little study and it will tell the tale in PureBasic, which is the best interface known to man between logic concepts and the human psyche.