rule win_romeos_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.romeos."
        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.romeos"
        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 = { 8d44244c c644241701 50 bd30000000 e8???????? 8bbc2454200000 }
            // n = 6, score = 400
            //   8d44244c             | lea                 eax, [esp + 0x4c]
            //   c644241701           | mov                 byte ptr [esp + 0x17], 1
            //   50                   | push                eax
            //   bd30000000           | mov                 ebp, 0x30
            //   e8????????           |                     
            //   8bbc2454200000       | mov                 edi, dword ptr [esp + 0x2054]

        $sequence_1 = { 57 8bce e8???????? 85c0 7522 50 }
            // n = 6, score = 400
            //   57                   | push                edi
            //   8bce                 | mov                 ecx, esi
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   7522                 | jne                 0x24
            //   50                   | push                eax

        $sequence_2 = { 8b542414 6a16 8d44244c 52 50 e8???????? }
            // n = 6, score = 400
            //   8b542414             | mov                 edx, dword ptr [esp + 0x14]
            //   6a16                 | push                0x16
            //   8d44244c             | lea                 eax, [esp + 0x4c]
            //   52                   | push                edx
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_3 = { 85c0 0f85ef000000 85db 751d 807c244802 0f85e0000000 }
            // n = 6, score = 400
            //   85c0                 | test                eax, eax
            //   0f85ef000000         | jne                 0xf5
            //   85db                 | test                ebx, ebx
            //   751d                 | jne                 0x1f
            //   807c244802           | cmp                 byte ptr [esp + 0x48], 2
            //   0f85e0000000         | jne                 0xe6

        $sequence_4 = { bd30000000 33db 85ed 7e0e e8???????? 88441c18 43 }
            // n = 7, score = 400
            //   bd30000000           | mov                 ebp, 0x30
            //   33db                 | xor                 ebx, ebx
            //   85ed                 | test                ebp, ebp
            //   7e0e                 | jle                 0x10
            //   e8????????           |                     
            //   88441c18             | mov                 byte ptr [esp + ebx + 0x18], al
            //   43                   | inc                 ebx

        $sequence_5 = { 3bdd 7cf2 8b542414 6a16 8d44244c }
            // n = 5, score = 400
            //   3bdd                 | cmp                 ebx, ebp
            //   7cf2                 | jl                  0xfffffff4
            //   8b542414             | mov                 edx, dword ptr [esp + 0x14]
            //   6a16                 | push                0x16
            //   8d44244c             | lea                 eax, [esp + 0x4c]

        $sequence_6 = { 43 83fb08 7cb6 e8???????? 99 }
            // n = 5, score = 400
            //   43                   | inc                 ebx
            //   83fb08               | cmp                 ebx, 8
            //   7cb6                 | jl                  0xffffffb8
            //   e8????????           |                     
            //   99                   | cdq                 

        $sequence_7 = { 50 57 8bce e8???????? 85c0 7522 50 }
            // n = 7, score = 400
            //   50                   | push                eax
            //   57                   | push                edi
            //   8bce                 | mov                 ecx, esi
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   7522                 | jne                 0x24
            //   50                   | push                eax

        $sequence_8 = { 8d7c2449 c644244800 6a16 f3ab 66ab aa 8d44244c }
            // n = 7, score = 400
            //   8d7c2449             | lea                 edi, [esp + 0x49]
            //   c644244800           | mov                 byte ptr [esp + 0x48], 0
            //   6a16                 | push                0x16
            //   f3ab                 | rep stosd           dword ptr es:[edi], eax
            //   66ab                 | stosw               word ptr es:[edi], ax
            //   aa                   | stosb               byte ptr es:[edi], al
            //   8d44244c             | lea                 eax, [esp + 0x4c]

        $sequence_9 = { bd30000000 e8???????? 8bbc2454200000 83c404 8bce }
            // n = 5, score = 400
            //   bd30000000           | mov                 ebp, 0x30
            //   e8????????           |                     
            //   8bbc2454200000       | mov                 edi, dword ptr [esp + 0x2054]
            //   83c404               | add                 esp, 4
            //   8bce                 | mov                 ecx, esi

    condition:
        7 of them and filesize < 294912
}