rule win_winnti_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.winnti."
        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.winnti"
        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 = { 81e6ffff0000 ff15???????? c1e010 0bf0 }
            // n = 4, score = 200
            //   81e6ffff0000         | and                 esi, 0xffff
            //   ff15????????         |                     
            //   c1e010               | shl                 eax, 0x10
            //   0bf0                 | or                  esi, eax

        $sequence_1 = { 740c 8902 8b442410 03c1 89442410 }
            // n = 5, score = 200
            //   740c                 | je                  0xe
            //   8902                 | mov                 dword ptr [edx], eax
            //   8b442410             | mov                 eax, dword ptr [esp + 0x10]
            //   03c1                 | add                 eax, ecx
            //   89442410             | mov                 dword ptr [esp + 0x10], eax

        $sequence_2 = { 3bc7 897c2430 7409 8bc8 e8???????? eb02 }
            // n = 6, score = 200
            //   3bc7                 | cmp                 eax, edi
            //   897c2430             | mov                 dword ptr [esp + 0x30], edi
            //   7409                 | je                  0xb
            //   8bc8                 | mov                 ecx, eax
            //   e8????????           |                     
            //   eb02                 | jmp                 4

        $sequence_3 = { 83e103 f3a4 8b7c2470 83c9ff }
            // n = 4, score = 200
            //   83e103               | and                 ecx, 3
            //   f3a4                 | rep movsb           byte ptr es:[edi], byte ptr [esi]
            //   8b7c2470             | mov                 edi, dword ptr [esp + 0x70]
            //   83c9ff               | or                  ecx, 0xffffffff

        $sequence_4 = { 8d7c1901 e8???????? 6a04 53 8d442418 }
            // n = 5, score = 200
            //   8d7c1901             | lea                 edi, [ecx + ebx + 1]
            //   e8????????           |                     
            //   6a04                 | push                4
            //   53                   | push                ebx
            //   8d442418             | lea                 eax, [esp + 0x18]

        $sequence_5 = { 896c2418 55 e8???????? 8bd0 }
            // n = 4, score = 200
            //   896c2418             | mov                 dword ptr [esp + 0x18], ebp
            //   55                   | push                ebp
            //   e8????????           |                     
            //   8bd0                 | mov                 edx, eax

        $sequence_6 = { 55 56 8b4330 8b4b2c 8b35???????? }
            // n = 5, score = 200
            //   55                   | push                ebp
            //   56                   | push                esi
            //   8b4330               | mov                 eax, dword ptr [ebx + 0x30]
            //   8b4b2c               | mov                 ecx, dword ptr [ebx + 0x2c]
            //   8b35????????         |                     

        $sequence_7 = { 50 56 e8???????? 83c408 eb9b 8b561c 52 }
            // n = 7, score = 200
            //   50                   | push                eax
            //   56                   | push                esi
            //   e8????????           |                     
            //   83c408               | add                 esp, 8
            //   eb9b                 | jmp                 0xffffff9d
            //   8b561c               | mov                 edx, dword ptr [esi + 0x1c]
            //   52                   | push                edx

        $sequence_8 = { 458d60f8 4488443039 4180fd01 752e 4b8b84f900a20b00 8a4c303a 413ac8 }
            // n = 7, score = 100
            //   458d60f8             | inc                 ebp
            //   4488443039           | lea                 esp, [eax - 8]
            //   4180fd01             | inc                 esp
            //   752e                 | mov                 byte ptr [eax + esi + 0x39], al
            //   4b8b84f900a20b00     | inc                 ecx
            //   8a4c303a             | cmp                 ch, 1
            //   413ac8               | jne                 0x30

        $sequence_9 = { 4055 4883ec60 488bea 488b8d00010000 4885c9 741e }
            // n = 6, score = 100
            //   4055                 | inc                 ecx
            //   4883ec60             | or                  eax, eax
            //   488bea               | dec                 eax
            //   488b8d00010000       | lea                 edx, [esp + 0x58]
            //   4885c9               | dec                 eax
            //   741e                 | lea                 ecx, [0xb21b3]

        $sequence_10 = { 488b8c24b0000000 ff15???????? 8bd8 85c0 7848 488b8c24b0000000 }
            // n = 6, score = 100
            //   488b8c24b0000000     | lea                 ecx, [0xffff0f05]
            //   ff15????????         |                     
            //   8bd8                 | inc                 ebp
            //   85c0                 | mov                 ah, byte ptr [eax]
            //   7848                 | inc                 ebp
            //   488b8c24b0000000     | test                ah, ah

        $sequence_11 = { 7539 410bc0 488d542458 488d0db3210b00 8905???????? 488d05a61e0100 }
            // n = 6, score = 100
            //   7539                 | dec                 eax
            //   410bc0               | lea                 eax, [0xa975d]
            //   488d542458           | dec                 eax
            //   488d0db3210b00       | add                 edi, 8
            //   8905????????         |                     
            //   488d05a61e0100       | dec                 eax

        $sequence_12 = { 448be0 85c0 0f844e010000 488b4c2450 488364242000 488d055d970a00 }
            // n = 6, score = 100
            //   448be0               | dec                 eax
            //   85c0                 | arpl                cx, bx
            //   0f844e010000         | dec                 eax
            //   488b4c2450           | lea                 ebp, [0xa507f]
            //   488364242000         | dec                 eax
            //   488d055d970a00       | mov                 edi, ebx

        $sequence_13 = { e8???????? 4883c708 4883ff38 7cc2 488b0e }
            // n = 5, score = 100
            //   e8????????           |                     
            //   4883c708             | and                 ebx, 0x1f
            //   4883ff38             | dec                 eax
            //   7cc2                 | sar                 edi, 5
            //   488b0e               | inc                 esp

        $sequence_14 = { 488bcf e8???????? 85c0 7442 488d15726b0000 }
            // n = 5, score = 100
            //   488bcf               | cmp                 edi, 0x38
            //   e8????????           |                     
            //   85c0                 | jl                  0xffffffe4
            //   7442                 | dec                 eax
            //   488d15726b0000       | mov                 ecx, dword ptr [esi]

        $sequence_15 = { 7404 66458918 33c0 e9???????? 458bd3 44895c2404 }
            // n = 6, score = 100
            //   7404                 | dec                 eax
            //   66458918             | lea                 edx, [0x155cb]
            //   33c0                 | dec                 eax
            //   e9????????           |                     
            //   458bd3               | mov                 ecx, ebx
            //   44895c2404           | jne                 0x4f

        $sequence_16 = { 0fb74c3c40 8d41bf 6683f819 7704 6683c120 }
            // n = 5, score = 100
            //   0fb74c3c40           | dec                 eax
            //   8d41bf               | lea                 eax, [0x11ea6]
            //   6683f819             | dec                 eax
            //   7704                 | mov                 ecx, edi
            //   6683c120             | test                eax, eax

        $sequence_17 = { 42813c39eb06881d 740b ffc0 8bc8 483bca 72ed eb2d }
            // n = 7, score = 100
            //   42813c39eb06881d     | inc                 ebp
            //   740b                 | dec                 eax
            //   ffc0                 | lea                 edx, [0xf27c]
            //   8bc8                 | dec                 eax
            //   483bca               | mov                 ecx, ebp
            //   72ed                 | dec                 esp
            //   eb2d                 | mov                 eax, dword ptr [esp + 0x68]

        $sequence_18 = { 4889442420 41b901000000 4533c0 488d542440 }
            // n = 4, score = 100
            //   4889442420           | je                  0x46
            //   41b901000000         | dec                 eax
            //   4533c0               | lea                 edx, [0x6b72]
            //   488d542440           | dec                 eax

        $sequence_19 = { 7e22 48897b18 48897310 408833 4533c0 488d15cb550100 488bcb }
            // n = 7, score = 100
            //   7e22                 | mov                 esp, eax
            //   48897b18             | test                eax, eax
            //   48897310             | je                  0x154
            //   408833               | dec                 eax
            //   4533c0               | mov                 ecx, dword ptr [esp + 0x50]
            //   488d15cb550100       | dec                 eax
            //   488bcb               | and                 dword ptr [esp + 0x20], 0

        $sequence_20 = { c7459f30000000 c745a338000000 48c745a742000042 895dbf }
            // n = 4, score = 100
            //   c7459f30000000       | mov                 edx, dword ptr [esp + 0x60]
            //   c745a338000000       | inc                 ecx
            //   48c745a742000042     | mov                 ebx, 0x200
            //   895dbf               | dec                 esp

        $sequence_21 = { 85c0 0f8457010000 488bcf ff15???????? }
            // n = 4, score = 100
            //   85c0                 | je                  6
            //   0f8457010000         | inc                 bp
            //   488bcf               | mov                 dword ptr [eax], ebx
            //   ff15????????         |                     

        $sequence_22 = { 48ffc5 488d157cf20000 488bcd e8???????? }
            // n = 4, score = 100
            //   48ffc5               | jle                 0x24
            //   488d157cf20000       | dec                 eax
            //   488bcd               | mov                 dword ptr [ebx + 0x18], edi
            //   e8????????           |                     

        $sequence_23 = { 3b0d???????? 7369 4863d9 488d2d7f500a00 488bfb 83e31f 48c1ff05 }
            // n = 7, score = 100
            //   3b0d????????         |                     
            //   7369                 | dec                 ebx
            //   4863d9               | mov                 eax, dword ptr [ecx + edi*8 + 0xba200]
            //   488d2d7f500a00       | mov                 cl, byte ptr [eax + esi + 0x3a]
            //   488bfb               | inc                 ecx
            //   83e31f               | cmp                 cl, al
            //   48c1ff05             | jae                 0x6b

    condition:
        7 of them and filesize < 1581056
}