Skip to content

Commit

Permalink
feat: add header figlet generation with random font
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocesarato committed Jan 1, 2021
1 parent 743df6d commit bf0fc07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 5 additions & 9 deletions src/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,11 @@ public static function header()
return;
}

$header = <<<EOD
█████╗ ███╗ ███╗██╗ ██╗███████╗ ██████╗ █████╗ ███╗ ██╗
██╔══██╗████╗ ████║██║ ██║██╔════╝██╔════╝██╔══██╗████╗ ██║
███████║██╔████╔██║██║ █╗ ██║███████╗██║ ███████║██╔██╗ ██║
██╔══██║██║╚██╔╝██║██║███╗██║╚════██║██║ ██╔══██║██║╚██╗██║
██║ ██║██║ ╚═╝ ██║╚███╔███╔╝███████║╚██████╗██║ ██║██║ ╚████║
╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝
Github: https://github.com/marcocesarato/PHP-Antimalware-Scanner
EOD;
$figlet = new Figlet();
$figlet->loadRandomFont();
$header = $figlet->render(Scanner::getFullName());
$header .= "\n\nGithub: https://github.com/marcocesarato/PHP-Antimalware-Scanner";

$headerArray = explode("\n", $header);
foreach ($headerArray as $key => $value) {
$diff = strlen($value) - mb_strlen($value);
Expand Down
12 changes: 10 additions & 2 deletions src/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Scanner
*
* @var string
*/
public static $name = 'amwscan';
public static $name = 'AMWScan';

/**
* App description.
Expand Down Expand Up @@ -347,7 +347,7 @@ public function run($args = null)
private function arguments($args = null)
{
// Define Arguments
self::$argv = new Argv(self::$name, self::$description);
self::$argv = new Argv(self::getName(), self::$description);
self::$argv->addFlag('agile', ['alias' => '-a', 'default' => false, 'help' => 'Help to have less false positive on WordPress and others platforms enabling exploits mode and removing some common exploit pattern']);
self::$argv->addFlag('help', ['alias' => ['-h', '-?'], 'default' => false, 'help' => 'Check only functions and not the exploits']);
self::$argv->addFlag('log', ['alias' => '-l', 'default' => self::$pathLogs, 'has_value' => true, 'value_name' => 'path', 'help' => 'Write a log file on the specified file path']);
Expand Down Expand Up @@ -2239,6 +2239,14 @@ public static function getReportWhitelist()
* @return string
*/
public static function getName()
{
return strtolower(self::$name);
}

/**
* @return string
*/
public static function getFullName()
{
return self::$name;
}
Expand Down

0 comments on commit bf0fc07

Please sign in to comment.