百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Y

yara-python

> 编程语言
开源

用于 YARA 的 Python 接口

751 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

用于 YARA 的 Python 接口

.. image:: https://ci.appveyor.com/api/projects/status/gidnb9ulj3rje5s2?svg=true :target: https://ci.appveyor.com/project/plusvic/yara-python yara-Python

使用此库,您可以使用 YARA 您的 Python 程序。它涵盖了 YARA 的所有功能,从编译、保存 并将加载规则应用于扫描文件、字符串和进程。 这里有一个小例子: .. code-block:: Python

import yara rule = yara.compile(source='rule foo: bar {strings: $a = "lmn" condition: $a}') matches = rule.match(data='abcdefgjiklmnoprstuvwxyz') print(matches) print(matches[0].rule) foo print(matches[0].tags) print(matches[0].strings) print(matches[0].strings[0].identifier) $a print(matches[0].strings[0].instances) print(matches[0].strings[0].instances[0].offset) print(matches[0].strings[0].instances[0].matched_length) 安装


安装 YARA 的最简单方法是使用 "pip": .. code-block:: bash $ pip install yara-Python

但是,您也可以从 GitHub 获取源代码并自行编译:

要使此选项正常工作,您必须在安装 yara-Python 之前单独构建和安装 YARA _。

[foo] ['bar'] [$a] [lmn] 10 3

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言