rule win_dyepack_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.dyepack."
        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.dyepack"
        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 = { 2bcd 1bc7 7815 7f08 81f900100000 760b }
            // n = 6, score = 300
            //   2bcd                 | sub                 ecx, ebp
            //   1bc7                 | sbb                 eax, edi
            //   7815                 | js                  0x17
            //   7f08                 | jg                  0xa
            //   81f900100000         | cmp                 ecx, 0x1000
            //   760b                 | jbe                 0xd

        $sequence_1 = { 6a03 53 aa 8b842434100000 }
            // n = 4, score = 300
            //   6a03                 | push                3
            //   53                   | push                ebx
            //   aa                   | stosb               byte ptr es:[edi], al
            //   8b842434100000       | mov                 eax, dword ptr [esp + 0x1034]

        $sequence_2 = { 33db b9ff030000 33c0 8d7c2421 885c2420 f3ab }
            // n = 6, score = 300
            //   33db                 | xor                 ebx, ebx
            //   b9ff030000           | mov                 ecx, 0x3ff
            //   33c0                 | xor                 eax, eax
            //   8d7c2421             | lea                 edi, [esp + 0x21]
            //   885c2420             | mov                 byte ptr [esp + 0x20], bl
            //   f3ab                 | rep stosd           dword ptr es:[edi], eax

        $sequence_3 = { 52 8d44242c 51 50 56 ff15???????? }
            // n = 6, score = 300
            //   52                   | push                edx
            //   8d44242c             | lea                 eax, [esp + 0x2c]
            //   51                   | push                ecx
            //   50                   | push                eax
            //   56                   | push                esi
            //   ff15????????         |                     

        $sequence_4 = { 8b3d???????? 55 6a02 53 6aff 56 ffd7 }
            // n = 7, score = 300
            //   8b3d????????         |                     
            //   55                   | push                ebp
            //   6a02                 | push                2
            //   53                   | push                ebx
            //   6aff                 | push                -1
            //   56                   | push                esi
            //   ffd7                 | call                edi

        $sequence_5 = { 56 ffd7 8d4c2418 53 51 8d54242c }
            // n = 6, score = 300
            //   56                   | push                esi
            //   ffd7                 | call                edi
            //   8d4c2418             | lea                 ecx, [esp + 0x18]
            //   53                   | push                ebx
            //   51                   | push                ecx
            //   8d54242c             | lea                 edx, [esp + 0x2c]

        $sequence_6 = { b814100000 e8???????? 53 56 57 33db }
            // n = 6, score = 300
            //   b814100000           | mov                 eax, 0x1014
            //   e8????????           |                     
            //   53                   | push                ebx
            //   56                   | push                esi
            //   57                   | push                edi
            //   33db                 | xor                 ebx, ebx

        $sequence_7 = { ff15???????? 53 53 53 56 ffd7 }
            // n = 6, score = 300
            //   ff15????????         |                     
            //   53                   | push                ebx
            //   53                   | push                ebx
            //   53                   | push                ebx
            //   56                   | push                esi
            //   ffd7                 | call                edi

        $sequence_8 = { ff15???????? 56 ff15???????? 8d442410 895c2410 }
            // n = 5, score = 300
            //   ff15????????         |                     
            //   56                   | push                esi
            //   ff15????????         |                     
            //   8d442410             | lea                 eax, [esp + 0x10]
            //   895c2410             | mov                 dword ptr [esp + 0x10], ebx

        $sequence_9 = { 8d542418 53 52 8d44242c 51 }
            // n = 5, score = 300
            //   8d542418             | lea                 edx, [esp + 0x18]
            //   53                   | push                ebx
            //   52                   | push                edx
            //   8d44242c             | lea                 eax, [esp + 0x2c]
            //   51                   | push                ecx

    condition:
        7 of them and filesize < 212992
}