• STATISTIQUES
  • Il y a eu un total de 0 membres et 17378 visiteurs sur le site dans les dernières 24h pour un total de 17 378 personnes!
    Membres: 2 435
    Discussions: 3 585
    Messages: 32 832
    Tutoriels: 78
    Téléchargements: 38
    Sites dans l'annuaire: 58


  • ANNUAIRE
  • [EN] Astalavista
    JavaScript: 1, Exploit: 2, Crypto: 34, CrackIt: 15, Stegano: 8, Programming: 12, Logic: 36, Special: 6, Science: 4, Info...
    Challenges
    [EN] Sabre Films
    Site de challenge présenté sous la forme d'une quête. Vous êtes un détective et devrez résoudre d...
    Challenges
    [EN] Hack This Site
    Hack This Site est considéré comme un réel terrain d'entraînement légal pour le...
    Hacking
    [EN] Gekko
    Site de challenge présenter sous la forme d'une quête. Vous êtes un agent secret qui répond sous le nom...
    Challenges
    [FR] Kalkulators
    Ce projet a plusieurs buts, le premier étant l’étude de toutes formes cryptographiques, le cot&ea...
    Cryptographie
    [EN] Framework Metasploit
    Le Framework Metasploit est un logiciel gratuit, open source de tests de pénétration développ&ea...
    Vulnérabilités
    [EN] Big-Daddy
    Big-Daddy est site internet communautaire avec un effectif diversifié, y compris des artistes, des programmeur...
    Hacking

  • DONATION
  • Si vous avez trouvé ce site internet utile, nous vous invitons à nous faire un don du montant de votre choix via Paypal. Ce don servira à financer notre hébergement.

    MERCI!




Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
[Au3] Hex/Dec/Bin converter
29-09-2011, 18h19
Message : #1
fr0g Hors ligne
NTEuNDI2MzcsLTEuNzc4NDg4
*****



Messages : 348
Sujets : 22
Points: 56
Inscription : Aug 2011
[Au3] Hex/Dec/Bin converter
Coders : Gr4ph0s, fr0g


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
+1 (0) -1 (0) Répondre
30-09-2011, 14h39
Message : #2
CyberSee Hors ligne
Admin fondateur de N-PN
*******



Messages : 1,721
Sujets : 287
Points: 158
Inscription : Jan 2012
[Au3] Hex/Dec/Bin converter
Trés intéréssant merci du partage :-)
+1 (0) -1 (0) Répondre
27-11-2011, 19h48
Message : #3
gr4ph0s Hors ligne
Membre
*



Messages : 32
Sujets : 5
Points: 11
Inscription : Aug 2011
[Au3] Hex/Dec/Bin converter
Nouvelle version rajout de méthode de cryptage Wink

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|STR -> DEC|   |HEX -> STR|HEX -> INT|HEX -> BIN|HEX -> DEC|    |BIN -> HEX|BIN -> STR|BIN -> DEC |   |DEC -> STR|DEC -> HEX|DEC -> BIN|    |INT -> HEX|INT -> BIN|")
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 == "STR -> DEC") Then
        $output_dec =""
        Local $lettre = StringSplit($initial_text,'')
        For $i = 1 To $lettre[0]
            $lettre_dec = Asc($lettre[$i])
            $output_dec &= " "& $lettre_dec
        Next
        GUICtrlSetData($Edit2, $output_dec)




    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 == "HEX -> DEC") Then
        $input_hex = _HexToString($initial_text)
        $input_hex = StringReplace($input_hex,"0x","")
        $input_hex = StringReplace($input_hex," ","")
        $input_hex = _HexToString($input_hex)
        $input_hex = StringReplace($input_hex,"0x","")
        $output_dec =""
        $lettre = StringSplit($input_hex,'')
        For $i = 1 To $lettre[0]
            $lettre_dec = Asc($lettre[$i])
            $output_dec &= " "& $lettre_dec
        Next
        GUICtrlSetData($Edit2, $output_dec)




        $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
    $initial_text = StringReplace($initial_text," ","")
    $initial_text_split = StringSplit($initial_text, "")
    $output_hex = ""
        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_hex &= " "&Chr($chr)
        Next
        $output_hex = StringReplace($output_hex," ","")
        $lettre = StringSplit($output_hex,'')
        $output_hex_final = ""
        For $i = 1 To $lettre[0]
            $lettre_hex = _StringToHex($lettre[$i])
            $output_hex_final &= " "& $lettre_hex
        Next
        GUICtrlSetData($Edit2, $output_hex_final)


    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)


    ElseIf ($method == "BIN -> DEC") Then
    $initial_text = StringReplace($initial_text," ","")
    $initial_text_split = StringSplit($initial_text, "")
    $output_dec = ""
        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_dec &= " "&Chr($chr)
        Next
        $output_dec_final =""
        $output_dec = StringReplace($output_dec," ","")
        $lettre = StringSplit($output_dec,'')
        For $i = 1 To $lettre[0]
            $lettre_dec = Asc($lettre[$i])
            $output_dec_final &= " "& $lettre_dec
        Next
        GUICtrlSetData($Edit2, $output_dec_final)







    ElseIf ($method == "DEC -> STR") Then
        $output_str =""
        $lettre = StringReplace($initial_text," ","")
        $lettre = StringSplit($lettre,'')
        For $i = 1 To $lettre[0] Step 2
            $lettre_str = Chr($lettre[$i]&$lettre[$i+1])
            $output_str &= " "& $lettre_str
        Next
        GUICtrlSetData($Edit2, $output_str)

    ElseIf ($method == "DEC -> HEX") Then
        $output_hex =""
        $lettre = StringReplace($initial_text," ","")
        $lettre = StringSplit($lettre,'')
        For $i = 1 To $lettre[0] Step 2
            $lettre_hex = Chr($lettre[$i]&$lettre[$i+1])
            $output_hex &= " "& $lettre_hex
        Next
        $output_hex = StringReplace($output_hex," ","")
        $lettre = StringSplit($output_hex,'')
        $output_hex_final = ""
        For $i = 1 To $lettre[0]
            $lettre_hex = _StringToHex($lettre[$i])
            $output_hex_final &= " "& $lettre_hex
        Next
        GUICtrlSetData($Edit2, $output_hex_final)



    ElseIf ($method == "DEC -> BIN") Then
        $output_bin =""
        $lettre = StringReplace($initial_text," ","")
        $lettre = StringSplit($lettre,'')
        For $i = 1 To $lettre[0] Step 2
            $lettre_bin = Chr($lettre[$i]&$lettre[$i+1])
            $output_bin &= " "& $lettre_bin
        Next
        $output_bin = stringreplace($output_bin," ","")
        $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)

    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 // Ptifou78(HWC te@m)"& @CRLF & "Website : http://hwc-crew.com" & @CRLF & "Th@nk's :"& @CRLF &"   - All HWC members")
EndSwitch
WEnd
"Institutions qui t'apprend dès l'départ que dans c'monde le verbe être ne peut se conjuguer sans avoir"
- Keny Arkana
+1 (0) -1 (0) Répondre


Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
N-PN
Accueil | Challenges | Tutoriels | Téléchargements | Forum | Retourner en haut