1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C# Port: BinaryToString

Discussion in 'Source Code' started by Skyfail, Feb 28, 2015.

  1. Skyfail

    Skyfail Administrator Staff Member Administrator

    Joined:
    Mar 21, 2013
    Messages:
    854
    Likes Received:
    0
    Hi,

    ich arbeite gerade an einem kleinen AutoIT Deobfuscator und brauche dafür die Funktion "BinaryToString" aus AutoIT in C#. Ich habe diese nirgendwo im Internet gefunden, daher poste ich mal meine Version davon hier.

    Code:
            private string BinaryToString(string str)
            {
                str = str.Replace("0x", "");
    
                string newstr = "";
    
                for(int i = 0; i < str.Length; i += 2)
                {
                    int hexStr = int.Parse(str, System.Globalization.NumberStyles.HexNumber);
                    newstr += (char)hexStr;
                }
    
                return newstr;
            }​