Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR of "eval()'d code(1) : eval()'d" from PHP CLI with argv() and getopt() #22

Open
alternat0r opened this issue Apr 26, 2021 · 1 comment

Comments

@alternat0r
Copy link

Error Description:
An error was found when executing an obfuscated PHP script for CLI usage. Especially when using argv() and getopt() function.

Cause:
Function argv() and getopt() seem does not work well with the Obfuscator.

Error output:

Notice: Undefined variable: argv in C:\script.php(166) : eval()'d code(1) : eval()'d code on line 29

Notice: Trying to access array offset on value of type null in C:\script.php(166) : eval()'d code(1) : eval()'d code on line 29
``
@wilbur-yu
Copy link

wilbur-yu commented Apr 29, 2021

I also encountered this problem, don't know if the package cannot be used in the framework
https://github.com/wilbur-yu/hyperf-source-encrypter

➜ composer start
> composer dump-autoload -o && php ./bin/hyperf.php start
Generating optimized autoload files
> rm -rf runtime/container
Generated optimized autoload files containing 3372 classes
[INFO] Worker#0 started.
[INFO] Worker#1 started.
[INFO] Worker#2 started.
[INFO] HTTP Server listening at 0.0.0.0:9501
[INFO] Worker#4 started.
[INFO] Worker#3 started.
[INFO] Worker#5 started.
[INFO] Worker#6 started.
[INFO] Worker#7 started.
[ERROR] Call to a member function input() on null[18] in /Users/wilbur.yu/MyCode/Oneself/composer-packages/hyperf-component/hyperf-skeleton/dist/app/Controller/IndexController.php(234) : eval()'d code(1) : eval()'d code
[ERROR] #0 /Users/wilbur.yu/MyCode/Oneself/composer-packages/hyperf-component/hyperf-skeleton/dist/vendor/hyperf/http-server/src/CoreMiddleware.php(161): App\Controller\IndexController->index()
#1 /Users/wilbur.yu/MyCode/Oneself/composer-packages/hyperf-component/hyperf-skeleton/dist/vendor/hyperf/http-server/src/CoreMiddleware.php(113): Hyperf\HttpServer\CoreMiddleware->handleFound(Object(Hyperf\HttpServer\Router\Dispatched), Object(Hyperf\HttpMessage\Server\Request))
#2 /Users/wilbur.yu/MyCode/Oneself/composer-packages/hyperf-component/hyperf-skeleton/dist/vendor/hyperf/dispatcher/src/AbstractRequestHandler.php(64): Hyperf\HttpServer\CoreMiddleware->process(Object(Hyperf\HttpMessage\Server\Request), Object(Hyperf\Dispatcher\HttpRequestHandler))
#3 /Users/wilbur.yu/MyCode/Oneself/composer-packages/hyperf-component/hyperf-skeleton/dist/vendor/hyperf/dispatcher/src/HttpRequestHandler.php(26): Hyperf\Dispatcher\AbstractRequestHandler->handleRequest(Object(Hyperf\HttpMessage\Server\Request))
#4 /Users/wilbur.yu/MyCode/Oneself/composer-packages/hyperf-component/hyperf-skeleton/dist/vendor/hyperf/dispatcher/src/HttpDispatcher.php(40): Hyperf\Dispatcher\HttpRequestHandler->handle(Object(Hyperf\HttpMessage\Server\Request))
#5 /Users/wilbur.yu/MyCode/Oneself/composer-packages/hyperf-component/hyperf-skeleton/dist/vendor/hyperf/http-server/src/Server.php(116): Hyperf\Dispatcher\HttpDispatcher->dispatch(Object(Hyperf\HttpMessage\Server\Request), Array, Object(Hyperf\HttpServer\CoreMiddleware))
#6 {main}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants