rule win_defendnot_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.defendnot."
        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.defendnot"
        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 = { 0f1102 e8???????? 488d05f0160500 488903 488bc3 }
            // n = 5, score = 100
            //   0f1102               | xorps               xmm0, xmm0
            //   e8????????           |                     
            //   488d05f0160500       | movups              xmmword ptr [ebp - 0x20], xmm0
            //   488903               | add                 eax, edi
            //   488bc3               | jne                 0x160

        $sequence_1 = { 488bd9 488bc2 488d0d55360300 0f57c0 488d5308 48890b 488d4808 }
            // n = 7, score = 100
            //   488bd9               | dec                 eax
            //   488bc2               | mov                 eax, dword ptr [ebx + 8]
            //   488d0d55360300       | inc                 esp
            //   0f57c0               | mov                 byte ptr [ecx + eax], bh
            //   488d5308             | dec                 eax
            //   48890b               | inc                 dword ptr [ebx + 0x10]
            //   488d4808             | dec                 eax

        $sequence_2 = { 4963c7 4c8d1440 4a8b84d6b0720300 48f7e3 4a8b84d6b8720300 488bca 48f7e3 }
            // n = 7, score = 100
            //   4963c7               | mov                 dword ptr [esp + 0x388], ebp
            //   4c8d1440             | dec                 eax
            //   4a8b84d6b0720300     | sar                 ecx, 3
            //   48f7e3               | add                 ecx, -5
            //   4a8b84d6b8720300     | dec                 esp
            //   488bca               | mov                 dword ptr [esp + 0x380], ebp
            //   48f7e3               | dec                 esp

        $sequence_3 = { 740b 493bde 0f85c1000000 eb6b 4d8bbcf7403e0500 33d2 498bcf }
            // n = 7, score = 100
            //   740b                 | mov                 eax, dword ptr [ebx]
            //   493bde               | nop                 
            //   0f85c1000000         | dec                 eax
            //   eb6b                 | mov                 edx, ecx
            //   4d8bbcf7403e0500     | dec                 eax
            //   33d2                 | shr                 edx, 1
            //   498bcf               | inc                 ecx

        $sequence_4 = { 488d4c2430 e8???????? 90 4c897c2470 488b4580 4885c0 7422 }
            // n = 7, score = 100
            //   488d4c2430           | add                 esp, 0x20
            //   e8????????           |                     
            //   90                   | dec                 eax
            //   4c897c2470           | lea                 edx, [0x2fc6d]
            //   488b4580             | inc                 esp
            //   4885c0               | mov                 eax, esi
            //   7422                 | dec                 eax

        $sequence_5 = { 7417 4180fb05 7511 41f6c001 450fb6db b904000000 }
            // n = 6, score = 100
            //   7417                 | dec                 eax
            //   4180fb05             | mov                 dword ptr [esp + 8], ebx
            //   7511                 | push                edi
            //   41f6c001             | dec                 eax
            //   450fb6db             | sub                 esp, 0x20
            //   b904000000           | movd                eax, xmm0

        $sequence_6 = { e8???????? 8bf8 e9???????? 4889742460 4c89642470 4c8d25557a0200 4c897c2478 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   8bf8                 | dec                 eax
            //   e9????????           |                     
            //   4889742460           | sub                 eax, edi
            //   4c89642470           | mov                 ebx, ebp
            //   4c8d25557a0200       | mov                 dword ptr [eax + 8], 0
            //   4c897c2478           | jmp                 0xb7

        $sequence_7 = { 448bca 0fb7841870cb0500 66418900 4183f90a 7213 4503c9 410fb7841970cb0500 }
            // n = 7, score = 100
            //   448bca               | lea                 ecx, [0xffffd280]
            //   0fb7841870cb0500     | dec                 esp
            //   66418900             | lea                 eax, [ecx + 0x35e50]
            //   4183f90a             | dec                 esp
            //   7213                 | add                 eax, eax
            //   4503c9               | dec                 ecx
            //   410fb7841970cb0500     | mov    eax, dword ptr [eax + 8]

        $sequence_8 = { 488bd9 4883f8ff 7433 4885c0 7522 4c8d0d7c2c0300 4c8d056d2c0300 }
            // n = 7, score = 100
            //   488bd9               | dec                 eax
            //   4883f8ff             | mov                 ecx, dword ptr [ebx + 0x10]
            //   7433                 | dec                 eax
            //   4885c0               | mov                 eax, dword ptr [ebx + 8]
            //   7522                 | mov                 byte ptr [ecx + eax], 0x30
            //   4c8d0d7c2c0300       | dec                 eax
            //   4c8d056d2c0300       | inc                 dword ptr [ebx + 0x10]

        $sequence_9 = { 4c8d1cc8 eb1e 443bc8 410f4cc1 4c8d1d05820400 b935010000 448bc8 }
            // n = 7, score = 100
            //   4c8d1cc8             | dec                 eax
            //   eb1e                 | sub                 esp, 0x90
            //   443bc8               | dec                 eax
            //   410f4cc1             | xor                 eax, esp
            //   4c8d1d05820400       | dec                 esp
            //   b935010000           | mov                 ebx, esi
            //   448bc8               | inc                 esp

    condition:
        7 of them and filesize < 922624
}