Jump to content
Crash

Define "auJasperatically" from AutoIt help file

Recommended Posts

Crash

Hi AutoIt community!

I have a quick question. According to AutoIt help file on Variables,

If you declare a variable inside a function it is in local scope and can only be used within that same function. Variables created inside functions are auJasperatically destroyed when the function ends.

So what the meaning of "auJasperatically destroyed"? Is it completely destroyed or might be destroyed?

 

I am writing a security software and it is important to not let any password lingers in the memory. In a function, I have saved the password typed by user in a local var. I am not sure if I need to reset this variable before the function ends. (Or is there any better security practices?)

 

Thanks very much!


JPGRARMouse Lock | My website | Thanks so much for your help! ❤️

Share this post


Link to post
Share on other sites
BrewManNH

That's obviously a typo.

Local variables cease to exist as far as the script is concerned, not sure if the memory gets cleared out though. If you want to make sure it's cleared just set the variable to something nonsensical, or an empty string.

Word of advice though, if you're writing security software, don't do it in AutoIt, AutoIt is not guaranteed to be secure.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
iamtheky

yup, just the choice of aperiodic vs sporadic.  and through the magic of google I am going to guess you are seeing a forum scrambled version of an out of context use of this typo prefixed by an 'a' in a box.

Substitute 's' from String2 for 'o' in String1.
_operatically → asperatically

http://fuzzy-string.com/Compare/Transform.aspx?r=operatically&q=asthmatically&t=5

 

and contrary to the author's impressions, you will get neither opera nor asperations (nor will the link teach you anything about asthma).

 

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
jdelaney

Make sure you define all variables with Local...If there happens to be a global variable with the same name, and you don't specifically define the function's variable as local, it will overwrite the global:

Local $ThisWillBeOverWritten = "NOT from the function"
ConsoleWrite($ThisWillBeOverWritten & @CRLF)
WillNOTOverWriteGlobal()
ConsoleWrite($ThisWillBeOverWritten & @CRLF)
WillOverWriteGlobal()
ConsoleWrite($ThisWillBeOverWritten & @CRLF)

Func WillNOTOverWriteGlobal()
    Local $ThisWillBeOverWritten = "FROM the function...won't exist outside of function"
EndFunc

Func WillOverWriteGlobal()
    $ThisWillBeOverWritten = "FROM the function"
EndFunc

 

output:

NOT from the function
NOT from the function
FROM the function


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
trancexx

Hi AutoIt community!

I have a quick question. According to AutoIt help file on Variables,

So what the meaning of "auJasperatically destroyed"? Is it completely destroyed or might be destroyed?

 

It has no meaning. Someone was playing with that page and changed "Tom" to "Jasper" - not only within the example code shown there.

The word is "automatically".

  • Like 1

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Crash

That's obviously a typo.

Local variables cease to exist as far as the script is concerned, not sure if the memory gets cleared out though. If you want to make sure it's cleared just set the variable to something nonsensical, or an empty string.

Word of advice though, if you're writing security software, don't do it in AutoIt, AutoIt is not guaranteed to be secure.

Thanks. I understand a variable local to a function is scoped within it, and that means the variable is not accessible outside of the function. I am as unsure as you are whether if the memory gets cleared out. Although I might not be able to access it, the password may remain around as scrap data in some part of memory! D:

Thanks for the advice! I'm not training in programming and that is quite startling. Is it because AutoIt is too high-level? Too many stuff in between that may compromise security?

 

yup, just the choice of aperiodic vs sporadic.  and through the magic of google I am going to guess you are seeing a forum scrambled version of an out of context use of this typo prefixed by an 'a' in a box.

http://fuzzy-string.com/Compare/Transform.aspx?r=operatically&q=asthmatically&t=5

 

and contrary to the author's impressions, you will get neither opera nor asperations (nor will the link teach you anything about asthma).

 

Thanks for your reply. You lost me completely XD I'm as fuzzy as the theory suggests. haha.

 

Make sure you define all variables with Local...If there happens to be a global variable with the same name, and you don't specifically define the function's variable as local, it will overwrite the global:

