Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/01/2020 in all areas

  1. Thanks for your replies! @jchd, I appreciate your rewrite of the function, which sent me back to the documentation of "ByRef", which I now understand better than before. I guess the accessibility of even compiled code to snoopers makes it advisable to just not put any sensitive information in there, period. @Nine, if I understand you correctly I think you're saying something similar. Don't put passwords and such into code, but solicit the info at runtime and hash it -- right? As for living in dictatorial territories, I'm not sure yet but will know better in November.
    2 points
  2. 2 points
  3. @Earthshine Seems that both Indochina and Vietnam are not present in the list of all the timezones supported by the website. Perhaps, since Vietnam is GMT+7, he could use a city that has a GMT+7 time too, or use the public IP to determine the time zone
    2 points
  4. tarretarretarre

    Autoit Serialize

    About Serialize Serialize a given value to get it's string representation, that you can later unSerialize back to its original value. Including nested arrays and objects. This is useful for storing and transferring data between applications. 2021-02-14 update: you can now serialize and unSerialize data in JavaScript as well. Checkout the official npm package or the github repo. This makes it possible to pass data between AutoIt and JavaScript applications. Eventually I will make an package for PHP aswell. Limitations Mutli dim arrays are not supported Examples Basic example #include "Serialize.au3" #include <Array.au3> ; Define some data Global $array = [1,2,3] ; Serialize Global $serialized = _Serialize($array) MsgBox(64, "Serialized data", $serialized) ; Unserialize Global $unSerialized = _UnSerialize($serialized) _ArrayDisplay($unSerialized) Objects and nesting #include "Serialize.au3" #include <Array.au3> ; Define some data Global $preArray = [1, 2, 3] Global $array = [5, 6, $preArray] Global $obj = ObjCreate("Scripting.Dictionary") $obj.add("firstName", "Tarre") $obj.add("age", 29) $obj.add("array", $array) $obj.add("active", True) ; Serialize Global $serialized = _Serialize($obj) MsgBox(64, "Serialized data", $serialized) ; Unserialize Global $unSerialized = _UnSerialize($serialized) MsgBox(64, "Unserialized data", "firstName = " & $unSerialized.item("firstName") & @LF & "age = " & $unSerialized.item("age") & @LF & "active = " & $unSerialized.item("active")) Global $array = $unSerialized.item("array") Global $preArray = $array[2] _ArrayDisplay($array, "$array") _ArrayDisplay($preArray, "$preArray") The code is also available on Github Autoit-Serialize-1.0.0.zip
    1 point
  5. Here the full example : #include <Constants.au3> #include <String.au3> Opt("MustDeclareVars", 1) Const $sZipFile = @ScriptDir & "\Test.zip" Const $sFolder = @ScriptDir & "\Temp" Const $sZipNew = @ScriptDir & "\Test2.zip" DirRemove ($sFolder, $DIR_REMOVE) UnZip($sZipFile, $sFolder) If @error Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error unzipping files : " & @error) FileDelete ($sZipNew) Zip ($sZipNew, $sFolder) If @error Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error zipping files : " & @error) Func UnZip($sZipFile, $sDestFolder) If Not FileExists($sZipFile) Then Return SetError (1) ; source file does not exists If Not FileExists($sDestFolder) Then If Not DirCreate($sDestFolder) Then Return SetError (2) ; unable to create destination Else If Not StringInStr(FileGetAttrib($sDestFolder), "D") Then Return SetError (3) ; destination not folder EndIf Local $oShell = ObjCreate("shell.application") Local $oZip = $oShell.NameSpace($sZipFile) Local $iZipFileCount = $oZip.items.Count If Not $iZipFileCount Then Return SetError (4) ; zip file empty For $oFile In $oZip.items $oShell.NameSpace($sDestFolder).copyhere($ofile) Next EndFunc ;==>UnZip Func Zip ($sZipFile, $sSourceFolder) If FileExists($sZipFile) Then Return SetError (1) ; destination file already exists If Not FileExists($sSourceFolder) Then Return SetError (2) ; source does not exist Local $hFile = FileOpen ($sZipFile, $FO_CREATEPATH+$FO_OVERWRITE+$FO_BINARY) Local Const $sString = Chr(80) & Chr(75) & Chr(5) & Chr(6) & _StringRepeat (Chr(0), 18) ; create ZIP file signature FileWrite ($hFile, $sString) FileClose($hFile) Local $oShell = ObjCreate("shell.application") If Not $oShell.NameSpace ($sSourceFolder).items.count Then Return SetError (3) ; folder empty Local $iFiles = 0 For $oFile In $oShell.NameSpace($sSourceFolder).items $oShell.NameSpace($sZipFile).copyhere($oFile) Do Sleep (100) ; let the file being copied to ZIP Until $oShell.NameSpace($sZipFile).items.count > $iFiles $iFiles = $oShell.NameSpace($sZipFile).items.count Next EndFunc
    1 point
  6. This, but it can be simpler to get the secret from the compiled .exe Local $sPass = "My password is 'very+very_strong'" ; Do something here, then overwrite $sPass: _OverwriteVar($sPass) MsgBox(0, "", "'sPass' now overwritten with " & $sPass) Func _OverwriteVar(ByRef $sVar, $sOverStrChar = "#") $sVar = StringRegExpReplace($sVar, "(?s).", $sOverStrChar) EndFunc ;==>_OverwriteVar
    1 point
  7. How about crypting them ? Are you living in a dictatorial territories ? I am always surprised that ppl think that they got such a great software that they need to protect against all over the world spies.
    1 point
  8. Jos

    Is AutoIt capable of that?

    This topic is locked as the OP has no intrest in getting support. Use PM when you want to do the coding for the OP for a hefty fee. Jos
    1 point
  9. I agree. However, I didn't run into that issue when running your script. So either we aren't running the same version or there is something Have you downloaded Scite like I recommended previously? If so, show use the results from the output panel. P.S. You need to stop begging for help and start showing some effort on your part. Continually reposting the same thing and expecting someone to fix your code gets old real fast.
    1 point
  10. KryziK

    KryMemory [UDF]

    A short collection of functions to manipulate and query process memory. This is based off of multiple other libraries I've written for other languages and was created because a friend using AutoIt requested it. It also has increased functionality and efficiency compared to NomadMemory. The handle array idea was also taken from NomadMemory and built onto. This small library took me a total of a few hours to write, test, and document. However, much testing is left to do. The error checking could also be extended a bit more to account for new users. If you have any suggestions or find any bugs, do not hesitate to reply here. Make sure you include the code that caused the error, your operating system information, and any other relevant information. Anyways, here it is: KryMemory Library Download Documented Functions: ; _Process_Open($sProcessName, $iDesiredAccess = $PROCESS_ALL_ACCESS, $fInheritAccess = False) ; _Process_Close($ahHandle) ; _Process_ReadMemory($ahHandle, $ivAddress, $sType = "dword") ; _Process_ReadMemoryPointer($ahHandle, $ivAddress, $aiOffsets, $sType = "dword") ; _Process_WriteMemory($ahHandle, $ivAddress, $vData, $sType = "dword") ; _Process_WriteMemoryPointer($ahHandle, $ivAddress, $aiOffsets, $vData, $sType = "dword") ; _Process_GetBaseAddress($ahHandle) ; _Process_GetParent($ahHandle) ; _Process_GetModules($ahHandle) ; ; _Address_CalculateStatic($ahHandle, $sModuleName, $ivOffset) ; _Address_CalculatePointer($ahHandle, $ivAddress, $aiOffsets) ; ; _Module_GetBaseAddress($ahHandle, $sModuleName) Example Usage: #include "KryMemory.au3" ; Opens a process, enabling the other functions to be used on it. Local $oProc = _Process_Open("KryziK.exe") ; Makes sure the process was opened. If @error Then ConsoleWriteError("The specified process could not be opened. Error: " & @error & @CRLF) Exit(0) EndIf ; Lists all of the modules in the process and their base address in a nice, pretty table. ConsoleWrite(StringFormat("%-25s%-25s", "Module Name", "Base Address") & @CRLF) ConsoleWrite("-------------------------------------" & @CRLF) For $sModule in _Process_GetModules($oProc) ConsoleWrite(StringFormat("%-25s 0x%08X", $sModule, _Module_GetBaseAddress($oProc, $sModule)) & @CRLF) Next ; Closes the handles created by _ProcessOpen. _Process_Close($oProc) Disclaimer: Don't use this for anything that would violate AutoIt Forum rules. Don't be stupid! Change Log: - _Process_GetParent added. 1/12/2013 - First release.
    1 point
×
×
  • Create New...