Commit Graph
271 Commits
Author SHA1 Message Date
Wesley ShieldsandVictor M. Alvarez eb92e6b5aa Implement "none" keyword (#1559)
Co-authored-by: Victor M. Alvarez <[email protected]>
2021-09-02 20:57:39 +02:00
Wesley Shields 24a5ad1383 Implement the OP_OF_FOUND_IN opcode. (#1554)
This is a combination of "OP_OF" and "OP_FOUND_IN" that allows you to express logic like "all of them in (0..100)". This came out of the discussion in #1483 and likely makes part of that pull request redundant.
2021-08-31 19:34:16 +02:00
Wesley Shields 87bc03d587 Add a math.abs() (#1545)
As mentioned in #1454, this makes checking the distance between two matches
regardless of the order of matches easier.
2021-08-23 12:17:45 +02:00
xbabka01 b8650dfa05 Add imports_details and delayed_imports_details (#1523) 2021-08-20 09:42:57 +02:00
xbabka01andVictor M. Alvarez 21f4c6ec06 Added pe.version_info_list with the list of all version info records (#1509)
Co-authored-by: Victor M. Alvarez <[email protected]>
2021-08-11 09:49:47 +02:00
Marek Milkovič 66c1c7176b Added iequals operator for case-insensitive string comparison (#1536) 2021-08-11 09:40:54 +02:00
xbabka01 5f34c1e466 Fix typo from pe.SECTION_FARDATA to SECTION_MEM_FARDATA (#1533) 2021-08-09 14:25:15 +02:00
xbabka01 0c8d91f705 Added missing PE constants (#1520) 2021-08-09 12:10:32 +02:00
Steven 60b1b4d4e6 Add warnings_callbacks to Python Rules class summary (#1517)
Spelling corrections
Consistent indents in documentation
2021-08-09 11:50:26 +02:00
KashiwabaYuki 38ed07aaf2 Fix table syntax of writingrules.rsf (#1488)
I fixed syntax of table in writingrules.rst
・“YARA keywords” table has syntax error, and it table couldn't see on the document page.
・I changed that some '*' positions.
2021-07-09 23:51:47 +02:00
KashiwabaYuki 3c93ee1951 Fixed reference URL for Base64. (#1497)
The reference page for Base64 can't use to jump.
Because that URL already changed.
I fixed this URL to "https://www.leeholmes.com/searching-for-content-in-base-64-strings/".
2021-07-09 23:51:31 +02:00
KashiwabaYuki 946ad9b0f2 Add "EM_NONE" at ELF module MACHINE reference (#1513)
I know "EM_NONE" is difined in elf.h.
(https://github.com/VirusTotal/yara/blob/e1360f6cbe3d8daf350018661bc6772bd5b726f2/libyara/include/yara/elf.h)
However this doc has not "EM_NONE".
2021-07-09 23:46:32 +02:00
Victor M. Alvarez c937f4770a Remove incomplete sentence from documentation. 2021-07-05 10:58:28 +02:00
Victor M. Alvarez 0c84e37e24 Use double quotation marks. 2021-06-23 13:23:51 +02:00
Victor M. Alvarez 9e497d2d9a Improve documentation for regular expressions.
Closes #1516
2021-06-23 13:22:28 +02:00
Marek Milkovičandmalvidin 8643a577b5 Updated documentation of new callback data for CALLBACK_TOO_MANY_MATCHES (#1519)
Co-authored-by: malvidin <[email protected]>
2021-06-21 10:44:53 +02:00
Victor M. Alvarez 2cf9899d9d Fix typo. 2021-05-24 11:13:52 +02:00
Victor M. Alvarez 8b864f89de Some improvements to the documentation as suggested in #1503.
Closes #1503.
2021-05-24 09:58:34 +02:00
Victor M. Alvarez 1842271119 Add clarification about async iterations for YR_MEMORY_BLOCK_ITERATOR. 2021-04-15 12:48:43 +02:00
Victor M. Alvarez f749175f54 Rename warning_callback to warnings_callback for coherency with modules_callback. 2021-03-16 10:18:53 +01:00
Victor M. Alvarez 7588ed630f Rename tonumber function to to_number, for consistency with other names. 2021-03-15 12:38:53 +01:00
LiYang 2edd10c735 add math.tonumber function to convert bool to number (#1450)
more data types can be supported if needed, for example
string to number, etc.
2021-03-15 12:36:14 +01:00
Wesley Shields f25f12839a Add docs for yr_scanner_last_error_rule() and yr_scanner_last_error_string(). (#1449) 2021-03-15 12:23:24 +01:00
Victor M. Alvarez 392484c93d Add some more information about ERROR_BLOCK_NOT_READY to the documentation. 2021-03-11 12:11:40 +01:00
Victor M. Alvarez f8a4f14d7a Bump version number to 4.1.0. 2021-03-11 11:27:39 +01:00
Victor M. Alvarez a095c08bf6 Start raising warnings about non-ascii characters in strings. 2021-03-11 11:05:03 +01:00
Wesley Shields 2c3e032ab6 Fix overlay docs. (#1456)
Fix a bug in the overlay docs so that the example is syntactically valid.

Fixes #1455
2021-02-26 23:40:50 -06:00
Beckett Normington 24350d8346 Fix tiny typo in Yara.Match docs (#1446) 2021-02-11 10:07:12 +01:00
Runa Sandvik c88b2dcd64 Clarify that pe.imphash() requires a lowercase string (#1441)
* Clarify that pe.imphash() requires a lowercase string

* Update language for imphash()
2021-02-03 09:14:10 +01:00
Ԝеѕ c6b3c4d1e0 docs - add PE timestamp example (#1439) 2021-01-19 10:18:37 +01:00
Victor M. Alvarez 5a9efc4716 Revert changes introduced in b7da5d2835.
See #1385 for a discussion about why this has been reverted back.
2021-01-07 15:18:19 +01:00
Victor M. Alvarez 0ffcba00a6 Set pe.overlay.offset to 0 for PE files that don't have an overlaid.
Until now pe.overlay.offset was undefined in such cases. For non-PE files this fields keep being undefined.
2021-01-07 10:17:37 +01:00
Hilko Bengen 9fd9a80db6 pe: add signature[i].algorithm_oid (#1421)
* pe: add signature[i].algorithm_oid

Certificate signature algorithms are encoded using object identifiers
whose text representations depend on the cryptographic library. For
stable YARA rules, it is wiser to rely on the OID, so let's provide
it.

For example, while OpenSSL 1.1.1d resolves 1.2.840.113549.1.1.11 to
"sha256WithRSAEncryption" (or "RSA-SHA256" for the short name), the
only string representation I have gotten out of the Windows CryptoAPI
is "sha256RSA".

* Add documentation for signature[i].algorithm_oid
2020-12-27 18:04:50 +01:00
Victor M. AlvarezandSimon Hardy-Francis cba6932759 Implement non-blocking API (#1428)
With this change the yr_scanner_scan_mem_blocks function can return ERROR_BLOCK_NOT_READY when the YR_MEMORY_BLOCK_ITERATOR that provides memory blocks to the function is not ready to return the next block. After this error the caller can retry the call to yr_scanner_scan_mem_blocks multiple times until the function succeeds or fails with some other error code.

Co-authored-by: Simon Hardy-Francis <[email protected]>
2020-12-24 10:46:09 +01:00
Wesley Shields 95b43693dc Switch maximum string limit to warning. (#1350)
When we hit the maximum match limit on a string we currently abort all scanning,
which can be problematic since it isn't a good reason to stop all scanning, and
is better off as a warning to the user.

This commit makes it so that when the string match limit is hit a warning is
printed and scanning will continue. The warning message indicates that the
results may be invalid. It is hard to know for certain if they are invalid
because it depends entirely upon the condition. If you use the # or @ operator
then your condition _MAY_ be invalid since the total number of matches and
locations is not known anymore. Just checking that the string exists won't be an
invalid state since we have confirmed the existence of _AT LEAST_ the maximum
number of occurrences, which clearly satisfies the existence of a single
instance of your string.

I decided to implement this as a callback so the user of libyara has some choice
on the default behavior. If they want to consider this a "stop all scanning"
error they are free to return CALLBACK_ERROR in their callback.
2020-12-17 10:10:27 +01:00
Wesley ShieldsandVictor M. Alvarez 77328011a3 Implement pe.entry_point_raw. (#1410)
* Implement pe.entry_point_raw.

Add pe.entry_point_raw which is the raw value of the entry point field from the
optional header. This value is NOT converted to a file offset or a virtual
address, and is just the raw bytes taken straight from the header.

This allows you to use the entry point as it is specified in the file without
having to jump through hoops to parse it by hand in your condition.

* Specify the version in which entry_point_raw was added.

Co-authored-by: Victor M. Alvarez <[email protected]>
2020-12-02 10:16:26 +01:00
Wesley Shields a8d52ea40f Add number_of_imported_functions. (#1348)
Add the number of imported functions which were parsed. This is the TOTAL number
of functions across ALL imported libraries.
2020-11-23 10:18:27 +01:00
Silas Cutler d13bc34755 Update gettingstarted.rst (#1370) 2020-10-06 09:40:42 +02:00
Victor M. Alvarez 41a32691d4 Implement string operators: icontains, startswith, endswith, istartswith and iendswith. 2020-09-28 09:59:13 +02:00
Wesley Shields 472c5817dc Add documentation for rva field in resources. 2020-08-23 11:26:19 +02:00
Ԝеѕ 39076d2eb2 docs - update pe pdb_path example formatting
use consistent italic format for example
2020-08-12 10:18:09 +02:00
Ԝеѕ cdc148567d docs- fix rst link to yara.Rules match method
keyword for methods is `meth` - https://stackoverflow.com/questions/22700606/how-would-i-cross-reference-a-function-generated-by-autodoc-in-sphinx 

fixes #1307, #1308 regression
2020-07-14 09:19:52 +02:00
mattnotmax 8a749b70ad Minor adjustment
Changed to: "Return true if the file is a PE."
2020-07-01 22:14:12 +02:00
mattnotmax 1f3bf627cf added pe.is_pe() documentation 2020-07-01 22:14:12 +02:00
Victor M. Alvarez 7a5b3a29cc Accept escape sequence \t (carriage return) in text strings. 2020-06-26 16:41:58 +02:00
Victor M. Alvarez 1595e53ea6 Bump version to 4.0.2 2020-06-26 09:17:35 +02:00
Ԝеѕ d00bd91f59 Docs - fix link to Rules match() method (#1308)
should fix link from #1307
2020-06-18 17:33:23 +02:00
Ԝеѕ 1169051181 Python docs - show python exceptions raised (#1307)
* Python docs - show python exceptions raised

* link to yara.match() method
2020-06-17 21:56:55 +02:00
Victor M. Alvarez ecd25bfe69 Remove mention to META_TYPE_NULL from the documentation. 2020-06-10 12:04:02 +02:00
hepler d6c469f41f Fix typos and inconsistent indentation in docs 2020-06-02 11:41:56 +02:00