junkew Posted August 31, 2008 Share Posted August 31, 2008 Is there a quick way of finding a binarystream (in memory) in another one. * Doing a byte by byte comparison is real slow. * Isn't there an equivalent for StringInStr like BinaryInBin Something in Pseudocode like below (only much larger images) Image A has size @desktopwidth, @desktopheight represented in binarystream x Image B is smaller 10 * 10 represented in binarystream y for i = 1 to maxline of b ;BinaryInBin($x,$y) // How to do this???? next i Ofcourse something like below( pseudocode) could work but is slower than matching a full line at once function BinaryInBin($a,$ for $i=0 to BinaryLen($-1 match=true for $j = 0 to BinaryLen($a)-1 if binarymid($b,$i)<>binarymid($a,$j) then match=false exit endif next next endfunc FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
LimeSeed Posted September 1, 2008 Share Posted September 1, 2008 you could do this $binary = ;your binary code $string = string($binary) $g = stringinstr($string, $whatever u want) ;then convert it back to binary $rebinary = stringtobinary($string) global $warming = true Link to comment Share on other sites More sharing options...
junkew Posted September 2, 2008 Author Share Posted September 2, 2008 thx I actually thought that string would break on chr(0) obviously its not $Bin = binary("Elwin" & CHR(0) & "Wildschut") consolewrite( $bin) consolewrite(binarylen($bin) & @crlf) $str = binarytostring($bin) consolewrite($str ) consolewrite(stringlen($str) & @crlf) $iS=stringinstr($str, "Wildschut") consolewrite("Found at " & $is & @crlf) $bin = stringtobinary($str) consolewrite( $bin) consolewrite(binarylen($bin) & @crlf) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now