rule win_cotx_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.cotx."
        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.cotx"
        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???????? b906010200 85c0 0f45f1 }
            // n = 4, score = 500
            //   e8????????           |                     
            //   b906010200           | mov                 ecx, 0x20106
            //   85c0                 | test                eax, eax
            //   0f45f1               | cmovne              esi, ecx

        $sequence_1 = { 8d85bcebffff 50 e8???????? 8d8dbcebffff }
            // n = 4, score = 500
            //   8d85bcebffff         | lea                 eax, [ebp - 0x1444]
            //   50                   | push                eax
            //   e8????????           |                     
            //   8d8dbcebffff         | lea                 ecx, [ebp - 0x1444]

        $sequence_2 = { 50 e8???????? 8d85bce3ffff 50 }
            // n = 4, score = 500
            //   50                   | push                eax
            //   e8????????           |                     
            //   8d85bce3ffff         | lea                 eax, [ebp - 0x1c44]
            //   50                   | push                eax

        $sequence_3 = { c705????????92d61819 c705????????0c56aef3 c705????????c8a4ea05 c705????????69e053a4 }
            // n = 4, score = 500
            //   c705????????92d61819     |     
            //   c705????????0c56aef3     |     
            //   c705????????c8a4ea05     |     
            //   c705????????69e053a4     |     

        $sequence_4 = { c785d8feffff74726f6c c785dcfeffff6c65722e c785e0feffff6578652e 66c785e4feffff696e c685e6feffff69 e8???????? }
            // n = 6, score = 500
            //   c785d8feffff74726f6c     | mov    dword ptr [ebp - 0x128], 0x6c6f7274
            //   c785dcfeffff6c65722e     | mov    dword ptr [ebp - 0x124], 0x2e72656c
            //   c785e0feffff6578652e     | mov    dword ptr [ebp - 0x120], 0x2e657865
            //   66c785e4feffff696e     | mov    word ptr [ebp - 0x11c], 0x6e69
            //   c685e6feffff69       | mov                 byte ptr [ebp - 0x11a], 0x69
            //   e8????????           |                     

        $sequence_5 = { 740e 3d10b6afa6 7407 3d36ce164d }
            // n = 4, score = 500
            //   740e                 | je                  0x10
            //   3d10b6afa6           | cmp                 eax, 0xa6afb610
            //   7407                 | je                  9
            //   3d36ce164d           | cmp                 eax, 0x4d16ce36

        $sequence_6 = { 50 8d85bcfbffff 50 8d85bcebffff }
            // n = 4, score = 500
            //   50                   | push                eax
            //   8d85bcfbffff         | lea                 eax, [ebp - 0x444]
            //   50                   | push                eax
            //   8d85bcebffff         | lea                 eax, [ebp - 0x1444]

        $sequence_7 = { ff15???????? 8d85bcf3ffff 50 ff15???????? 8d85bcf3ffff 6a2e 50 }
            // n = 7, score = 500
            //   ff15????????         |                     
            //   8d85bcf3ffff         | lea                 eax, [ebp - 0xc44]
            //   50                   | push                eax
            //   ff15????????         |                     
            //   8d85bcf3ffff         | lea                 eax, [ebp - 0xc44]
            //   6a2e                 | push                0x2e
            //   50                   | push                eax

        $sequence_8 = { c705????????d468bcb5 c705????????a1a14538 c705????????2086e659 c705????????eec45abf }
            // n = 4, score = 500
            //   c705????????d468bcb5     |     
            //   c705????????a1a14538     |     
            //   c705????????2086e659     |     
            //   c705????????eec45abf     |     

        $sequence_9 = { 50 56 6a00 57 53 ff15???????? 85c0 }
            // n = 7, score = 500
            //   50                   | push                eax
            //   56                   | push                esi
            //   6a00                 | push                0
            //   57                   | push                edi
            //   53                   | push                ebx
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax

    condition:
        7 of them and filesize < 1171456
}