erifash Posted June 14, 2005 Share Posted June 14, 2005 Here are some UDF's that I made or use a lot, that mostly relate to the internet. Proper authors are credited. If you take the time to browse through these, you will notice that these are some very useful functions. In fact, I think I should post some programs/examples I have made using these! Secure-password type program that uses md5 #include <web.au3> Local $md5_file = _ScriptRoot() & "md5.key" If not FileExists($md5_file) Then md5create() Local $md5 = _Unscramble(_ReadFile($md5_file)), $pass = "" Do $pass = InputBox("MD5 Key", "Please provide your password below.", "", "") If @ERROR Then Exit Until $pass <> "" If $md5 <> _md5(_Scramble(_md5($pass))) Then MsgBox(48 + 4096 + 262144, "MD5 Key", "Invalid Password!", 10) Exit EndIf MsgBox(0, "MD5 Key", "Correct Password.", 10) Func md5create() Local $new_pass = "" Do $new_pass = InputBox("MD5 Key", "Please type in your new password.", "", "") If @ERROR Then Exit Until $new_pass <> "" $new_pass = _Scramble(_md5(_Scramble(_md5($new_pass)))) FileWrite(_ScriptRoot() & "md5.key", $new_pass) MsgBox(0, "MD5 Key", "Your password has been set.", 10) Exit EndFunc A program that downloads what you tell it to expandcollapse popupIf not _INetActive() Then Exit #include <GUIConstants.au3> #include <web.au3> $w = ( @DesktopWidth / 2 ) $h = 30 $gui = GUICreate("Download File", $w, $h, -1, -1) $url = GUICtrlCreateInput("http://", 0, 10, $w - 85, 20) $go = GUICtrlCreatebutton("D o w n l o a d", $w - 85, 10, 85, 20, $BS_DEFPUSHBUTTON) $progress = GUICtrlCreateProgress(0, 0, $w, 10) GUISetState() GUICtrlSetState($url, $GUI_FOCUS) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $go dload() EndSelect Sleep(10) Wend Func dload() $sz_url = GUICtrlRead($url) $sz_ifile = StringSplit($sz_url, "/") $file = FileSaveDialog("Save As...", @ScriptDir, "All Files (*.*)", 16, $sz_ifile[$sz_ifile[0]]) If @error Then Return GUICtrlDelete($go) $abort = GUICtrlCreatebutton("A B O R T", $w - 85, 10, 85, 20, $BS_DEFPUSHBUTTON) $size = InetGetSize($sz_url) INetGet($sz_url, $file, 1, 1) Do If GUIGetMsg() = $abort Then INetGet("abort") If FileExists($file) Then FileDelete($file) GUICtrlSetData($progress, 0) GUICtrlDelete($abort) $go = GUICtrlCreatebutton("D o w n l o a d", $w - 85, 10, 85, 20, $BS_DEFPUSHBUTTON) MsgBox(4096 + 262144, "Download Abort", "The download has been aborted.") Return EndIf $p = ( @InetGetBytesRead / $size ) * 100 GUICtrlSetData($progress, $p) Until $p = 100 MsgBox(4096 + 262144, "Download Complete", $sz_url & " has been saved to: " & @CRLF & @CRLF & $file) GUICtrlDelete($abort) $go = GUICtrlCreatebutton("D o w n l o a d", $w - 85, 10, 85, 20, $BS_DEFPUSHBUTTON) EndFunc McAfee AVERT Stinger Downloader #include <web.au3> If not _INetActive() Then Exit If not FileExists("version.log") Then FileWrite("version.log", " ") $html = _Download("http://vil.nai.com/vil/stinger/") $i_version = _Parse($html, ".exe</a> v", " [") $a_version = _ReadFile("version.log") $exe = _Parse($html, '<li><a href="http://download.nai.com/products/mcafee-avert/', '">Download') If $a_version = $i_version Then Exit INetGet("http://download.nai.com/products/mcafee-avert/" & $exe, @ScriptDir & "\" & $exe) FileDelete("version.log") FileWrite("version.log", $i_version) MsgBox(0, "Stinger Downloader", "McAfee AVERT Stinger v" & $i_version & " has been downloaded to:" & @CRLF & @CRLF & @ScriptDir & "\" & $exe) How many web pages is Google searching again? #include <web.au3> $url = "http://www.google.com" MsgBox(0, "_Parse() - " & $url, _Parse(_Download($url), "Google - Searching ", " web pages")) Well, i hope you enjoy! And, as always, questions/comments are greatly appreciated! My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
w0uter Posted June 14, 2005 Share Posted June 14, 2005 _Parse() is kinda useless now we have regexp. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
erifash Posted June 14, 2005 Author Share Posted June 14, 2005 (edited) _Parse() is kinda useless now we have regexp.<{POST_SNAPBACK}>Yea, but i still use it anyway. What do you think of my _md5() function? I combined AutoIt with PHP because i couldn't think of how to possibly write an md5 algorithm in AutoIt, and I knew that PHP had an md5() function so i just used<?php echo md5($_GET['txt']); ?>to get the post vars and convert them into md5. Or how about _RetCmd() and _RealDateTime()? I had fun with those lol Edited June 14, 2005 by erifash My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
erifash Posted June 14, 2005 Author Share Posted June 14, 2005 (edited) I have been wondering, can you give me an example of using RegExp to parse information out of a string? I don't exactly understand how to do that. Edited June 14, 2005 by erifash My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
gammasts Posted June 14, 2005 Share Posted June 14, 2005 What do you think of my _md5() function? I combined AutoIt with PHP because i couldn't think of how to possibly write an md5 algorithm in AutoIt, and I knew that PHP had an md5() function so i just used<?php echo md5($_GET['txt']); ?>to get the post vars and convert them into md5. Or how about _RetCmd() and _RealDateTime()? I had fun with those lol <{POST_SNAPBACK}>I have a version of Sha-1 hashing in a dll. I will add md5 next to it, so that would be another way to get it. I wouldn't try writing an md5 algorithm in AutoIt, heh.http://www.autoitscript.com/forum/index.php?showtopic=12455That is for the Sha-1 dll. Link to comment Share on other sites More sharing options...
w0uter Posted June 14, 2005 Share Posted June 14, 2005 (edited) Yea, but i still use it anyway. What do you think of my _md5() function? I combined AutoIt with PHP because i couldn't think of how to possibly write an md5 algorithm in AutoIt, and I knew that PHP had an md5() function so i just used<?php echo md5($_GET['txt']); ?>to get the post vars and convert them into md5. Or how about _RetCmd() and _RealDateTime()? I had fun with those lol <{POST_SNAPBACK}>i remember someone using a build in windows dll to md5 things (could be wrong though)._RetCmd() has ALMOST (since not evyrthing supports STD)been made obsolete by the STD func'sdidnt check _RealDateTime. need to go make homework.I have been wondering, can you give me an example of using RegExp to parse information out of a string? I don't exactly understand how to do that.<{POST_SNAPBACK}>check the INet functions from my sig like google/images. Edited June 14, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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