Search the Community
Showing results for tags 'overwrite'.
-
This is a naive question, but here goes. If a variable contains sensitive information, like a password, is there any value to overwriting its contents before exiting the script? In other words, in the example below, would someone poking around in memory after the script finishes still be able to find the original value of variable $sPass? (Putting aside, for present purposes, the obvious fact that the script itself contains the sensitive information.) Is there a better way to cover one's tracks, as it were? Thanks in advance. Local $sPass = "My password is 'very+very_strong'" ; Do something here, then overwrite $sPass: If Not _OverwriteVar("sPass") Then MsgBox(0, "", "Variable overwrite failed!") Else MsgBox(0, "", "'sPass' now overwritten with " & $sPass) EndIf Exit Func _OverwriteVar($sVarName, $sOverStrChar = "#") If IsDeclared($sVarName) <> 0 Then If Not IsString(Eval($sVarName)) Then Assign($sVarName, String(Eval($sVarName))) Assign($sVarName, StringRegExpReplace(Eval($sVarName), ".", $sOverStrChar)) Return 1 Else Return 0 EndIf EndFunc ;==>_OverwriteVar
-
Is there a reliable way to ensure that data assigned to variables in a script is overwritten or deleted when the script exits? I have scripts that encrypt/decrypt data and would like to ensure, if possible, that the encryption keys and decrypted data do not stay in memory after the script exits. Thanks.
-
$RootDir = "C:\x86\" $BinariesFolder = "C:\Binaries\x86\0717-15.Binary.r9642_Release_win32_Fresh" $DestinationFolder = $RootDir & "_AppFiles-Telos" $SourceFolder=$BinariesFolder FileCopy($SourceFolder & "\*.*", $DestinationFolder & "\", $FC_OVERWRITE + $FC_CREATEPATH) In the above code, even if I keep $FC_OVERWRITE, the existing files are not getting replaced. Any suggestion please.
-
Right now i have several batch file backups running of just raw user data. basically running: xcopy {current location} {target locatiion} /d /c /e /h /r /q /y i see that autoIT has a DirCopy command, but im wondering if it has an option like xcopy to skip that file and continue on if it has a problem (/c) the batch files work nicely, but im trying to get rid of old files from the backup location. Ran into this problem several times ex: "i deleted that file. its not supposed to exist for legal reasons". kind of not what im looking for. So basically im wondering if we can get some kind of loop going to copy over every file while ignoring errors and overwrite without prompting, then go through and delete files that are not age appropriate. i understand comparing to _NowCalcDate, but the problem is with entering subfolders and scanning them as well. not looking for the script to be written for me as there are other things (error reports and the like) but just somewhere to start