Example #1
0
        private async Task UnobfuscateFileAsync(string file)
        {
            string text = string.Empty;

            using (StreamReader sr = new StreamReader(file))
            {
                text = await sr.ReadToEndAsync();
            }
            JSConfusion jSConfusion = new JSConfusion();

            text = jSConfusion.UnObfuscate(text);

            FileInfo fileInfo    = new FileInfo(file);
            string   newFilePath = Path.Combine(fileInfo.DirectoryName, $"{fileInfo.Name}_Result.{fileInfo.Extension}");
            int      i           = 1;

            while (File.Exists(newFilePath))
            {
                newFilePath = Path.Combine(fileInfo.DirectoryName, $"{fileInfo.Name}_Result({i++}).{fileInfo.Extension}");
            }
            using (StreamWriter sw = File.CreateText(newFilePath))
            {
                await sw.WriteAsync(text);
            }
        }
Example #2
0
        private void btnUnobfuscate_Click(object sender, EventArgs e)
        {
            if (textBoxSource.Text.Trim().Length == 0)
            {
                return;
            }
            JSConfusion jSConfusion = new JSConfusion();
            var         str         = jSConfusion.UnObfuscate(textBoxSource.Text.Trim());

            textBoxResult.Text = str;
        }