rule win_colibri_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.colibri."
        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.colibri"
        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 = { 8d0c4502000000 e8???????? 89442440 be???????? 8bfc 8bc8 }
            // n = 6, score = 100
            //   8d0c4502000000       | lea                 ecx, [eax*2 + 2]
            //   e8????????           |                     
            //   89442440             | mov                 dword ptr [esp + 0x40], eax
            //   be????????           |                     
            //   8bfc                 | mov                 edi, esp
            //   8bc8                 | mov                 ecx, eax

        $sequence_1 = { ff75f4 6a02 59 e8???????? ba49f6fd69 8bc8 }
            // n = 6, score = 100
            //   ff75f4               | push                dword ptr [ebp - 0xc]
            //   6a02                 | push                2
            //   59                   | pop                 ecx
            //   e8????????           |                     
            //   ba49f6fd69           | mov                 edx, 0x69fdf649
            //   8bc8                 | mov                 ecx, eax

        $sequence_2 = { 8b4df0 e8???????? 8bf8 8bcf e8???????? }
            // n = 5, score = 100
            //   8b4df0               | mov                 ecx, dword ptr [ebp - 0x10]
            //   e8????????           |                     
            //   8bf8                 | mov                 edi, eax
            //   8bcf                 | mov                 ecx, edi
            //   e8????????           |                     

        $sequence_3 = { 8902 83c204 8955f8 8b01 85c0 }
            // n = 5, score = 100
            //   8902                 | mov                 dword ptr [edx], eax
            //   83c204               | add                 edx, 4
            //   8955f8               | mov                 dword ptr [ebp - 8], edx
            //   8b01                 | mov                 eax, dword ptr [ecx]
            //   85c0                 | test                eax, eax

        $sequence_4 = { 8b4df8 8d144502000000 e8???????? a1???????? 8b4df4 }
            // n = 5, score = 100
            //   8b4df8               | mov                 ecx, dword ptr [ebp - 8]
            //   8d144502000000       | lea                 edx, [eax*2 + 2]
            //   e8????????           |                     
            //   a1????????           |                     
            //   8b4df4               | mov                 ecx, dword ptr [ebp - 0xc]

        $sequence_5 = { 8b75f8 85c0 745c 57 8d85ecfdffff }
            // n = 5, score = 100
            //   8b75f8               | mov                 esi, dword ptr [ebp - 8]
            //   85c0                 | test                eax, eax
            //   745c                 | je                  0x5e
            //   57                   | push                edi
            //   8d85ecfdffff         | lea                 eax, [ebp - 0x214]

        $sequence_6 = { 8bd8 56 895c2444 53 6a02 59 }
            // n = 6, score = 100
            //   8bd8                 | mov                 ebx, eax
            //   56                   | push                esi
            //   895c2444             | mov                 dword ptr [esp + 0x44], ebx
            //   53                   | push                ebx
            //   6a02                 | push                2
            //   59                   | pop                 ecx

        $sequence_7 = { e8???????? 83c410 b8???????? 68???????? 50 53 8b5dfc }
            // n = 7, score = 100
            //   e8????????           |                     
            //   83c410               | add                 esp, 0x10
            //   b8????????           |                     
            //   68????????           |                     
            //   50                   | push                eax
            //   53                   | push                ebx
            //   8b5dfc               | mov                 ebx, dword ptr [ebp - 4]

        $sequence_8 = { 8365f800 50 e8???????? 59 85c0 7413 8b4dfc }
            // n = 7, score = 100
            //   8365f800             | and                 dword ptr [ebp - 8], 0
            //   50                   | push                eax
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   85c0                 | test                eax, eax
            //   7413                 | je                  0x15
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]

        $sequence_9 = { ba5986c991 8bc8 e8???????? ffd0 89442444 eb43 }
            // n = 6, score = 100
            //   ba5986c991           | mov                 edx, 0x91c98659
            //   8bc8                 | mov                 ecx, eax
            //   e8????????           |                     
            //   ffd0                 | call                eax
            //   89442444             | mov                 dword ptr [esp + 0x44], eax
            //   eb43                 | jmp                 0x45

    condition:
        7 of them and filesize < 51200
}