Sinisterly
APC binnary cache file decoding - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: PHP (https://sinister.ly/Forum-PHP)
+--- Thread: APC binnary cache file decoding (/Thread-APC-binnary-cache-file-decoding)



APC binnary cache file decoding - pijulius - 05-08-2013

Hi Guys,

I'm playing around with APC and like the idea of being able to export out different files to a bin file which is said to be bytecode compilation of opcode which is great. Now because I know that it's easy to decompile zend, ioncube and so on I was thinking on using APC cache file for this purpose (I know that file locations have to be the same and there are other disadvantage of this but right now that's not important) and this is working just fine so far but I would like to ask for some experienced hackers about the coding of apc files.

I did play around with Vulcan Logic Dumper and the opcode it generates is just perfect so even if the APC cache file can be decoded to opcode I wouldn't mind as it would be hard to use that for development by third party, but if the APC file (as it also contains functions/classes table) may be decoded to real php code then we are at the same position as with any other compilers.

Could you please guys share your experience/knowledge on this? is my suspicion right on being able to decode apc files to real php or is it correct that they can only be decoded to opcodes?

Thanks in advance!
Julius

ps: can give you an example file if needed just don't want to post links in my first post Smile


APC binnary cache file decoding - pijulius - 05-08-2013

Hi Guys,

I'm playing around with APC and like the idea of being able to export out different files to a bin file which is said to be bytecode compilation of opcode which is great. Now because I know that it's easy to decompile zend, ioncube and so on I was thinking on using APC cache file for this purpose (I know that file locations have to be the same and there are other disadvantage of this but right now that's not important) and this is working just fine so far but I would like to ask for some experienced hackers about the coding of apc files.

I did play around with Vulcan Logic Dumper and the opcode it generates is just perfect so even if the APC cache file can be decoded to opcode I wouldn't mind as it would be hard to use that for development by third party, but if the APC file (as it also contains functions/classes table) may be decoded to real php code then we are at the same position as with any other compilers.

Could you please guys share your experience/knowledge on this? is my suspicion right on being able to decode apc files to real php or is it correct that they can only be decoded to opcodes?

Thanks in advance!
Julius

ps: can give you an example file if needed just don't want to post links in my first post Smile


RE: APC binnary cache file decoding - pijulius - 05-08-2013

Ok, after doing some more digging I found the answer myself. It is of course possible as the opcodes aren't really codes like asm and so you can simply revert them to real php calls functions and even classes. I did some tests with vld and that is able to easily get you the opcodes for apc cached files and so you can regenerate the real php code from opcode.

It seems the only real method of having protected php code is to convert them to c++ or write it like that right from the start Sad
Will check out phc and other projects that convert php code to c++ but please still share your thoughts if I missed something.


RE: APC binnary cache file decoding - pijulius - 05-08-2013

Ok, after doing some more digging I found the answer myself. It is of course possible as the opcodes aren't really codes like asm and so you can simply revert them to real php calls functions and even classes. I did some tests with vld and that is able to easily get you the opcodes for apc cached files and so you can regenerate the real php code from opcode.

It seems the only real method of having protected php code is to convert them to c++ or write it like that right from the start Sad
Will check out phc and other projects that convert php code to c++ but please still share your thoughts if I missed something.