tessl install tessl/pypi-yara-python@3.11.0Python interface for YARA, a powerful malware identification and classification tool
Agent Success
Agent success rate when using this tile
85%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.94x
Baseline
Agent success rate without this tile
90%
A system that scans large binary files for specific patterns using pre-compiled pattern matching rules. The scanner must handle files efficiently without unnecessary memory copies.
The scanner should process large binary files using memory-efficient techniques that avoid duplicating data in memory.
The scanner should work with buffer objects representing binary data, allowing efficient processing of pre-loaded data.
@generates
def scan_file(rules, filepath: str) -> list:
"""
Scans a file using the provided compiled rules.
Args:
rules: Compiled pattern matching rules
filepath: Path to the file to scan
Returns:
A list of match results
"""
pass
def scan_buffer(rules, buffer) -> list:
"""
Scans a buffer containing binary data using the provided compiled rules.
Should efficiently handle memoryview objects without copying data.
Args:
rules: Compiled pattern matching rules
buffer: A buffer-like object (bytes, bytearray, memoryview) containing data to scan
Returns:
A list of match results
"""
passProvides pattern matching and scanning capabilities.