rule win_darkbit_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.darkbit."
        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.darkbit"
        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???????? 0f1f440000 e8???????? 4889c1 4889df 488d05ae932c00 488b5c2438 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   0f1f440000           | cmp                 eax, 0x17
            //   e8????????           |                     
            //   4889c1               | jne                 0x4a5
            //   4889df               | dec                 eax
            //   488d05ae932c00       | mov                 ecx, dword ptr [esp + 0xc0]
            //   488b5c2438           | dec                 esp

        $sequence_1 = { e8???????? e8???????? 48898424d8290000 48899c24a80d0000 488b0d???????? 48898c24181c0000 488d052be90800 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   e8????????           |                     
            //   48898424d8290000     | mov                 eax, dword ptr [esp + 0x40]
            //   48899c24a80d0000     | mov                 byte ptr [edi + ebx], 0x2e
            //   488b0d????????       |                     
            //   48898c24181c0000     | mov                 ecx, 2
            //   488d052be90800       | dec                 ecx

        $sequence_2 = { e9???????? 4983f806 7548 4c8d4301 4c39c6 7331 488d0585742c00 }
            // n = 7, score = 100
            //   e9????????           |                     
            //   4983f806             | add                 edx, eax
            //   7548                 | mov                 byte ptr [eax], dl
            //   4c8d4301             | dec                 eax
            //   4c39c6               | mov                 edi, ecx
            //   7331                 | mov                 esi, 4
            //   488d0585742c00       | movzx               edx, byte ptr [esp + 0x4f]

        $sequence_3 = { e8???????? 4889d7 488b4c2470 488b7c2448 4889de 4989c0 488b442460 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   4889d7               | dec                 eax
            //   488b4c2470           | mov                 dword ptr [esp + 0x800], eax
            //   488b7c2448           | dec                 eax
            //   4889de               | mov                 dword ptr [esp + 0x558], ebx
            //   4989c0               | dec                 eax
            //   488b442460           | mov                 eax, dword ptr [esp + 0x2f0]

        $sequence_4 = { e8???????? 4889d9 4889c2 48899424e8000000 48898c2488060000 90 488b9c24e0070000 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   4889d9               | dec                 eax
            //   4889c2               | mov                 dword ptr [esp + 0xac8], ebx
            //   48899424e8000000     | dec                 eax
            //   48898c2488060000     | mov                 eax, dword ptr [esp + 0x1d8]
            //   90                   | dec                 eax
            //   488b9c24e0070000     | mov                 ebx, 0xffffffff

        $sequence_5 = { e8???????? 488d3d67973f00 e8???????? e8???????? 48898424f0160000 48899c2498040000 488b0d???????? }
            // n = 7, score = 100
            //   e8????????           |                     
            //   488d3d67973f00       | dec                 eax
            //   e8????????           |                     
            //   e8????????           |                     
            //   48898424f0160000     | mov                 edi, eax
            //   48899c2498040000     | dec                 eax
            //   488b0d????????       |                     

        $sequence_6 = { e8???????? 488d05d3733700 bb04000000 488b4c2438 488b7c2440 e8???????? 488d059d733700 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   488d05d3733700       | mov                 ecx, eax
            //   bb04000000           | dec                 eax
            //   488b4c2438           | mov                 edi, eax
            //   488b7c2440           | dec                 eax
            //   e8????????           |                     
            //   488d059d733700       | mov                 esi, ecx

        $sequence_7 = { eb11 488d7918 488b942480060000 e8???????? 488b9424d8010000 48ffca 48895120 }
            // n = 7, score = 100
            //   eb11                 | mov                 dword ptr [esp + 0x538], eax
            //   488d7918             | dec                 eax
            //   488b942480060000     | mov                 ecx, ebx
            //   e8????????           |                     
            //   488b9424d8010000     | dec                 eax
            //   48ffca               | mov                 ebx, dword ptr [esp + 0xc60]
            //   48895120             | dec                 eax

        $sequence_8 = { eb21 4889c7 488b8c24381e0000 e8???????? 488d7810 488b842430160000 e8???????? }
            // n = 7, score = 100
            //   eb21                 | mov                 ecx, dword ptr [esp + 0x50]
            //   4889c7               | dec                 eax
            //   488b8c24381e0000     | mov                 edx, dword ptr [esp + 0x70]
            //   e8????????           |                     
            //   488d7810             | dec                 eax
            //   488b842430160000     | cmp                 ecx, edx
            //   e8????????           |                     

        $sequence_9 = { e8???????? 488b542450 4c8b8424d0000000 410fb6441002 83e00f 488b0d???????? 4c8b0d???????? }
            // n = 7, score = 100
            //   e8????????           |                     
            //   488b542450           | dec                 eax
            //   4c8b8424d0000000     | mov                 edx, dword ptr [edx + 0x28]
            //   410fb6441002         | dec                 eax
            //   83e00f               | mov                 dword ptr [esp + 0xe8], edi
            //   488b0d????????       |                     
            //   4c8b0d????????       |                     

    condition:
        7 of them and filesize < 11612160
}