3

How do I unbleach a Perl file that's been bleached with PAR::Packer::Bleach? The algorithm of bleaching is described in this Stack Overflow answer, however I am unable to make a working script for unbleaching/deobfuscation. Has anybody done this?

EDIT - FIXED: Used print and it worked. What was the problem that bothered me? It was bleached 2 times!!! A bleached file was bleached. So, a double unbleach worked!

Community
  • 1
  • 1
sraka1
  • 55
  • 4
  • 1
    What happens if you replace `$_=eval;$@&&die$@;$_` in the debleaching script with `print "The unbleached source code is: $_";` ? – mob Mar 13 '12 at 18:01
  • Tried print. What happens is it prints out the entire bleached file (spaces and tabs, none of the actual unbleached code). – sraka1 Mar 13 '12 at 21:07

1 Answers1

1

PAR::Packer::Bleach uses an algorithm similar to Acme::Bleach.

Here is a discussion of Acme::Bleach that may help you.

As one poster says: "basically Acme::Bleach converts the contents of the code into a bitstring of spaces and tabs on the first run, and then on subsequent runs uncompresses the bitstring and runs the code."

So yes, it should be completely reversible.

jwd
  • 10,837
  • 3
  • 43
  • 67
  • I know it is. This post illustrates very clearly what happens - http://stackoverflow.com/questions/7556782/what-does-this-perl-line-from-a-bleached-file-do. So, what needs to be done is convert the file into binary, then take 8 LSBs and add them together in another binary byte. And this byte is the ASCII char. I'm not so familiar with bit manipulation, that's why I'm having issues, however I'm working on a script in C for debleaching. – sraka1 Mar 13 '12 at 21:14