Jump to content
Sign in to follow this  

Hex to Text

Recommended Posts


#include <GUIConstants.au3>
#include <string.au3>

$Form1 = GUICreate("Hex to Text ~~~ By Firestorm", 657, 722, 199, 111)
$Edit1 = GUICtrlCreateEdit("", 8, 24, 633, 305)
$Edit2 = GUICtrlCreateEdit("", 8, 392, 633, 305)
$Button1 = GUICtrlCreateButton("Text to Hex", 144, 344, 121, 33, 0)
$Button2 = GUICtrlCreateButton("Hex to Text", 360, 344, 129, 33, 0)
$Label1 = GUICtrlCreateLabel("Text:", 8, 8, 28, 17)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Label2 = GUICtrlCreateLabel("Hex:", 8, 376, 26, 17)
GUICtrlSetBkColor(-1, 0xFFFF00)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $Button1
            $info = GUICtrlRead($Edit1)
            $info_set = _StringToHex($info)
            If $info_set = "-1" Then
                GUICtrlSetData($Edit1, "ERROR IN TEXT STRING!!" & @CRLF & "Please revise the string...")
            GUICtrlSetData($Edit2, $info_set)
        Case $Button2
            $info = GUICtrlRead($Edit2)
            $info_set = _HexToString($info)
            If $info_set = "-1" Then
                GUICtrlSetData($Edit1, "ERROR IN HEX STRING!!" & @CRLF & "Please revise the string...")
            GUICtrlSetData($Edit1, $info_set)

I know this has probably been made before, but I felt like making my own. I know this will help me. I seem to work with hex more than I used to.

Edit: Added error checking.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

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