Crash

Define "auJasperatically" from AutoIt help file

13 posts in this topic

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



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

#3 ·  Posted (edited)

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

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

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".

1 person likes this

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Seems to be a bug that was introduced after 3.3.12.0.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

"auJasperatically" is a pretty cute bug though  :D

Share this post


Link to post
Share on other sites

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

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

 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

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.

1 person likes this

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

    • wakillon
      By wakillon
      SciTE Hopper : Jump to Any line by one click and many other helpfull functions !


      As Ashalshaikh suggested me after leaving me the task to continue >SciTE Hopper, i open a new Topic about it.
      It will be more easy for futures updates.

      Many helpfull functions in contextual menu.
      SciTE Hopper is now multipurpose.
      • Color Catcher added
      • BinaryToAu3Kompressor added
      • TinyAu3Search replaced by StringFinder
      • RegJumper added
      • Edit With SciTE added (available in Options)
      • SpecialCharactersViewer added (available in Tray menu)
      New Contextual Menu :

      For a right Click on a function :

      • Copy function name
      • Insert a function header
      • Cut function
      • Copy function
      • Delete function
      • Create a variables List
      • Remove usseless Blank lines
      • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay )
      • Set AutoIt Code Layout
      • Remove Comments

      For entire script :

      • Create a functions List
      • Create a variables List
      • Remove usseless Blank lines
      • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay )
      • Set AutoIt Code Layout
      • Remove Comments
      • ( Open in SciTE a ) Duplicate of current Script in Temp Dir
      • ( Open in SciTE a ) Duplicate of current Script in Same Dir
      • Explore Parent Script Folder
      • Copy Script name
      • Copy Script path
      • Find Unused Functions
      • Find Unused Variables
      • Set all functions in alphabetic order.( func headers and regions ( in fact, all lines between functions ) are not supported.)

      SciTE Editor New Contextual Menu if SciTE Hopper is added ( in Options ) to SciTE Editor :
      when you made a selection in SciTE Editor you can :

      • Open a Reg Key in Regedit using RegJumper
      • Open a Url in your default Browser
      • Search on google in your default Browser
      • Search on AutoIt Website in your default Browser
      Now Can be added to windows start (minimized)
      Options are available by Tray Menu.
      A double click on tray icon will open clipboard content to SciTE Editor ( Handy when you have copied some code from your browser )

      How to proceed for add SciTE Hopper to SciTE Editor :
      Run Scite Editor, run Scite Hopper ( compiled! ) go to Options and select Add/Remove to SciTE Tab. then click on Add button and it's done !
      Right click on SciTE Editor and choose SciTE Hopper in Contextual Menu for run it when you need it !
      Update of 07 Dec 2017
      TinyAu3Search is replaced by StringFinder

      Previous downloads : 1287
      Script and compiled version are available in the download section
       
      Thanks to Ashalshaikh, Melba23, Th3 MMA, Alzri2, taitel, Manadar, taz742, Yashield, Authenticity, Xenobiologist for their help
      and asdf8 for his >Includes Helper and azjio for his >FileSearch.

      Hope it help you and happy Scripting !

       
    • user4157124
      By user4157124
      As they're opinion-based to some degree; how are AutoIt's best practices decided and do suggestions get considered?
      Some suggestions :
      For...To...Step...Next -loop variable-naming like $iN ($i1, $i2, etc.) : conforms to recommended naming convention, identifies level (albeit inverted to ExitLoop and ContinueLoop's convention) and enables SciTE selection-highlighting (requires minimum of 3 characters). Minimize logic in global scope, separate data & settings from logic, use of vertical space, project organization (folder structure, resource- and include file management). Example (loop variable-naming, minimizing logic in global scope and separation of settings from logic) :
      #include <Array.au3> Global Enum $RANDOM_RETURNFLOAT, _ $RANDOM_RETURNINTEGER Global Enum $EXITCODE_NONE Global Const $g_sChar0 = '-' Global Const $g_sChar1 = '+' Global Const $g_iAmountX = 10 Global Const $g_iAmountY = $g_iAmountX Main() Func Main() Local $aArray[$g_iAmountY][$g_iAmountX] For $i1 = 0 To $g_iAmountY - 1 For $i2 = 0 To $g_iAmountX - 1 $aArray[$i1][$i2] = Random(0, 1, $RANDOM_RETURNINTEGER) ? $g_sChar1 : $g_sChar0 Next Next _ArrayDisplay($aArray) Exit $EXITCODE_NONE EndFunc Example (project organization) :
      + project_folder + bak [backup files] + bin [distributed binaries and dependencies] + inc [non-standard include files] + res [resource files (icons, file+install files, etc.)] + usr [configuration files, databases, etc.] - script.au3 - script.exe Example (use of vertical space) :
      Func _DigitalRoot($iNum) Local $sNum = '' Local $aNum While $iNum > 9 $sNum = String($iNum) $aNum = StringSplit($sNum, '') $iNum = 0 For $i1 = 1 To $aNum[0] $iNum += Int($aNum[$i1]) Next WEnd Return $iNum EndFunc
    • mati
      By mati
      Hi,
      I wonder if
      AutoIt3Wrapper_run_debug_mode = Y can include run information about functions which are called within the main code. So far I noticed in the console that the function itself is called but no specific run information from  inside the function is provided. Is there a chance to show the entire debug log including functions in the console?
      I furthermore noticed a stop of information when a loop is entered. What could be the reason for that?
       
      Thanks for help.
    • AppSoftwareVld
      By AppSoftwareVld
      Hello,
       
      I need this for a project and I don't find a method for the next problem.
      I want when I click a button to create a variable ("$variable1") so if I press one more time to create one more ("$variable2") and create more and more how many times you press the button.
       
      Do you have an idea ? 
      Thank you for your attention !
    • TrashBoat
      By TrashBoat
      Is this possible:
      Executing a function from an include, but taking the function name from a gui input and then executing that function using the include:
      #include <Something.au3> ;input reads "Tree" $functionName = GuiCtrlRead($input1) $functionName(1) And the include is gonna have
      Func Tree($x) If $x = 1 Then $this = "text" MsgBox(0,$this,"whatever") EndFunc is it possible?