Jump to content

Convert Files to hex


ahmeddzcom
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

EDIT:

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

Edited by JohnOne

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

Monkey's are, like, natures humans.

Link to comment
Share on other sites

$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.

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

Monkey's are, like, natures humans.

Link to comment
Share on other sites

$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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...