please look at comments for description. maybe this is not the right place where to post, but it would be indelicate to post it in obfuscation section, and, 'cos it works and it's "warning proof" and "strict proof" i decided to post here.
i would be glad to receive help from guys interested in developing such a tool, and so,
thanks in advance.
Sigmund
#!/usr/bin/perl -w # This is the first attempt to write something useful to break all tho +se # wonderful pieces-of-art that obfuscated code represents. How do they + work? # How can i read them more easily? Is this Reverse Engineering? I just # started learning Perl and Obfuscation, and i wanted something to hel +p when # learning from others' scripts. ASCII-art-formatted scripts are reall +y hard # to read. this crumb of code helps a little, and I look for help to i +mprove # it. For instance, it should detect and properly format regular expre +ssions # which do not use regular "/" and hopefully better format loops! # And finally, how may the "enlightenment" come from "obfuscation" ? # Follow the light, and leave the Dark Side! ;-) # # (by the way, there's always something fascinating in darkness... # i like obfu!!! ;-P ) use strict; use vars '$output','$line'; $output = $ARGV[0].".deobfu"; open (INF, "< $ARGV[0]"); open (OUF, "> $output"); while (<INF>) { $line .= $_; $line =~ s/\#(^\!).*\n//g; } $line =~ s/ +/ /g; $line =~ s/\t+/\t/g; $line =~ s/\n//g; $line =~ s/use /\nuse /g; $line =~ s/(qq)([\W])(\w*)([\W])/\"$3\"/g; $line =~ s/(q)([\W])(\w*)([\W])/\'$3\'/g; $line =~ s/\;/\;\n/g; $line =~ s/([\{||\}])/\n$1\n/g; print OUF $line; close (INF); close (OUF);

In reply to Deobfuscator: the struggle for light! by Sigmund

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.