使用yarac.exe编译.yar文件
@echo offecho 删除上次提取的YARA规则文件del %CD%\AllYARAs.txtecho 把当前路径下所有yar文件内容提取到AllYARAs.txtfor /r %%i in (*.yar) do ( type %%i >> AllYARAs.txt)echo 用yarac将AllYARAs.txt编译成AllYARAs.Passcall %CD%\yarac.exe -w %CD%\AllYARAs.txt %CD%\AllYARAs.Pass::如果编译成功跳转,不成功则打印出错误码,删除规则文件后跳转到结束位置if %ERRORLEVEL% == 0 goto :CompiledSuccessfulecho 编译失败goto :EndOfscript:CompiledSuccessfulecho 编译成功::del %CD%\AllYARAs.txtecho 测试编译后的文件:call %CD%\yara.exe -C -w -f %CD%\AllYARAs.Pass .\Testgoto :EndOfscript:EndOfscriptpause>nul
成功
失败