Local $ThisWillBeOverWritten = "NOT from the function"
ConsoleWrite($ThisWillBeOverWritten & @CRLF)
WillNOTOverWriteGlobal()
ConsoleWrite($ThisWillBeOverWritten & @CRLF)
WillOverWriteGlobal()
ConsoleWrite($ThisWillBeOverWritten & @CRLF)

Func WillNOTOverWriteGlobal()
    Local $ThisWillBeOverWritten = "FROM the function...won't exist outside of function"
EndFunc

Func WillOverWriteGlobal()
    $ThisWillBeOverWritten = "FROM the function"
EndFunc

 

output:

NOT from the function
NOT from the function
FROM the function

Thank you for the reminder; I have forgotten about this. To others, you can declare a local variable with the same name as a global variable and they'll be treated differently. If you don't write 'Local' within your function, the compiler will think that you're referring to the global variable and overwrites its value instead.

 

It has no meaning. Someone was playing with that page and changed "Tom" to "Jasper" - not only within the example code shown there.

The word is "automatically".

Ah THANKS! I think this is the answer I'm satisfied with XD So atrocious, much evil!

Edited by Crash

JPGRARMouse Lock | My website | Thanks so much for your help! ❤️

Share this post


Link to post
Share on other sites
water

Seems to be a bug that was introduced after 3.3.12.0.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
mikell

"auJasperatically" is a pretty cute bug though  :D

Share this post


Link to post
Share on other sites
iamtheky

I was super pleased with my google supported fictitious explanation, I would have liked to see more piling on.  The easy explanation is...easy.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
jchd

Aside from the now fixed Supercalifragilisticexpialidocious typo, you're right that AutoIt makes no formal guarantee that the local values are effectively wiped out when going out of scope. Sure enough trancexx could vouch for what AutoIt did some time ago but that doesn't mean the behavior is carved in stone. This is merely an implementation detail subject to change at any time. I suspect it currently doesn't bother to zeroise variables memory going out of scope, but don't take my word on this.

Another distinct point is that we have no guarantee either that the old value of a variable is actually overriden after a re-assignment. I would even be surprised if it was, but again I don't have enough insight into current (and future) internal code to assert anything formally.

Obviously no program is safe against reverse engineering or being single-stepped under some advanced tool, so it's impossible to protect any internal secret. But you must be persuaded that a scripting language like AutoIt isn't the best choice to make the life of a determined attacker really hard.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
Crash

 Thanks everyone for the reply. I appreciate your time.

 

Aside from the now fixed Supercalifragilisticexpialidocious typo, you're right that AutoIt makes no formal guarantee that the local values are effectively wiped out when going out of scope. Sure enough trancexx could vouch for what AutoIt did some time ago but that doesn't mean the behavior is carved in stone. This is merely an implementation detail subject to change at any time. I suspect it currently doesn't bother to zeroise variables memory going out of scope, but don't take my word on this.

Another distinct point is that we have no guarantee either that the old value of a variable is actually overriden after a re-assignment. I would even be surprised if it was, but again I don't have enough insight into current (and future) internal code to assert anything formally.

Obviously no program is safe against reverse engineering or being single-stepped under some advanced tool, so it's impossible to protect any internal secret. But you must be persuaded that a scripting language like AutoIt isn't the best choice to make the life of a determined attacker really hard.

Thanks for the confirmation of doubt. I guess it's because AutoIt is closed-source that no one is able to confirm how it works under the hood, huh. I can now see why C is still such a popular language today although it is pretty much ancient relic. It's very low level and gives you a lot of control. (I denied learning C and had learnt AutoIt instead; secretly hoping C would die. Almost 10 years later, C is still around and strong.)


JPGRARMouse Lock | My website | Thanks so much for your help! ❤️

Share this post


Link to post
Share on other sites
jchd

