rule win_revenant_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.revenant."
        info = "autogenerated rule brought to you by yara-signator"
        tool = "yara-signator v0.6.0"
        signator_config = "callsandjumps;datarefs;binvalue"
        malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.revenant"
        malpedia_rule_date = "20260916"
        malpedia_hash = "53a643781c18e08f4a50949af60172d837a0b6f6"
        malpedia_version = "20260917"
        malpedia_license = "CC BY-SA 4.0"
        malpedia_sharing = "TLP:WHITE"

    /* DISCLAIMER
     * The strings used in this rule have been automatically selected from the
     * disassembly of memory dumps and unpacked files, using YARA-Signator.
     * The code and documentation is published here:
     * https://github.com/fxb-cocacoding/yara-signator
     * As Malpedia is used as data source, please note that for a given
     * number of families, only single samples are documented.
     * This likely impacts the degree of generalization these rules will offer.
     * Take the described generation method also into consideration when you
     * apply the rules in your use cases and assign them confidence levels.
     */


    strings:
        $sequence_0 = { 4c01c9 e8???????? 89c2 498d4201 39f2 751f 418b5324 }
            // n = 7, score = 100
            //   4c01c9               | dec                 esp
            //   e8????????           |                     
            //   89c2                 | lea                 eax, [esp + 0xa0]
            //   498d4201             | inc                 ebp
            //   39f2                 | xor                 ecx, ecx
            //   751f                 | dec                 eax
            //   418b5324             | lea                 edx, [esp + 0x70]

        $sequence_1 = { 31d2 4989c0 443b28 750e 48c1e204 4889f1 }
            // n = 6, score = 100
            //   31d2                 | dec                 eax
            //   4989c0               | lea                 ebp, [0x3708]
            //   443b28               | dec                 esp
            //   750e                 | lea                 esp, [0x3720]
            //   48c1e204             | dec                 eax
            //   4889f1               | mov                 ecx, esi

        $sequence_2 = { ebd6 f7d0 c3 57 }
            // n = 4, score = 100
            //   ebd6                 | mov                 eax, 0x42
            //   f7d0                 | je                  0x1f2
            //   c3                   | dec                 eax
            //   57                   | mov                 edx, dword ptr [ecx + 8]

        $sequence_3 = { 488b5310 41b842000000 488b4b08 4801ea }
            // n = 4, score = 100
            //   488b5310             | dec                 eax
            //   41b842000000         | mov                 ecx, esi
            //   488b4b08             | dec                 eax
            //   4801ea               | mov                 ecx, esi

        $sequence_4 = { 8b15???????? 85d2 7473 4883c420 }
            // n = 4, score = 100
            //   8b15????????         |                     
            //   85d2                 | mov                 esp, eax
            //   7473                 | mov                 eax, dword ptr [esp + 0x48]
            //   4883c420             | dec                 esp

        $sequence_5 = { e8???????? 31d2 4889f1 89542444 }
            // n = 4, score = 100
            //   e8????????           |                     
            //   31d2                 | mov                 edi, ecx
            //   4889f1               | pop                 ebx
            //   89542444             | pop                 esi

        $sequence_6 = { 4c894c2470 4531c9 488b4f28 4489542420 e8???????? 4885c0 4889442448 }
            // n = 7, score = 100
            //   4c894c2470           | jmp                 0x176c
            //   4531c9               | dec                 eax
            //   488b4f28             | add                 edx, edi
            //   4489542420           | dec                 ebp
            //   e8????????           |                     
            //   4885c0               | test                ebp, ebp
            //   4889442448           | je                  0x1831

        $sequence_7 = { 4889442420 7424 448b442428 31c9 ff15???????? 488b542420 }
            // n = 6, score = 100
            //   4889442420           | dec                 eax
            //   7424                 | mov                 ebx, ecx
            //   448b442428           | push                ebx
            //   31c9                 | dec                 eax
            //   ff15????????         |                     
            //   488b542420           | sub                 esp, 0x28

        $sequence_8 = { 488b4c2420 41ffd7 31c0 31c9 4889f2 4889442420 e8???????? }
            // n = 7, score = 100
            //   488b4c2420           | inc                 ecx
            //   41ffd7               | call                esi
            //   31c0                 | dec                 eax
            //   31c9                 | test                eax, eax
            //   4889f2               | dec                 eax
            //   4889442420           | mov                 edx, eax
            //   e8????????           |                     

        $sequence_9 = { 4885c0 4889c2 4889442420 7424 448b442428 31c9 ff15???????? }
            // n = 7, score = 100
            //   4885c0               | dec                 eax
            //   4889c2               | mov                 edx, ebx
            //   4889442420           | dec                 eax
            //   7424                 | mov                 edx, esi
            //   448b442428           | dec                 eax
            //   31c9                 | mov                 ecx, ebx
            //   ff15????????         |                     

    condition:
        7 of them and filesize < 99328
}