Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/12/2012 in all areas

  1. Ward

    Binary UDF

    "Binary" is a built-in variable type in AutoIt. But functions that deal with binary variable are inadequate. Someone says string functions can also deal with binary variable, but actually, it may cause some problem. For example, using StringInStr to search "0x11" in "0x0110" will return a false result. This UDF solves the problem. It provide a lot of binary related functions. Furthermore, most functions in the UDF are optimized by machine code, so the speed is incredible. Here is the function list: _BinaryAnd($Binary1, $Binary2) _BinaryOR($Binary1, $Binary2) _BinaryXOR($Binary1, $Binary2) _BinaryNot($Binary) _BinaryShift($Binary, $Shift) _BinaryRotate($Binary, $Shift) _BinaryReverse($Binary) _BinaryInBin($Binary, $Search, $Occur = 1, $Start = 1) _BinaryReplace($Binary, $Search, $Replace, $Occur = 0) _BinarySplit($Binary, $Search) _BinaryRight($Binary, $Count) _BinaryLeft($Binary, $Count) _BinaryTrimLeft($Binary, $Count) _BinaryTrimRight($Binary, $Count)The usage of these functions are just like the built-in StringXXXX or BitXXXX functions. Attentions: BinarySplit has a little bit different, it don't support flag parameter in StringSplit. BinaryInBin and BinaryReplace also don't need casesense parameter. _BinaryPeek($Binary, $Start, $Type = "byte") _BinaryPoke($Binary, $Start, $Value, $Type = "byte") _BinaryToInt32($Binary) _BinaryFromInt32($Value) _BinaryToInt64($Binary) _BinaryFromInt64($Value) _BinaryRandom($Length, $Start = 0, $To = 255)These functions are some helper function. BinaryPeek and BinaryPoke work like stardand BASIC keyword peek and poke. They can handle types defined in DllStructCreate and DllCall (include str and wstr). The $Start are also like other AutoIt functions, count from 1, not from 0. BinaryRandom generate a random binary data for test or something. It has built-in Mersenne Twister PRNG. BinaryToXXX and BinaryFromXXX convert variable type between binary and int32/int64. _BitShift64($Value, $Shift) _BitRotate64($Value, $Shift) _BitNOT64($Value) _BitOR64($Value1, $Value2, [$Value3, ...]) _BitAND64($Value1, $Value2, [$Value3, ...]) _BitXOR64($Value1, $Value2, [$Value3, ...]) _Hex64($Value, $Length = 16) _Dec64($HexString)These functions are just the same as built-in functin in the same name, but these can handle 64 bit signed integer. (Built-in function only for 32 bit integer) Binary UDF.zip 2011/09/15 Update Note: Add following functions: _BinaryToInt16($Binary) _BinaryFromInt16($Value) _BinaryToDouble($Binary) _BinaryFromDouble($Value) _BinaryToMemory($Binary, $Ptr) _BinaryFromMemory($Ptr, $Size) _BinaryToDLLStruct($Binary) _BinaryFromDLLStruct(ByRef $DLLStruct) _BinaryFillDLLStruct($Binary, ByRef $DLLStruct)_BinaryRandom can specify the random seed now. $Seed = 0 mean no seed is specified. _BinaryRandom($Length, $Start = 0, $To = 255, $Seed = 0)Use static variable to store the binary code to avoid repeat memory allocation.Binary UDF.zip
    1 point
  2. Since there are WAY to many posts on how to SRE something I thought I would create a nice little tester. This thing does SRE and SRER. Loads files to test. Gets internet content to test. And more! Here it is: SRETesterV2.1.au3 Prev DL - 211 Enjoy!
    1 point
  3. BrewManNH

    Sending number keys?

    Have you tried Send("5")?
    1 point
  4. VeeDub

    FileDelete not working

    Well I worked this out. It turns out that if FileDelete is unable to delete a file then the operation stops, so using FileDelete with a wildcard *.* is not advisable. This behaviour was logged as a bug (a view that I agree with) but the dev's in their infinite wisdom disagreed ... hence we have this poorly documented feature. FWIW IMO if the FileDelete behaviour is not a bug, then the behaviour when an error is encountered ought to be documented in the Help. The current example in the Help is a load of bollocks. So for the record if you want to delete all files in a directory, and you want the FileDelete operation to continue even if a file is encountered that cannot be deleted (file in use, permissions issue etc.) then you need to use FileFindNextFile to select the files to be deleted and delete the files individually. If you're reading this post after searching the forum about FileDelete, I hope you haven't wasted too much time already. VW
    1 point
×
×
  • Create New...