Jun 04, 2008 6:12 AM
I recently received an email asking me to publish the source for my Favorizer program. I don't think it works correctly in Vista, and I'm not using or maintaining it anymore. So here it is:
Favorizer Source (Zip) - Visual Studio 2005 Solution
The primary interesting thing in the code, and the main reason I wrote the program to begin with, is its ability to determine the ordering of favorites in Internet Explorer. This order is encoded into binary information in the registry, which I partially reverse-engineered:
public class FavHeader : WritableObject
public int int1; // 8 for root...
public short lenData; // (total length - 8) bytes?
public int int2;
public int int3;
public short short4;
public int count; // number of items in the data
public class FavItem : WritableObject
public int int4; // Size of item? ... or related to same
public short rank; // 0-based index of this item under the parent
public int int5;
public short int6;
public short int7;
public int int8;
public short int9;
public short int10;
public short int11;
public string shortname;// DOS name, up to 8 chars
public byte between; // Miscellaneous stuff
public string name; // Full name of folder or link
public int int13;
public int int14;
between = new byte;
As you can see, I guessed at the structure of the data, but have no idea what most of it means. I think there are actually a couple of strangely formatted dates in there. The important thing was figuring out how to determine the boundaries, and which bytes represented the order of the items.
The other potentially useful chunk of code in there concerns loading of favicons. Doing this in a generic and failsafe way for a broad range of sites is surprisingly difficult, because of all the sites that implement it incorrectly. They return the wrong content type, or the wrong image type, or say they're returning an image while sending 404 text.