Req #74513 [NEW]: Working with wrappers
| From: | acuna dot personal at gmail dot com | Date: | Fri, 28 Apr 2017 20:08:34 +0000 |
| Subject: | Req #74513 [NEW]: Working with wrappers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-208854@lists.php.net to get a copy of this message | ||
From: acuna dot personal at gmail dot com
Operating system: Windows 10.1 x64
PHP version: 7.1.4
Package: opcache
Bug Type: Feature/Change Request
Bug description:Working with wrappers
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 bug report at https://bugs.php.net/bug.php?id=74513&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74513&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74513&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74513&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74513&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74513&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74513&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74513&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74513&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74513&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74513&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74513&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74513&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74513&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74513&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74513&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74513&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74513&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74513&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74513&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74513&r=mysqlcfg