On 21/05/2014 21:12, Nicolai Scheer wrote:
Do you have an example of a tool that can reverse opcodes to php code?
Maybe I did not search for the right thing, I did not stumble upon any.
I always thought the opcodes where kind of cryptic, at least a bit...
I don't know of any tools for "decompiling" PHP from opcodes, but that's probably because very few tools generate or distribute opcodes from anything other than PHP source, so there has been little desire for such a thing.
I have, however, seen the result of a Java decompiler, which can perform a similar job on JVM bytecode; the results are less obfuscated than a lot of "minified" JS scripts deployed to save bandwidth. I imagine the Zend Engine's opcodes are even more closely bound to PHP than the JVM's instructions are to Java, so I can well imagine an effective decompiler being possible if the motivation were there.
On a different note, I read somewhere that once HHVM has loaded each of your PHP files once, it no longer needs a copy on the file system, and can be told to never check for one. Thus you can deploy PHP code to a server, "prime" the HHVM memory, and then delete the source files. I don't know if there's any way to persist that memory state and distribute it to another HHVM instance, though.
--
Rowan Collins
[IMSoP]