Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-23 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found