slightly_abnormal Posted May 11, 2006 Share Posted May 11, 2006 (edited) how to you convert regular text like this to hex?? is hex the 0011001010.. thats what i want to convert i tried html based and they get the % for some reason. %61%75%74%6F%69%74%20%72%6F%63%6B%73 Edited May 11, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
Simucal Posted May 11, 2006 Share Posted May 11, 2006 Uh.... Hex() ? AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
Paulie Posted May 11, 2006 Share Posted May 11, 2006 (edited) how to you convert regular text like this to hex?? is hex the 0011001010.. thats what i want to convert i tried html based and they get the % for some reason.%61%75%74%6F%69%74%20%72%6F%63%6B%73umm no thats binary (i think unless just a bad example of hex)dunno if theres a function to convert normal text to binaryit goes by ASCII character values then turns then into binarys by finding its base 2 equivelent Edited May 11, 2006 by Paulie Link to comment Share on other sites More sharing options...
Simucal Posted May 11, 2006 Share Posted May 11, 2006 If it is binary you want and not hex, use BinaryString() AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 11, 2006 Author Share Posted May 11, 2006 (edited) whered you get the BinaryString() function?? nvm.. i found it umm.. how do you do it?? $var = BinaryString("autoit rocks") msgbox(0, "Test Binary", $var) Edited May 11, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
Simucal Posted May 11, 2006 Share Posted May 11, 2006 You need beta AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 11, 2006 Author Share Posted May 11, 2006 (edited) i do, i couldn't figure out how to work.. $a= "autoit"& chr(0)&"rocks" $var = BinaryString($a) $str = String($var) msgbox(0, "Test Binary", $str) is this correct? i cant tell if it is since i dont read binary.. (or hex) Edited May 11, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 11, 2006 Moderators Share Posted May 11, 2006 (edited) Hmm, I don't understand Binary at all either, but this was the only thing that gave me a correct result:$var = String('autoit rocks' & Chr(0)) $g = BinaryString($var) If $var = String($g) Then MsgBox(0, 'Test1', 'equals') MsgBox(0, 'Test2', $var) MsgBox(0, 'Test3', $g) Edit: And if the above is right, this should work as well:$Test1 = _BinaryConvert('a') MsgBox(64, 'Conversion', $Test1) MsgBox(64, 'Conversion', _BinaryConvert($Test1)) Func _BinaryConvert($vs_Value) If Not IsBinaryString($vs_Value) Then Return String($vs_Value & Chr(0)) If IsBinaryString($vs_Value) Then Return BinaryString($vs_Value) SetError(1); $i_ConvertTo Not a 1 or 0 Return 0 EndFunc Edit2: I don't think mine is right though, I'm not getting the same values as the help file is getting Edited May 11, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 11, 2006 Author Share Posted May 11, 2006 cool.. thanks smoke #include <string.au3> $Hex = "4175746F697400526F636B73" $String = _HexToString($Hex) MsgBox(0, "Hex", "Original Hex: " & $Hex & @LF & " String: " & $String) $String = "Autoit Rocks" $Hex = _StringToHex($String) MsgBox(0, "Hex", "Original String:" & $String & @LF & " Hex: " & $Hex) MsgBox(64, 'Binary', _BinaryConvert("Original Hex: " & 'Autoit Rocks')) MsgBox(64, 'Binary', _BinaryConvert("Original String:" & 'Autoit Rocks', 0)) Func _BinaryConvert($vs_Value, $i_ConvertTo = 1) If $i_ConvertTo Then Return String($vs_Value & Chr(0)) If $i_ConvertTo = 0 Then Return BinaryString($vs_Value) SetError(1); $i_ConvertTo Not a 1 or 0 Return 0 EndFunc with this code below i get same kind of string with hex and binary, expcet binary has the 0x at the begin.. i assume this one is wrong.. #include <string.au3> $a= "Autoit Rocks"& chr(0) $var = BinaryString($a) $str = String($var) msgbox(0, "Binary","Binary: " & $str) $Hex = "4175746F697400526F636B73" $String = _HexToString($Hex) MsgBox(0, "Hex", "Original Hex: " & $Hex & @LF & " String: " & $String) $String = "Autoit Rocks" $Hex = _StringToHex($String) MsgBox(0, "Hex", "Original String:" & $String & @LF & " Hex: " & $Hex) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 11, 2006 Moderators Share Posted May 11, 2006 (edited) I still don't think mine is right :$Test1 = _BinaryConvert('Hello' & @CRLF & 'This is the ' & 1 & 'st test') MsgBox(64, 'Conversion', $Test1) MsgBox(64, 'Conversion', _BinaryConvert($Test1)) Func _BinaryConvert($vs_Value) ;#cs If IsInt($vs_Value) Then $vs_Value = BinaryString($vs_Value) Return String($vs_Value) EndIf ;#ce If Not IsBinaryString($vs_Value) Then $vs_Value = BinaryString($vs_Value) Return String($vs_Value & Chr(0)) EndIf If IsBinaryString($vs_Value) Then Return BinaryString($vs_Value) SetError(1); $i_ConvertTo Not a 1 or 0 Return 0 EndFuncWhen you put a Int in it fails because of the '& Chr(0)', So I played with IsInt() and it returns what it should to make it binary but does not convert a value. I was reading a help file says it Does Not Return '10' but still can't make heads or tails of it.Edit:Took $i_Convert out, used IsBinaryString() instead.Maybe someone else can shed some enlightenment to us .Edit2:Yeh, it does convet to hex the same except the 0x and 00 on the end lol:#include <string.au3> $Test1 = _BinaryConvert('Hello' & @CRLF & 'This is the ' & 1 & 'st test') $Test2 = '0x' & _StringToHex('Hello' & @CRLF & 'This is the ' & 1 & 'st test') ClipPut($Test1 & @CRLF & $Test2) MsgBox(0, 'Hex', $Test2) MsgBox(64, 'Conversion', $Test1) MsgBox(64, 'Conversion', _BinaryConvert($Test1)) If StringTrimRight($Test1, 2) = $Test2 Then MsgBox(64, 'Info', $Test1 & @CR & $Test2) Func _BinaryConvert($vs_Value) ;#cs If IsInt($vs_Value) Then $vs_Value = BinaryString($vs_Value) Return String($vs_Value) EndIf ;#ce If Not IsBinaryString($vs_Value) Then $vs_Value = BinaryString($vs_Value) Return String($vs_Value & Chr(0)) EndIf If IsBinaryString($vs_Value) Then Return BinaryString($vs_Value) SetError(1); $i_ConvertTo Not a 1 or 0 Return 0 EndFuncSo I can't imagine that is right what I did. Edited May 11, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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