Req #74513 [Opn->Nab]: Working with wrappers
Edit report at https://bugs.php.net/bug.php?id=74513&edit=1
ID: 74513
Updated by: requinix@php.net
Reported by: acuna dot personal at gmail dot com
Summary: Working with wrappers
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: opcache
Operating System: Windows 10.1 x64
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
Try the internals mailing list.
http://php.net/mailing-lists.php
Previous Comments:
------------------------------------------------------------------------
[2017-04-28 20:08:29] acuna dot personal at gmail dot com
Description:
------------
Hello!
I'm writing the opensource and light-weight PHP compiler as the replace of monstrous HHVM and
other ancient PHP compilers which are all dead now. I'm using my own embedder to pack different
files to one executable, and mcrypt to encrypt the sources (unfortunately there's impossible
for me to use the OpenSSL because it's requires so much side libraries, but mcrypt requires
none, so now there's only php7.dll library file requres for ready executables (awesome)). And
there's no more, now I'm looking for the way to embed this library to executable too and
unpack it to its folder after execute the file)
So, now I'm thinking about how to embed the executable contents to the true bytecode, not an
encrypted sources, because it's simply an emulation and temporary solution to hide the sources,
and it requires decryption at every launch. I'm using the win32std library to address to the
embedded parts of the executable and I assume to make the butecode of main wrapper contents which
created by it and decompyle it with embedder while execute the file.
I' planning to use opcache for work with it, because it's recommended and working from the
box. There's an magic string in my embedder:
char *eval_string = "require 'res:///PHP/MAIN'";
which is starts the file as wrapper. I can't use the variables in that string, but I can
address it to another PHP file in which I can do everything, but the greatest way is decompyle this
wrapper on the fly like a file (because it's a file). So, can I ask you, is the opcache can do
this? Or is it impossible, I can use another technique - decompyle it in embedder and execute its
content by output buffering or eval (). So in conclusion - the task is to get the compiled content
of the wrapper and decompyle it before its executing.
BTW, bcompiler could do it all (If I get it right), but it's dead too. I tried to port it to
the PHP7 (who could think? :D) and have done it at ~60%, but acquainted to one guy who ported it at
5.6 and he says, that it's working only with "Hello World" and crashes if the scripts
are more difficult for it, so I got that because the new PHP's have many new constructions like
new array operators, closures etc, so now this problem will take so much time, so now it's
abandoned by me.
Hope you understand it all and thanks in advance!
Cheers,
A.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74513&edit=1
Thread (3 messages)