Code :
#include <string.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("StrHex - by fr0g & Gr4ph0s", 489, 170, 192, 124)
Global $Group1 = GUICtrlCreateGroup("Origin@l t3xt", 8, 16, 185, 129)
Global $Edit1 = GUICtrlCreateEdit("", 16, 32, 169, 105, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL,$WS_HSCROLL))
GUICtrlSetData(-1, StringFormat("Entrez ici votre texte..."))
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group2 = GUICtrlCreateGroup("C0nvert3d Text", 288, 16, 193, 129)
Global $Edit2 = GUICtrlCreateEdit("", 296, 32, 177, 105, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL,$WS_HSCROLL))
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Button1 = GUICtrlCreateButton("C0nvert", 200, 112, 81, 25, $WS_GROUP)
Global $Combo1 = GUICtrlCreateCombo("", 200, 56, 81, 25)
GUICtrlSetData(-1, "STR -> HEX|STR -> INT|STR -> BIN| |HEX -> STR|HEX -> INT|HEX -> BIN| |INT -> HEX|INT -> BIN| |BIN -> HEX|BIN -> STR|")
Global $Label1 = GUICtrlCreateLabel("http://hwc-crew.com", 190, 152, 131, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_CLOSE
exit 1
Case $Button1
$initial_text = GuiCtrlRead($Edit1)
$method = GuiCtrlRead($combo1)
if ($method == "STR -> HEX") Then
$output_hex = _StringToHex($initial_text)
GUICtrlSetData($Edit2, $output_hex)
ElseIf ($method == "STR -> INT") Then
$output_int = Int($initial_text)
GUICtrlSetData($Edit2, $output_int)
ElseIf ($method == "STR -> BIN") Then
$initial_text_split = StringSplit($initial_text, "")
$output_bin = ""
For $a = 1 to $initial_text_split[0]
$asc = Asc($initial_text_split[$a])
$mod = ""
For $b = 1 to 8
$mod = Mod($asc, 2) & $mod
$asc = Floor($asc/2)
Next
$output_bin &= $mod
Next
GUICtrlSetData($Edit2, $output_bin)
ElseIf ($method == "HEX -> STR") Then
$output_text = _HexToString($initial_text)
GUICtrlSetData($Edit2, $output_text)
ElseIf ($method == "HEX -> INT") Then
$output_int = _HexToString($initial_text)
$output_int = Int($output_int)
GUICtrlSetData($Edit2, $output_int)
ElseIf ($method == "HEX -> BIN") Then
$output_bin = _HexToString($initial_text)
$output_text_split = StringSplit($output_bin, "")
$output_bin = ""
For $a = 1 to $output_text_split[0]
$asc = Asc($output_text_split[$a])
$mod = ""
For $b = 1 to 8
$mod = Mod($asc, 2) & $mod
$asc = Floor($asc/2)
Next
$output_bin &= $mod
Next
GUICtrlSetData($Edit2, $output_bin)
ElseIf ($method == "INT -> HEX") Then
$output_int = String($initial_text)
$output_int = hex($output_int)
GUICtrlSetData($Edit2, $output_int)
ElseIf ($method == "INT -> BIN") Then
$initial_text_split = StringSplit($initial_text, "")
$output_bin = ""
For $a = 1 to $initial_text_split[0]
$asc = Asc($initial_text_split[$a])
$mod = ""
For $b = 1 to 8
$mod = Mod($asc, 2) & $mod
$asc = Floor($asc/2)
Next
$output_bin &= $mod
Next
GUICtrlSetData($Edit2, $output_bin)
ElseIf ($method == "BIN -> HEX") Then
$output_hex = Int($initial_text)
$output_hex = Binary($output_hex)
GUICtrlSetData($Edit2, $output_hex)
ElseIf ($method == "BIN -> STR") Then
$initial_text_split = StringSplit($initial_text, "")
$output_text = ""
For $a = 1 to $initial_text_split[0] Step 8
$temp = ""
For $b = 0 To 7
$temp &= $initial_text_split[$a+$b]
Next
$chr = 0
$temp = StringSplit($temp, "")
For $c = 1 to $temp[0]
$chr *= 2
$chr += Number($temp[$c])
Next
$output_text &= Chr($chr)
Next
GUICtrlSetData($Edit2, $output_text)
Else
MsgBox(64,"Err0r","Erreur : Méthode inconnue par le programme")
EndIf
Case $Label1
MsgBox(64,"Infos...","Developper :" & @CRLF & " - fr0g(HWC te@m)" & @CRLF & " - Gr4ph0s(HWC te@m)"& @CRLF & "Website : http://hwc-crew.com" & @CRLF & "Th@nk's :"& @CRLF &" - All HWC members")
EndSwitch
WEnd