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

Crash on Deobfuscator.php:185 #113

Open
Bot12313 opened this issue Oct 22, 2024 · 1 comment
Open

Crash on Deobfuscator.php:185 #113

Bot12313 opened this issue Oct 22, 2024 · 1 comment

Comments

@Bot12313
Copy link

I encounter crashes and warnings when analyzing a large code base. I can't provide the source code file where the problem occurs - I can't identify it, the crash occurs during analysis, but I was able to get the error log.

PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Warning:  mb_convert_encoding(): Unable to detect character encoding in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Console/CLI.php on line 507
PHP Warning:  preg_match_all(): Unknown modifier ''' in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 202
PHP Fatal error:  Uncaught TypeError: round(): Argument #1 ($num) must be of type int|float, string given in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php:185
Stack trace:
#0 /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php(185): round()
#1 [internal function]: AMWScan\Deobfuscator->AMWScan\{closure}()
#2 /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php(184): preg_replace_callback()
#3 /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php(49): AMWScan\Deobfuscator->deobfuscateBitrix()
#4 /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Scanner.php(921): AMWScan\Deobfuscator->deobfuscate()
#5 /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Scanner.php(1230): AMWScan\Scanner->scanFile()
#6 /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Scanner.php(387): AMWScan\Scanner->scan()
#7 /home/kurisu/projects/amws/index.php(11): AMWScan\Scanner->run()
#8 {main}
  thrown in /home/kurisu/projects/amws/vendor/marcocesarato/amwscan/src/Deobfuscator.php on line 185

Running with

<?php
include("vendor/autoload.php");

use AMWScan\Scanner;

$app = new Scanner();
Scanner::setPathScan("<project path>");
Scanner::enableReport();
Scanner::setPathReport("/home/kurisu/report.html");
Scanner::setSilentMode(true);
$app->run();

PHP Version

PHP 8.2.20 (cli) (built: Jun  8 2024 21:32:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.20, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.20, Copyright (c), by Zend Technologies

composer.json

{
    "require": {
        "marcocesarato/amwscan": "^0.14.0"
    }
}
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
@Bot12313 and others