Buffo Posted May 26, 2006 Posted May 26, 2006 Hi, in the Firefox-profile-folder is stored the bookmarks.html which contains the users' favorites with date of entry, description, url and so on and the favicon. The favicon is stored as text. In front of the hexadecimal string is a ICON="data:image/x-icon;base64, I would think it is encoded in base64. How can I decode such a string and store in an single *.ico file? Thx in advance... Regards, Buffo
Simucal Posted May 27, 2006 Posted May 27, 2006 I thought this would be sort of fun so I wrote this up for you real fast:#include "_Base64.au3" $s_Path = FileOpenDialog("Select Firefox Bookmarks.html","C:\Documents And Settings\", "Bookmarks File (bookmarks.html)") If @error Then MsgBox(4096,"","No Bookmark file chosen!") Exit EndIf $s_Bfile = FileRead($s_Path, FileGetSize($s_Path)) $a_Icons = StringRegExp($s_Bfile, 'base64,(.+?)" LAST_CHARSET', 3) If NOT IsArray($a_Icons) Then MsgBox(0, "Error", "No encoded icons were found!") Exit EndIf ;_ArrayDisplay($a_icons, "Array containing B64 Data") For $i = 0 To UBound($a_Icons) - 1 $s_Decode = _Base64Decode($a_Icons[$i], "Converting Icon #: "&$i) FileWrite(@ScriptDir&"\Icon"&$i&".ico", $s_Decode) Next MsgBox(0,"Finished", UBound($a_Icons)&" were decoded from the bookmarks.html file!")Requires the Base64 UDF made by: mikeytown2Direct Link: http://www.autoitscript.com/forum/index.ph...pe=post&id=7480 AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Buffo Posted May 27, 2006 Author Posted May 27, 2006 ;_ArrayDisplay($a_icons, "Array containing B64 Data") For $i = 0 To UBound($a_Icons) - 1 $s_Decode = _Base64Decode($a_Icons[$i], "Converting Icon #: "&$i) FileWrite(@ScriptDir&"\Icon"&$i&".ico", $s_Decode) Next Great work! I located the base64 UDF from mikeytown2 but my english isn't good enough by half to understand the whole thread. But with your example it's very easy. Thank you very much Regards, Buffo
Gilrim Posted May 27, 2006 Posted May 27, 2006 it gives me this: C:\au3\_Base64.au3(237,46) : ERROR: BinaryString(): undefined function. $s_Out &= StringLeft(BinaryString($i_Temp) do I have to use the beta of autoit or?
ChrisL Posted May 27, 2006 Posted May 27, 2006 do I have to use the beta of autoit or?Yes [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now