Lana has asked for the wisdom of the Perl Monks concerning the following question:

Hi ;)

I've searched through many-many perlcc discussions here at PM but still can't find an answer to my question. Is there a way for reverse engeneering the bytecode generated by using perlcc like this:

perlcc -B test.cgi -o test2.cgi

I know this is possible in theory.. but how to do this practically?

Lana

Replies are listed 'Best First'.
Re: Is there a way to decode perlcc bytecode?
by chromatic (Archbishop) on Jul 07, 2007 at 05:26 UTC

    In theory, you could unserialize the bytecode into the optree (which one of the modules, maybe B::ByteLoader can do), then capture execution (perhaps with O or another module with a cleverly-placed INIT block) and start feeding code references to B::Deparse.

    At least, that's the easiest way I can imagine.

    A reply falls below the community's threshold of quality. You may see it by logging in.