#!/usr/bin/ruby
# Author: Sh3llc0d3
# Program: Replace html special characters with there normal equivilant.
# Done to correct code fucked up by WAF's.
# Tested: Working with the limited testing i've done on a few c++/c programs.
file_names = Array.new
file_names.push(ARGV[0]);
html_spec = {
"<" => "<",
">" => ">",
"&" => "&",
"." => ".",
"[" => "[",
"]" => "]",
":" => ":"
}
file_names.each do |file_name|
text = File.read(file_name)
puts text;
html_spec.each do |spec_chars,r_char|
output = text.gsub(/#{spec_chars}/, "#{r_char}")
puts output
File.open(file_name, "w") { |file| file.puts output};
text = output;
end
end