Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/26/2021 in all areas

  1. Jon

    Solved Test

    2
    6 points
  2. @TheXman Yes, you are 100% correct. I need to more specifically outline the acceptable requirements. Specifically stating that !@#$%^&* are acceptable symbols to use will help a lot. And making it perfectly clear to the user that consecutive characters in the password cannot contain any part of the email address before the @ sign in the password will indeed cut down on end user confusion as well. I will take what I have here and work with it to see if I can get it to do what I was working towards. I'll update the post later and let everyone know how it goes. Thanks again so very much, I am truly appreciative!
    2 points
  3. Hi @Sellonis, and a cool welcome to the AutoIt forum! This is one of many flavours (before a cat shows up): ConsoleWrite(ValidatePassword("Someone@something.it", "WhatPasswordIsTh1s@") & @CRLF) ConsoleWrite(ValidatePassword("Someone@something.it", "SomeoneNot@g00dPassword") & @CRLF) ConsoleWrite(ValidatePassword("Address@something.it", "ThisShoulB3aG00dPassword!") & @CRLF) ConsoleWrite(ValidatePassword("Address123@something.it", "ThisShoulB3aG00dPassword!too") & @CRLF) ConsoleWrite(ValidatePassword("AnotherAddress1234@something.it", "ThisPasswordIsT00Long1234567890!!!!!!!!!!!!!!!!!!!!") & @CRLF) Func ValidatePassword($strEmail, $strPassword) Return StringRegExp($strPassword, '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{6,40}$)', $STR_REGEXPMATCH) And _ Not StringRegExp($strPassword, '(?i)' & StringRegExp($strEmail, '([^@]+)@.*', $STR_REGEXPARRAYMATCH)[0], $STR_REGEXPMATCH) EndFunc
    2 points
  4. this checks if everything to the left of @ also appears in the password, or do you want to check even just a portion of the email address? If StringInStr($password, StringLeft($emailpassword, StringInStr($emailpassword, "@") - 1)) Then MsgBox(0, "Password invalid", "Password cannot contain a portion of the email address! Example - if the email address is bob@etex.net, the password cannot be Bob123!") Exit EndIf
    2 points
  5. Follow this decision tree: * Can you find the documentation or original source code? Yes: study it; No: continue * Is it a COM dll? Yes: use OLEview; No: continue * Is it a Windows dll? Yes: analysese the pdb (following some court cases, MS has to publish these now); No: continue * Analyse dll with Dependency Walker. Are the functions decorated? Yes: use PE explorer; No: continue * Are you an expert in Assembly and patching raw machine code? Yes: study the stack frames with IDA Pro or a similar debugger; No: continue * Can you find the dll documentation or original source if you try really, really hard? Yes: study it; No: forget about it.
    2 points
  6. So why not just have VBS call RoboCopy directly?
    1 point
  7. Have you tried using the xpath ends-with() function? Here's a nice xpath cheat sheet with examples: https://devhints.io/xpath
    1 point
  8. Assuming that the blacklist file has one password per line, the example below is one way to handle the validations. This also assumes that only the email account is entered, not including the domain. If it includes the domain, then you would need to parse out the email account. #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> #include <File.au3> #include <String.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Const $BLACKLIST_FILE = @ScriptDir & "\blacklist.txt" ;<== Modify as needed Global $gsBlacklist = "" Global $gnMsg = 0 #Region - Form Global $Form1 = GUICreate("Password Checker", 332, 126, 373, 136) Global $InfoTextBlock = GUICtrlCreateLabel("Enter the email and password to check below", 54, 8, 219, 17) GUICtrlCreateLabel("Address:", 35, 34, 54, 21) Global $EmailAddressBox = GUICtrlCreateInput("Address", 91, 32, 153, 21) GUICtrlCreateLabel("Password:", 35, 66, 54, 21) Global $PasswordBox = GUICtrlCreateInput("", 90, 63, 153, 21) Global $CheckButton = GUICtrlCreateButton("Check!", 50, 89, 113, 25, $BS_DEFPUSHBUTTON) Global $CancelButton = GUICtrlCreateButton("Cancel", 168, 89, 113, 25) #EndRegion ;If blacklist file does not exist, then exit with error message If Not FileExists($BLACKLIST_FILE) Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Blacklist file not found!") ;Read blacklist file into variable $gsBlacklist = FileRead($BLACKLIST_FILE) ;Show form and process form messages GUISetState(@SW_SHOW) While 1 $gnMsg = GUIGetMsg() Switch $gnMsg Case $GUI_EVENT_CLOSE Exit Case $CancelButton Exit Case $CheckButton ;If password not valid, then continue loop If Not IsPasswordValid(GUICtrlRead($PasswordBox), GUICtrlRead($EmailAddressBox)) Then ContinueLoop ;Do valid data processing below MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Password is valid", _ "The password passed all the complexity requirement checks. " & _ "The password has been copied into the clipboard to enter into the system.") ClipPut(GUICtrlRead($PasswordBox)) ExitLoop EndSwitch WEnd Func IsPasswordValid($sPassword, $sEmail) #cs Password validation rules: - Must contain at least 1 uppercase letter - Must contain at least 1 lowercase letter - Must contain at least one numeric digit or one of the following characters (!@#$%^&.-) - Cannot contain more than specified number of consecutive characters of the email account. - Length must be 6-40 characters Returns TRUE if password passes all validation checks, otherwise FALSE #ce Const $CONSECUTIVE_CHARS = 3 Local $sErrorMessage = "", $sEmailAcct = "" ;Uppercase/Lowercase/Numeric/Symbol/Length Validations If Not StringRegExp($sPassword, "[A-Z]") Then $sErrorMessage &= "- Password must have at least 1 uppercase letter." & @CRLF If Not StringRegExp($sPassword, "[a-z]") Then $sErrorMessage &= "- Password must have at least 1 lowercase letter." & @CRLF If Not StringRegExp($sPassword, "[0-9!@#$%^&.-]") Then $sErrorMessage &= "- Password must have at least 1 numeric digit or " & _ "!@#$%^&.- symbol." & @CRLF If StringLen($sPassword) < 6 Then $sErrorMessage &= "- Password cannot be less than 6 characters." & @CRLF If StringLen($sPassword) > 40 Then $sErrorMessage &= "- Password cannot be greater than 40 characters." & @CRLF ;Substring of email account validation (not case-sensitive/sliding window algorithm) $sEmailAcct = StringRegExp($sEmail, "^[^@]+", 1)[0] For $i = 1 To StringLen($sPassword) - $CONSECUTIVE_CHARS + 1 If StringInStr($sEmailAcct, StringMid($sPassword, $i, $CONSECUTIVE_CHARS)) Then $sErrorMessage &= "- Password cannot have " & $CONSECUTIVE_CHARS & " or more consecutive characters in email account." & @CRLF ExitLoop EndIf Next ;Blacklist validation (This assumes that there is one blacklisted password per line) If StringRegExp($gsBlacklist, "(?im)^\Q" & $sPassword & "\E$") Then $sErrorMessage &= "- Password cannot be a commonly used word/number combination." & @CRLF EndIf ;If any errors were found, then display an error message and return false to signal validation failed If $sErrorMessage <> "" Then MsgBox($MB_ICONERROR + $MB_TOPMOST, "VALIDATION ERROR", $sErrorMessage) Return False EndIf ;All is good Return True EndFunc
    1 point
  9. You asking this question is the biggest risk as you clearly don't yet know what you are getting into!
    1 point
  10. This specifically prohibits the resizing with the hands. There was a bug with a second column update. See earlier in this thread. @pixelsearch. Thank you for your excellent example. But the following happens: Version 2K and an example of align columns from Larsj are made without using WM_DRAWITEM. If leave a column selection through a combobox and remove options the right mouse click, can even use the standard context menu. But in your last versions 2m and 2p, WM_DRAWITEM returned again and it does (for us nonprofessional) join together all functionality. 🙄 Do you have the opportunity to combine these functions, and preferably based on the script without WM_DRAWITEM. Many thanks.
    1 point
  11. In my opinion, those 2 requirements are a bit too vague. I would explicitly state what those requirements are. Doing so makes it easier for you to validate in your script and for the user to understand. For instance, saying "symbol" could mean a lot of things. Saying the the symbol must be one of the following symbols (!@#$%^), makes it easier for a user to know exactly which symbols are allowed. As for the "password cannot contain a portion...", you need to define what a "portion" is. Does "portion" mean any 2 consecutive characters, 3 consecutive characters, or what? It needs to be explicit for you to be able to validate it and for your user to know what is acceptable.
    1 point
  12. Not quite. Using your logic, something as simple as 6 spaces will pass your checks as a valid password. You should not be including "any whitespace character" (\s) in your upper and lower case letter validations? Your symbolcheck may be a little lax also. Can you list your specific complexity requirements, like: Must contain at least 1 uppercase lietter Must contain at least 1 lowercase letter Must contain at least 1 symbol (!,@,#,$,%) etc That makes it much easier for others to confirm whether you validations are working the way you think they should.
    1 point
  13. The idea with Robocopy worked. At first it took a while to find the right switches for my purposes. But what really took a long time was to find a way to pass the call from VBScript to AutoIt (/AutoIt3ExecuteLine). The difficulty was the double quotes around paths and that VBScript uses the same escape character as AutoIt: doubling the double quotes. But now it's done and it works. Thank you! @Earthshine, @Musashi
    1 point
  14. Absolute time doesn't exist and every piece of software chooses it's starting point, e.g. Windows, Unix, Excel, you-name-it. And as shown, local time poison gets in the way. Even zulu time isn't perfect: not well defined before 1960 and even then the question remains: how to deal with leap seconds? I agree that things aren't simple for the unsuspecting casual user and as always the devil is in the details. Granted, a short note or warning could be beneficial in the help but that's as true for almost any language/system where the details are implied or just untold. To make things even more subtle, time and time differences (durations) aren't what most people think they are: time can only be well defined inside a referential in space-time. Due to relativistic effects, your time isn't mine when one of us changes position in space. Two very precise synchronized cesium fountain atomic clocks get out of sync if one is raised only 50cm and reset at it's former position! The latest atomic clocks are very precise: a research institute in Spain has built a clock whose max drift is 0.263 second in 16.8 billion years. GPS wouldn't work if relativity wasn't taken into account: max precision would then be around 15km, making the whole system essentially useless! So yes, time is "simple" for most of us in everyday's life (as teached in kindergardens), but once you start looking closer under the hood, horrible complexity shows its face.
    1 point
  15. astalol, The post of mine to which i linked you gives a completely self-contained example - no SQL involved at all. Here is the script extracted from the thread: #include <GUIConstantsEx.au3> #include <Array.au3> #Include <GuiListBox.au3> Global $hGUI, $hInput, $hList, $sPartialData, $asKeyWords[100] ; Create list full of random 5 character "words" Keywords() $hGUI = GUICreate("Example", 200, 400) $hInput = GUICtrlCreateInput("", 5, 5, 190, 20) $hList = GUICtrlCreateList("", 5, 30, 190, 325, BitOR(0x00100000, 0x00200000)) $hButton = GUICtrlCreateButton("Read", 60, 360, 80, 30) $hUP = GUICtrlCreateDummy() $hDOWN = GUICtrlCreateDummy() $hENTER = GUICtrlCreateDummy() GUISetState(@SW_SHOW, $hGUI) ; Set accelerators for Cursor up/down and Enter Dim $AccelKeys[3][2]=[["{UP}", $hUP], ["{DOWN}", $hDOWN], ["{ENTER}", $hENTER]] GUISetAccelerators($AccelKeys) $sCurr_Input = "" $iCurrIndex = -1 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hList $sChosen = GUICtrlRead($hList) If $sChosen <> "" Then GUICtrlSetData($hInput, $sChosen) Case $hButton If $sPartialData <> "" Then $sFinal = GUICtrlRead($hInput) If _ArraySearch($asKeyWords, $sFinal) > 0 Then MsgBox(0, "Chosen", $sFinal) EndIf EndIf Case $hUP If $sPartialData <> "" Then $iCurrIndex -= 1 If $iCurrIndex < 0 Then $iCurrIndex = 0 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hDOWN If $sPartialData <> "" Then $iTotal = _GUICtrlListBox_GetCount($hList) $iCurrIndex += 1 If $iCurrIndex > $iTotal - 1 Then $iCurrIndex = $iTotal - 1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hENTER If $iCurrIndex <> -1 Then $sText = _GUICtrlListBox_GetText($hList, $iCurrIndex) GUICtrlSetData($hInput, $sText) $iCurrIndex = -1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf EndSwitch ; If input has changed, refill list with matching items If GUICtrlRead($hInput) <> $sCurr_Input Then CheckInputText() $sCurr_Input = GUICtrlRead($hInput) EndIf WEnd Func CheckInputText() $sPartialData = "|" ; Start with delimiter so new data always replaces old Local $sInput = GUICtrlRead($hInput) If $sInput <> "" Then For $i = 0 To 99 If StringInStr($asKeyWords[$i], $sInput) <> 0 Then $sPartialData &= $asKeyWords[$i] & "|" Next GUICtrlSetData($hList, $sPartialData) EndIf EndFunc ;==>CheckInputText Func Keywords() Local $sData For $i = 0 To 99 $asKeyWords[$i] = Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1)) $sData &= $asKeyWords[$i] & "|" Next GUICtrlSetData($hList, $sData) $iCurrIndex = -1 _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndFunc ;==>Keywords M23
    1 point
  16. You may want to check out the Webdriver UDF.
    1 point
  17. mLipok

    Acro.au3 UDF

    Yes
    1 point
  18. Welcome to the forum! As a note to both new and current members and as mentioned above, please read the FAQs on the AutoIt Wiki before posting. This will save you time, as the answers to many common questions are out there. Most importantly for new forum members, please see the section on Why isn't my thread getting any replies? Forum members are here, volunteering their time to help you with your questions, and we will always do our best to assist. Below are just a few of the items we need from you in order to provide the best help, please see the FAQ section for more: First, foremost and always, know and follow the forum rules: Every member of this forum is expected to know and adhere to the forum rules. The rules are based on common sense and should not be daunting for anyone to follow. Doing so will ensure you receive assistance and will prevent any necessary sanctions by the Moderation team. We would much rather help you with your scripts than have to attend to the unpleasant business of suspending or banning accounts. Add a meaningful title to your thread: "HELP!!" tells no one anything, and will often delay your receiving assistance. Include a detailed description of what you are trying to do, what you have tried on your own, and what problem/error you are experiencing: "Doesn't work" or "AutoIt's broke" doesn't cut it. Forum members are also here to help you write and improve your own scripts; this is not a forum where you put in an order and someone writes the code for you. Always Post Code: Even if the code is not doing what you want it to, posting the code you are working from rather than asking forum members to guess is always going to result in more rapid assistance. If you cannot post the code for business reasons, create a script that reproduces the issue you are seeing.
    1 point
  19. AdamUL, Then you should have made that clear in your first post, rather than waiting until I made the point for you. Remember that many newer members take any replies to their question at face value. Have a good weekend. M23
    1 point
×
×
  • Create New...