2024-04-08: ==================================================================================================== HObfusのzipファイルをダウンロードする際に、WindowsDefenderが、ウイルスの誤検出をして、ダウンロードをブロックする。 ---------------------------------------------------------------------------------------------------- 反応しているファイルは、examplesファルダ内にある、JavaScriptを含むPHPファイルである。(e.g. stopwatch.php) ---------------------------------------------------------------------------------------------------- 解決策の一つとして、との両方をPHPのechoに変える。 -------------------------------------------------------- "; ?> "; ?> -------------------------------------------------------- しかしこれは、目立ってしまってあまり美しくない。 別の解決策は、をecho化する方法である。 -------------------------------------------------------- "; ?> "; ?> -------------------------------------------------------- の間のJavaScriptを全部消しても、 エラーがでるので、JavaScriptのコードに問題ではない。 ==================================================================================================== ==================================================================================================== Solution: Echo-nize ---------------------------------------------------------------------------------------------------- builder/include/CHObfusBuilder.class.php ---------------------------------------------------------------------------------------------------- // instanciate `js-extra` $path_extra=self::$path_des_script."examples/extra.inc.php"; $extra=file_get_contents($path_extra); $extra=rtrim($extra); foreach(glob(self::$path_des_script."examples/*.php") as $path){ $code=file_get_contents($path); $code=CSrcEditor::replaceCodeBlock($code,"js-extra",$extra); $code=CSrcEditor::removeComments($code); >>> //[BEGIN] echo-nize >>> $code=str_replace("",'<'.'?php echo ""; ?'.'>',$code); >>> //[END] echo-nize file_put_contents($path,trim($code)); } ==================================================================================================== ==================================================================================================== Windows DefenderがBlockするために最小限の条件 ---------------------------------------------------------------------------------------------------- html,head,body,scriptタグが必要。 ---------------------------------------------------------------------------------------------------- Save the following HTML code as `test.html` or `test.php` and upload it to a web server and try to download it. You will be blocked by Windows Defender. ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- ====================================================================================================