#!/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);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Deobfuscator: the struggle for light!
by bikeNomad (Priest) on Aug 22, 2001 at 23:18 UTC | |
Re: Deobfuscator: the struggle for light!
by Cirollo (Friar) on Aug 22, 2001 at 22:03 UTC |