Jump to content
Sign in to follow this  
ahmeddzcom

Convert Files to hex

Recommended Posts

ahmeddzcom

Hello

This Code Convert Names to hex :

$sStr = "Dz"
$sHex = __StringToHex($sStr)
MsgBox(0, "", $sHex)
$sConvert = __HexToString($sHex)
MsgBox(0, "", $sConvert)

Func __StringToHex($sString)
    Return Hex(StringToBinary($sString))
EndFunc

Func __HexToString($sString)
    If StringLeft($sString, 2) <> "0x" Then $sString = "0x" & $sString
    Return BinaryToString($sString)
EndFunc

But i Need Convert Files to hex

Tnx.

Share this post


Link to post
Share on other sites
ahmeddzcom

Make $sStr the contents of the file, then write in back to the file.

EDIT:

you will need just 2 functions... FileRead and FileWrite

Hi

example plz if you can.

Edited by ahmeddzcom

Share this post


Link to post
Share on other sites
ahmeddzcom

can anyone give us example

Tnx.

Share this post


Link to post
Share on other sites
JohnOne
$sometext = FileRead("somepathtofile")
;Process text
FileWrite("somepathtofile", $sometext")

Sorry but I'm not writing such a simple script for someone who has been around for 3 years.

If you cannot do this by now, you might as well train as a PE teacher.

  • Like 1

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
ahmeddzcom
$sometext = FileRead("somepathtofile")
;Process text
FileWrite("somepathtofile", $sometext")

Sorry but I'm not writing such a simple script for someone who has been around for 3 years.

If you cannot do this by now, you might as well train as a PE teacher.

Tnx John 

$sStr = FileRead("C:\Users\i7\Desktop\y.txt")
$sHex = __StringToHex($sStr)
MsgBox(0, "", $sHex)

Func __StringToHex($sString)
    Return Hex(StringToBinary($sString))
EndFunc

 

Edited by ahmeddzcom

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  

×