Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74423 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31540 invoked from network); 21 May 2014 23:08:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 May 2014 23:08:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.174 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.174 mail-wi0-f174.google.com Received: from [209.85.212.174] ([209.85.212.174:42809] helo=mail-wi0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/F3-00924-EE13D735 for ; Wed, 21 May 2014 19:08:31 -0400 Received: by mail-wi0-f174.google.com with SMTP id r20so8469382wiv.1 for ; Wed, 21 May 2014 16:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=5DR4yI7hHcf/7AULrx4OHTPivc14FmmlTk0vHW0FagE=; b=KRI7FJ2XjqGLeSSd7Dt+pebaond5rIiBDEK0HQdHGMoR0BU0b1ORZIK9UsVtl1htZm l/Go9ujlVJHzsZ5nV+iohR4h/nNtUDXTJnTi7MoIWcMsqisJ4YLDPfjqLn+E5ciWnryy XwHWK3O++1a9w5Me1z4oC48E0Yzkm8BjZuL0t/lK7Uo8IUK8j5pBlAegGmTSekpScf+m hydmK7xXglsFksUQrjjkvZB76jRpepdbtQTrMOXEyl5xO4Xs2A49NfrT2DCVUfmyY/uc ON1LykXScJ9QYA90p+EHfkJyqUS7E2VmwX0b82XpaTNnmlDqHbRWXPHOgZYfIQ1CN4co N3Pw== X-Received: by 10.180.211.207 with SMTP id ne15mr12932125wic.31.1400713708204; Wed, 21 May 2014 16:08:28 -0700 (PDT) Received: from [192.168.0.2] (cpc19-brig17-2-0-cust25.3-3.cable.virginm.net. [81.101.201.26]) by mx.google.com with ESMTPSA id 18sm22311048wju.15.2014.05.21.16.08.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 16:08:27 -0700 (PDT) Message-ID: <537D31E8.70401@gmail.com> Date: Thu, 22 May 2014 00:08:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: internals@lists.php.net References: <6048BA05-CC13-46DD-8439-9CB4EE29078B@ajf.me> <9EBA95A7-B9F7-41F0-AE2B-283260753E5A@googlemail.com> <537CBD67.4000008@lerdorf.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] encode php scripts with opcache compatibility From: rowan.collins@gmail.com (Rowan Collins) 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]