rule win_rerdom_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.rerdom."
        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.rerdom"
        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 = { 8d45e0 50 897df8 e8???????? 8b83b0000000 3bc7 7506 }
            // n = 7, score = 200
            //   8d45e0               | lea                 eax, [ebp - 0x20]
            //   50                   | push                eax
            //   897df8               | mov                 dword ptr [ebp - 8], edi
            //   e8????????           |                     
            //   8b83b0000000         | mov                 eax, dword ptr [ebx + 0xb0]
            //   3bc7                 | cmp                 eax, edi
            //   7506                 | jne                 8

        $sequence_1 = { eb0b 6800010000 8d858cfeffff 57 50 e8???????? 6a29 }
            // n = 7, score = 200
            //   eb0b                 | jmp                 0xd
            //   6800010000           | push                0x100
            //   8d858cfeffff         | lea                 eax, [ebp - 0x174]
            //   57                   | push                edi
            //   50                   | push                eax
            //   e8????????           |                     
            //   6a29                 | push                0x29

        $sequence_2 = { ffd6 85c0 8bc7 7507 e8???????? 33c0 5f }
            // n = 7, score = 200
            //   ffd6                 | call                esi
            //   85c0                 | test                eax, eax
            //   8bc7                 | mov                 eax, edi
            //   7507                 | jne                 9
            //   e8????????           |                     
            //   33c0                 | xor                 eax, eax
            //   5f                   | pop                 edi

        $sequence_3 = { 85c0 74f0 53 8b5d20 57 ff7538 8b7d1c }
            // n = 7, score = 200
            //   85c0                 | test                eax, eax
            //   74f0                 | je                  0xfffffff2
            //   53                   | push                ebx
            //   8b5d20               | mov                 ebx, dword ptr [ebp + 0x20]
            //   57                   | push                edi
            //   ff7538               | push                dword ptr [ebp + 0x38]
            //   8b7d1c               | mov                 edi, dword ptr [ebp + 0x1c]

        $sequence_4 = { 894618 85c0 0f84c8000000 a1???????? 85c0 7522 68???????? }
            // n = 7, score = 200
            //   894618               | mov                 dword ptr [esi + 0x18], eax
            //   85c0                 | test                eax, eax
            //   0f84c8000000         | je                  0xce
            //   a1????????           |                     
            //   85c0                 | test                eax, eax
            //   7522                 | jne                 0x24
            //   68????????           |                     

        $sequence_5 = { 85c0 750c c7833c01000003000000 eb7a 56 8bc7 }
            // n = 6, score = 200
            //   85c0                 | test                eax, eax
            //   750c                 | jne                 0xe
            //   c7833c01000003000000     | mov    dword ptr [ebx + 0x13c], 3
            //   eb7a                 | jmp                 0x7c
            //   56                   | push                esi
            //   8bc7                 | mov                 eax, edi

        $sequence_6 = { 8bc8 85c9 7409 8b442404 e8???????? }
            // n = 5, score = 200
            //   8bc8                 | mov                 ecx, eax
            //   85c9                 | test                ecx, ecx
            //   7409                 | je                  0xb
            //   8b442404             | mov                 eax, dword ptr [esp + 4]
            //   e8????????           |                     

        $sequence_7 = { 8bc2 c3 85f6 7420 f7461000000001 7410 }
            // n = 6, score = 200
            //   8bc2                 | mov                 eax, edx
            //   c3                   | ret                 
            //   85f6                 | test                esi, esi
            //   7420                 | je                  0x22
            //   f7461000000001       | test                dword ptr [esi + 0x10], 0x1000000
            //   7410                 | je                  0x12

        $sequence_8 = { a3???????? 8bcf e8???????? ff35???????? 83c8ff e8???????? 5f }
            // n = 7, score = 200
            //   a3????????           |                     
            //   8bcf                 | mov                 ecx, edi
            //   e8????????           |                     
            //   ff35????????         |                     
            //   83c8ff               | or                  eax, 0xffffffff
            //   e8????????           |                     
            //   5f                   | pop                 edi

        $sequence_9 = { e8???????? 8b442434 8b08 50 ff5108 ff442414 8b442414 }
            // n = 7, score = 200
            //   e8????????           |                     
            //   8b442434             | mov                 eax, dword ptr [esp + 0x34]
            //   8b08                 | mov                 ecx, dword ptr [eax]
            //   50                   | push                eax
            //   ff5108               | call                dword ptr [ecx + 8]
            //   ff442414             | inc                 dword ptr [esp + 0x14]
            //   8b442414             | mov                 eax, dword ptr [esp + 0x14]

    condition:
        7 of them and filesize < 352256
}