Note that even with C you don't have direct control over how dynamically allocated variables and storage get destroyed. This is pretty low-level stuff and also depends on the development platform. Not saying it can't be done, just that this isn't as easy as is may sound. C++ destructors give you a much better control, for instance.

  • Like 1

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • ShakeelAhmad
      By ShakeelAhmad
      I've to upload different number of photos online in different assignments. There is a problem that all photos cannot be selected at once to upload. I have to choose and upload photos one by one. For this purpose I have made a script to automate whatever I have to do manually for choosing and uploading photos one by one.
      Please see my script below and check the last "MouseClick" command. This command clicks the button to choose and upload next photo. The problem I'm facing is; the last "MouseClick" works 1 step extra when all photos have been selected and uploaded. I mean if 7 photos are to be uploaded, this command opens the box from where next photo is selected and uploaded then it again opens the box and next photo is choosen and so on.... when last photo is selected and uploaded, this button once again opens the box. When all photos are uploaded, it should not click the button to select next photo. Please suggest how can I resolve this issue.
      #include <AutoItConstants.au3> Sleep(200) HotKeySet("{ESC}","Quit") ;Press ESC key to quit Send("{ALT DOWN}") Send("{TAB}") Send("{ALT UP}") Sleep(200) Local $photos = InputBox("Question", "How many photos to upload?", "#", "", _ - 1, -1, 0, 0) ; How many photos to upload Local $selector = 0 While $photos <> $selector MouseClick("Left", 281, 238, 1) ; mouse click on very first photo in the box. if $selector = 0 Then Send("{ENTER}") ; for selecting very first photo from "open" window. Sleep(800) Else sleep(200) Send("{RIGHT " & $selector & "}") ; for selecting 2nd to onward photos from "open" window. sleep(1000) Send("{ENTER}") sleep(1000) EndIf MouseClick("Left", 495, 198, 1) ; for clicking a button to choose next photo to upload $selector = $selector + 1 WEnd Beep(1500, 300) ; beep when all photos uploaded Exit Regards,
       
      Shakeel
    • Gringo
      By Gringo
      Hi,
      I'm trying to create a shortcut playing with variables but I can't figure out what's wrong
      I got 2 variables joined in one with for instance
      Local $path = FileOpenDialog($message, "C:" & "", "Select your executable (*.exe)", 1 + 4)
      Local $elev = 'c:\windows\System32\cmd.exe /c start "runhigh" /high '
      $target = $elev & $path
      FileCreateShortcut($target, @DesktopCommonDir & "\linked.lnk", StringLeft($target,StringInStr($target,"\",0,-1)) , "" , "" , "c:\i.ico")
      The problem is that a shortcut is created but instead of the target area I got the start in filled with my variable
      My second problem is that when I do a shell execute of the result of $target = $elev & $path, Note that if I do a batch with the variable written manually, it's working.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I was trying to insert function header to the functions of my script, but, in the SciTE console, this appears:
      Function or struct definition not found, unable to insert header. @Jos Any suggestion?
      Thanks in advance.

      Best Regards.
    • Amixg
      By Amixg
      Hi! I have another problem with AutoIT.  You see, I'm still the one who's just starting out with this great programming language. I have a problem with AutoIT, it seems not to recognize the "StringReplace" function even when it is by default. The code was made half in KODA and half of my own. It is a software programmed for the Italian language (I am Italian) and translate the SMS language into Italian correct. Would you help me? Thanks in advance.
       
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $hull = "hello" StringReplace($hull, "hello", "hellx") $Form1 = GUICreate("Linguaggio SMS A Italiano", 507, 498, 192, 124) $Edit1 = GUICtrlCreateEdit("", 24, 40, 465, 177) GUICtrlSetData(-1, "") $Label1 = GUICtrlCreateLabel("Inserisci qui il testo che non riesci a capire:", 24, 8, 205, 17) $Label2 = GUICtrlCreateLabel("Ecco il testo tradotto(non toccare questo campo):", 27, 237, 237, 17) $Edit2 = GUICtrlCreateEdit("", 24, 264, 465, 137) GUICtrlSetData(-1, "") $Button1 = GUICtrlCreateButton("Traduci", 104, 424, 249, 49) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 StringReplace(GUICtrlGetData($Label1), "qlc", "qualcuno") StringReplace(GUICtrlGetData($Label1), "qls", "qualcosa") StringReplace(GUICtrlGetData($Label1), "ke", "che") StringReplace(GUICtrlGetData($Label1), "x", "per") StringReplace(GUICtrlGetData($Label1), "pls", "per favore") StringReplace(GUICtrlGetData($Label1), "tu6", "tu sei") StringReplace(GUICtrlGetData($Label1), "zzz", "mi fai dormire") StringReplace(GUICtrlGetData($Label1), "hagn", "Buonanotte") StringReplace(GUICtrlGetData($Label1), "tvtb", "Ti voglio tanto bene") StringReplace(GUICtrlGetData($Label1), "tat", "Ti amo tanto") StringReplace(GUICtrlGetData($Label1), "lafs", "Amore a prima vista") StringReplace(GUICtrlGetData($Label1), "fli?", "Flirtiamo?") StringReplace(GUICtrlGetData($Label1), "msidt", "Mi sono innamorato di te") StringReplace(GUICtrlGetData($Label1), "ba", "Bacio") StringReplace(GUICtrlGetData($Label1), "midi", "Mi dispiace.") StringReplace(GUICtrlGetData($Label1), "ntm", "Non ti merito") StringReplace(GUICtrlGetData($Label1), "tdp", "Togliti dai piedi.") StringReplace(GUICtrlGetData($Label1), "amò", "Amore") StringReplace(GUICtrlGetData($Label1), "ap", "A presto!") StringReplace(GUICtrlGetData($Label1), "cmq", "comunque") StringReplace(GUICtrlGetData($Label1), "cvd", "Ci vediamo dopo") StringReplace(GUICtrlGetData($Label1), "Tvb", "Ti voglio bene") StringReplace(GUICtrlGetData($Label1), "nn", "non") StringReplace(GUICtrlGetData($Label1), "risp", "rispondimi") StringReplace(GUICtrlGetData($Label1), "cel", "cellulare") StringReplace(GUICtrlGetData($Label1), "dom", "qualcosa") StringReplace(GUICtrlGetData($Label1), "nm", "numero") StringReplace(GUICtrlGetData($Label1), "fv", "favore") StringReplace(GUICtrlGetData($Label1), "-male", "meno male") StringReplace(GUICtrlGetData($Label1), "disc", "discoteca") StringReplace(GUICtrlGetData($Label1), "se#", "settimana") StringReplace(GUICtrlGetData($Label1), "+ o -", "più o meno") StringReplace(GUICtrlGetData($Label1), "ts", "torno subito") StringReplace(GUICtrlGetData($Label1), "tvtbcoa", "Ti voglio tanto bene come amica") EndSwitch WEnd  
    • Karnalsyn
      By Karnalsyn
      As with a lot of programming, the less manual repetition done to achieve the same outcome...the better.
      I package programs for network deployment at the organization I work for. Sometimes these applications require verbose messaging to the user, and sometimes by special request we have to turn that off and deploy silently.
      The way I currently handle these 2 scenarios is this.
      I have a function that builds the splashwin display screen to variable size depending on message length, and displays the desired message to the end user.
      Then at each point throughout my script as I need to make the user aware of what is currently happening, I inject a splashwin function call with the unique message pertaining to that specific event. ie. "Installing Microsoft Office, please wait..."
      In effort to build a more universal script to handle any type of request submitted. I've incorporated a switch command of '/silent'
      If cmdlineraw detects the usage of that switch when the script is triggered it sets a variable flag, ie. $silent = "on"
      Then at every splashwin call I make, I'm prefixing it with an IF statement that checks for the flag, and then does NOT display the message if that flag is "on". Or does display it if its not. Has worked for me just fine. But while I grow my programming skills and look for more streamlined ways of handling areas I find myself creating repetition. I'm curious if I can relocate that flag check. Taking it out of every single splashwin call, and injecting it into the function itself.
      Example of how I currently display or hide the splashwin based on command line...
      If StringInStr($cmdlineraw, "/silent", 0) Then
          $SilentSwitch = "ON"
      EndIf
      If $SilentSwitch = "OFF" Then SplashWin($Uninstalling & $ProductInfo[1][0])
      Some scripts have dozens of those splashwin calls littered throughout, so Is this the best approach I can take already? Or as stated earlier, can I pull the IF statement away from the splashwin call. And left the function as a whole either activate or deactivate as a result of the command line check.
×