Sign in to follow this  
Followers 0
Who

Convert String to Hex with options ?

4 posts in this topic

#include <string.au3>
$String = "I like AutoIt3"
$Hex = _StringToHex($String)
MsgBox(0, "Hex", "Original String: " & $String & @LF & " Hex: " & $Hex)

If I have this code, then the result will be "49206C696B65204175746F497433" which is the "AutoIt3" is converted to "4175746F497433". But If I don't want to get this result "4175746F497433", how can I change to another hex ? Thanks.

Share this post


Link to post
Share on other sites



If you don't want that result, don't run the script... :)

All seriousness aside, you didn't say what you DO want it to do.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

... $String = "I like AutoIt3" ... the result will be "49206C696B65204175746F497433" .... "AutoIt3" is ... "4175746F497433". But If I don't want to get this result "4175746F497433", how can I change to another hex ?

If you explain what your end goal is, that will help us know if you are heading in the right direction. If you're wanting to take a Hex value and covert it to a string value, then you'd use _HexToString(). This of course will not take an encrypted hex value and give you its unencrypted string. If you only want the "49206C696B65" to be your result then you can use StringTrimRight() or any of the other String...() functions to parse the information you what.

Unfortunately it's not clear what you mean by "how can I change to another hex?" Unless you want the script to replace "4175746F497433" with another hex value like "4D6963726F736F6674" so that your _HexToString() value would be "I like Microsoft". If that's what you're trying to do, then read up on StringLeft(), StringReplace(), and possibly _StringBetween(). To PsaltyDS' earlier point, what do you want?

Share this post


Link to post
Share on other sites

Ah oh, sorry for my post, I haven't think it first :). Then I will try to look at StringReplace()

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0