JoshDB Posted May 17, 2006 Share Posted May 17, 2006 Very helpful UDF, thanks a lot Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite Link to comment Share on other sites More sharing options...
Raik Posted May 30, 2007 Share Posted May 30, 2007 decoder does not work for me. will use it for decoding http-auth AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1) Link to comment Share on other sites More sharing options...
ShaneHale Posted May 31, 2007 Share Posted May 31, 2007 Just looking at theis encoder stuff... Has this evolved into something else? Does not seem to work with current versionm 3.2.4.9 - Gets an error about BinaryString. Did a search and replace to reflect it being renamed to Binary. Then I got another error: C:\autoit_stuff\_Base64.au3 (258) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:Would be useful if it worked again....Thanks,Shane Link to comment Share on other sites More sharing options...
BrettF Posted May 31, 2007 Share Posted May 31, 2007 Just looking at theis encoder stuff... Has this evolved into something else? Does not seem to work with current versionm 3.2.4.9 - Gets an error about BinaryString. Did a search and replace to reflect it being renamed to Binary. Then I got another error: Would be useful if it worked again....Thanks,ShaneIt is my belief that BinaryString was changed?? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Raik Posted June 7, 2007 Share Posted June 7, 2007 It is my belief that BinaryString was changed??not "changed", just renamed. and if so, does it help, to reject, what ShaneHale wrote?fixing the error will help. AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1) Link to comment Share on other sites More sharing options...
vrocco Posted July 17, 2007 Share Posted July 17, 2007 I tried changing the BinaryString() calls to Binary() and it doesn't work. Won't decode correctly. What can I do to use this? Link to comment Share on other sites More sharing options...
RazerM Posted July 17, 2007 Share Posted July 17, 2007 BinaryToString() and StringToBinary() My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
vrocco Posted July 17, 2007 Share Posted July 17, 2007 Hmmm.....I find that function in the help file, but Scite doesn't recognize it when I type it. Do I need some kind of #include to use it? When I run the script with BinaryToString() replacing BinaryString() I get an unknown function error. Link to comment Share on other sites More sharing options...
vrocco Posted July 17, 2007 Share Posted July 17, 2007 OK got that working finally. Now I get an error in line 258 "Array variable has incorrect number of subscripts or subscript dimension range exceeded." How do I fix this? Link to comment Share on other sites More sharing options...
mikeytown2 Posted July 18, 2007 Author Share Posted July 18, 2007 (edited) wow, never would have thought AutoIt would change that much.... anyway i fixed the example and core files.Download New Files From Second PostIncase anyone is looking for the old BinaryString() function i found this post...http://www.autoitscript.com/forum/index.ph...mp;#entry367545 Edited July 18, 2007 by mikeytown2 Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
Celeri Posted July 18, 2007 Share Posted July 18, 2007 wow, never would have thought AutoIt would change that much.... anyway i fixed the example and core files.Download New Files From Second PostIncase anyone is looking for the old BinaryString() function i found this post...http://www.autoitscript.com/forum/index.ph...mp;#entry367545Wow, good job!I once wrapped my head around a base64 converter ... honestly that took a lot of effort to stay focused. Now I think I'm ready for the fifth dimension Be seeing you I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!) Link to comment Share on other sites More sharing options...
keed Posted August 10, 2007 Share Posted August 10, 2007 Hi, I wanted to use mikeytown2's _base64.au3 (from the latest "second post") but I found some preblems. Look, I am not a programmer and I appologise for some stupid things I may have said in this post. It was said that this .au3 supports binary files. Yes, but _Base64Encode() supports only input not containing null "charrachters" (#00). The problem is that this function (_Base64Encode()) uses '$as_Input = StringSplit($s_Input, "")' and when strigsplit() encounters a #00 it ends sudenly, resulting in a partial array. I tryed to encode a rar file, but because it included "null" bytes it ended prematuraly. Therefore , for my purposes I changed _base64.au3 so it could read directly from a file , byte by byte, in the array $as_Input. Then everything went OK. I mean - found this problem, but if it is is discussed before or if what I say is a total scrap - please, don't mind it. Link to comment Share on other sites More sharing options...
mikeytown2 Posted August 27, 2007 Author Share Posted August 27, 2007 Minor Update to Code_Base64: Code Cleanup, I left in 2 ConsoleWrite functions and #include <Array.au3>. They are now removed. Updated documentation inside the file as well.Grab files from second post.keed what was your solution for reading binary files? This is what i came up with, just wondering if you had something different.$file = "binaryfile.dat"_Base64Encode (BinaryToString(FileRead(FileOpen($file, 16), FileGetSize($file))))If you look in the example file that goes along with _base64.au3, it has the same solution as above. Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
keed Posted August 29, 2007 Share Posted August 29, 2007 My solution was not a "solution" at all. I just wanted to see whether the function encodes correctly arbitrary binary files. (It does it of course.) I changed the _Base64Encode itself by adding this code: ;Break the input up into bytes ;startofmycode Local $filesize = FileGetSize($filename) Local $filearray[$filesize] $filearray[0] = $filesize -1 $fhand = FileOpen($filename, 0) for $i = 1 to $filesize - 1 $filearray[$i] = FileRead($fhand, 1) Next Fileclose($fhand) ;endofmycode ;Local $as_Input = StringSplit($s_Input, "") &^(*&^(*&(*&(*UYO*&Y) Local $as_Input = $filearray And I added a parameter for the function called $filename. As you see - it is very clumsy and it is only for testing purposes. Your solution is very fine. Link to comment Share on other sites More sharing options...
Armand Posted December 15, 2007 Share Posted December 15, 2007 GREAT UDF - WORKS LIKE A CHARM, THANKS!! [why am i yelling ?!] [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
Eddy Posted December 26, 2007 Share Posted December 26, 2007 I've seen many base64 decoder here and almost all of them are either too slow, too big, or decode incorrectly so I decided to write my own. Take a look for yourself and hopefully it'll help save you some time on base64 decoder. Any feedback is welcome. Happy programming... Func Base64Decode($s) Local $key = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', _ $t = '', $p = -8, $a = 0, $c, $d, $len = StringLen($s) For $i = 1 to $len $c = StringInStr($key, StringMid($s,$i,1), 1) - 1 If $c < 0 Then ContinueLoop $a = BitOR(BitShift($a, -6), BitAND($c, 63)) $p = $p + 6 If $p >= 0 Then $d = BitAND(BitShift($a, $p), 255) If $c <> 64 Then $t = $t & Chr($d) $a = BitAND($a, 63) $p = $p - 8 EndIf Next Return $t EndFunc Link to comment Share on other sites More sharing options...
mikeytown2 Posted December 30, 2007 Author Share Posted December 30, 2007 I've seen many base64 decoder here and almost all of them are either too slow, too big, or decode incorrectly so I decided to write my own. Take a look for yourself and hopefully it'll help save you some time on base64 decoder. Any feedback is welcome. Happy programming... Func Base64Decode($s) Local $key = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', _ $t = '', $p = -8, $a = 0, $c, $d, $len = StringLen($s) For $i = 1 to $len $c = StringInStr($key, StringMid($s,$i,1), 1) - 1 If $c < 0 Then ContinueLoop $a = BitOR(BitShift($a, -6), BitAND($c, 63)) $p = $p + 6 If $p >= 0 Then $d = BitAND(BitShift($a, $p), 255) If $c <> 64 Then $t = $t & Chr($d) $a = BitAND($a, 63) $p = $p - 8 EndIf Next Return $t EndFuncThis is a fairly simple decoder (i like), its slow though. It runs the for loop for every character. To decode a 155kb base64 file this took 12.763 seconds. With the decoder that me and blindwig made, it takes 0.767 seconds. For our encoder/decoder, code size wasn't an issue; all we cared about was speed. This might be useful for someone who is trying to keep their code base very small. Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
Uten Posted February 7, 2008 Share Posted February 7, 2008 (edited) I think the line marked ;BUG?: is wrong (_INetSmtpMail.au3). My suggestion is in the code.;Close Message and Connection ;BUG?: For $i_Count = 0 To (UBound($as_Body) - 1) Step + 1 For $i_Count = 0 To (UBound($as_End) - 1) Step + 1 _SmtpSend($v_Socket, $as_End[$i_Count], $f_trace) $s_Receive = _GetLastReplyMsg($v_Socket, $as_EndReplyCode[$i_Count], $f_trace) If @error Then SetError(60 + $i_Count) Return False EndIf NextI have noticed that the loop ain't the same as in the _INetSmtpMail with login support Thanks for the nice work..EDIT: You dont need my dbg lines.. Edited February 7, 2008 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
mikeytown2 Posted February 8, 2008 Author Share Posted February 8, 2008 Uten, Thanks for your help! I know my SMTP code is quite messy. If you could take the first step and post a new version of the SMTP code, i would greatly appreciate it. As you suggested in your PM, there is code in the example file that should be in the UDF file. The ultimate goal would be for both files to be included as part of the official UDF's. I believe the base64 code is ready, the SMTP is not. I haven't played with the SMTP code for years. Thanks for your Time! Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
Tipulatoid Posted October 29, 2008 Share Posted October 29, 2008 (edited) I am sorry for simple question. I have such file (grabbed e-mail attachment) 2_Slavinka4_per_7.zip.txt I need to get binary zip-file. Tried different variants with no success. Can you give example code? Thanks2_Slavinka4_per_7.zip.txt Edited October 29, 2008 by Tipulatoid Link to comment Share on other sites More sharing options...
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