rule win_domino_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.domino."
        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.domino"
        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 = { e8???????? 84c0 750f 66c7030101 b802000000 e9???????? 488d942450010000 }
            // n = 7, score = 200
            //   e8????????           |                     
            //   84c0                 | mov                 ecx, 0x40
            //   750f                 | dec                 eax
            //   66c7030101           | arpl                ax, dx
            //   b802000000           | mov                 esi, 1
            //   e9????????           |                     
            //   488d942450010000     | test                esi, esi

        $sequence_1 = { 7d07 ffc8 83c8f0 ffc0 48ffc2 }
            // n = 5, score = 200
            //   7d07                 | dec                 eax
            //   ffc8                 | and                 dword ptr [esp + 0x20], 0
            //   83c8f0               | inc                 ebp
            //   ffc0                 | xor                 eax, eax
            //   48ffc2               | mov                 dword ptr [esp + 0x40], 1

        $sequence_2 = { 488b1a 488bfa 488bf1 8b13 488bce }
            // n = 5, score = 200
            //   488b1a               | dec                 eax
            //   488bfa               | lea                 edx, [esp + 0x40]
            //   488bf1               | dec                 eax
            //   8b13                 | mov                 dword ptr [esp + 0x38], eax
            //   488bce               | dec                 eax

        $sequence_3 = { ff15???????? b806000000 eb2c 488bcf ff15???????? 488d4c2440 e8???????? }
            // n = 7, score = 200
            //   ff15????????         |                     
            //   b806000000           | dec                 eax
            //   eb2c                 | lea                 edx, [ebp - 0x39]
            //   488bcf               | mov                 ecx, 3
            //   ff15????????         |                     
            //   488d4c2440           | dec                 esp
            //   e8????????           |                     

        $sequence_4 = { 741a 488b4c2458 ff15???????? 488b4c2450 ff15???????? }
            // n = 5, score = 200
            //   741a                 | xor                 eax, eax
            //   488b4c2458           | inc                 esp
            //   ff15????????         |                     
            //   488b4c2450           | mov                 dword ptr [esp + 0x24], esp
            //   ff15????????         |                     

        $sequence_5 = { 66c7030101 b802000000 e9???????? 488d942450010000 b904010000 }
            // n = 5, score = 200
            //   66c7030101           | mov                 byte ptr [ecx], al
            //   b802000000           | dec                 ecx
            //   e9????????           |                     
            //   488d942450010000     | sub                 eax, 1
            //   b904010000           | jne                 0x79d

        $sequence_6 = { 48896810 48897018 48897820 4156 4881ec90000000 8bf2 }
            // n = 6, score = 200
            //   48896810             | lea                 eax, [ebp + 0x77]
            //   48897018             | dec                 eax
            //   48897820             | lea                 edx, [ebp - 0x49]
            //   4156                 | mov                 ecx, 3
            //   4881ec90000000       | mov                 dword ptr [ebp + 0x77], 0x80
            //   8bf2                 | mov                 word ptr [ebp - 0x49], 0x2b

        $sequence_7 = { e9???????? 8b442470 488b9c2488000000 4883c440 }
            // n = 4, score = 200
            //   e9????????           |                     
            //   8b442470             | dec                 ebp
            //   488b9c2488000000     | arpl                cx, dx
            //   4883c440             | dec                 esp

        $sequence_8 = { 85c0 7509 488b5b08 483b1f 75e9 }
            // n = 5, score = 200
            //   85c0                 | inc                 ebp
            //   7509                 | mov                 al, cl
            //   488b5b08             | inc                 esp
            //   483b1f               | cmp                 byte ptr [eax], al
            //   75e9                 | jne                 0xa91

        $sequence_9 = { f7d9 451af6 4180c602 498bcf }
            // n = 4, score = 200
            //   f7d9                 | inc                 ebp
            //   451af6               | imul                ecx, ecx, 0xf4240
            //   4180c602             | push                edi
            //   498bcf               | dec                 eax

    condition:
        7 of them and filesize < 50176
}