mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-12 02:10:00 +00:00
* Fix Rich header parsing. The rich header doesn't always start at 0x80. The proper way to find the rich header is to start at the NT header and work backwards one dword at a time (technically the NT header is supposed to be 8 byte aligned, if someone has a sample which isn't I'd love to see it) looking for Rich. Once you find it you can get the XOR key which follows it and then continue to look backwards for the DanS (after applying the XOR). Decent documentation on this is at http://bytepointer.com/articles/the_microsoft_rich_header.htm. Also, fun fact which we may want to consider implementing is that the XOR key is actually derived from the DOS header, so it may be an interesting way to tell if the rich header has been tampered with if they do not properly recalculate the key. Fixes #1149. * Split Rich signature walking into two loops. While here, add a test that makes sure the clear version of the rich signature is properly calculated.
840 B
840 B