rule win_makop_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.makop."
        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.makop"
        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 = { 56 e8???????? a1???????? 8b3d???????? 83c40c }
            // n = 5, score = 100
            //   56                   | push                esi
            //   e8????????           |                     
            //   a1????????           |                     
            //   8b3d????????         |                     
            //   83c40c               | add                 esp, 0xc

        $sequence_1 = { e9???????? 8b0d???????? 8b09 85c9 8bd1 743b 8b4204 }
            // n = 7, score = 100
            //   e9????????           |                     
            //   8b0d????????         |                     
            //   8b09                 | mov                 ecx, dword ptr [ecx]
            //   85c9                 | test                ecx, ecx
            //   8bd1                 | mov                 edx, ecx
            //   743b                 | je                  0x3d
            //   8b4204               | mov                 eax, dword ptr [edx + 4]

        $sequence_2 = { 8d4c2414 51 8d54241c 52 ffd6 85c0 0f841c010000 }
            // n = 7, score = 100
            //   8d4c2414             | lea                 ecx, [esp + 0x14]
            //   51                   | push                ecx
            //   8d54241c             | lea                 edx, [esp + 0x1c]
            //   52                   | push                edx
            //   ffd6                 | call                esi
            //   85c0                 | test                eax, eax
            //   0f841c010000         | je                  0x122

        $sequence_3 = { 53 66891f 895f10 895f14 894718 c7471c04000000 ff15???????? }
            // n = 7, score = 100
            //   53                   | push                ebx
            //   66891f               | mov                 word ptr [edi], bx
            //   895f10               | mov                 dword ptr [edi + 0x10], ebx
            //   895f14               | mov                 dword ptr [edi + 0x14], ebx
            //   894718               | mov                 dword ptr [edi + 0x18], eax
            //   c7471c04000000       | mov                 dword ptr [edi + 0x1c], 4
            //   ff15????????         |                     

        $sequence_4 = { 8b542418 8b44241c 33c9 899648080000 8b542420 }
            // n = 5, score = 100
            //   8b542418             | mov                 edx, dword ptr [esp + 0x18]
            //   8b44241c             | mov                 eax, dword ptr [esp + 0x1c]
            //   33c9                 | xor                 ecx, ecx
            //   899648080000         | mov                 dword ptr [esi + 0x848], edx
            //   8b542420             | mov                 edx, dword ptr [esp + 0x20]

        $sequence_5 = { 33c0 8d4c2414 51 a3???????? a1???????? 6a02 e8???????? }
            // n = 7, score = 100
            //   33c0                 | xor                 eax, eax
            //   8d4c2414             | lea                 ecx, [esp + 0x14]
            //   51                   | push                ecx
            //   a3????????           |                     
            //   a1????????           |                     
            //   6a02                 | push                2
            //   e8????????           |                     

        $sequence_6 = { 51 6a10 52 53 ffd6 85c0 }
            // n = 6, score = 100
            //   51                   | push                ecx
            //   6a10                 | push                0x10
            //   52                   | push                edx
            //   53                   | push                ebx
            //   ffd6                 | call                esi
            //   85c0                 | test                eax, eax

        $sequence_7 = { 740f 85db 740b 837c242000 7404 85c0 }
            // n = 6, score = 100
            //   740f                 | je                  0x11
            //   85db                 | test                ebx, ebx
            //   740b                 | je                  0xd
            //   837c242000           | cmp                 dword ptr [esp + 0x20], 0
            //   7404                 | je                  6
            //   85c0                 | test                eax, eax

        $sequence_8 = { 66c74424423200 6689542444 66894c2448 66c744244a7300 }
            // n = 4, score = 100
            //   66c74424423200       | mov                 word ptr [esp + 0x42], 0x32
            //   6689542444           | mov                 word ptr [esp + 0x44], dx
            //   66894c2448           | mov                 word ptr [esp + 0x48], cx
            //   66c744244a7300       | mov                 word ptr [esp + 0x4a], 0x73

        $sequence_9 = { 6a08 8d4cf808 51 8d542418 52 e8???????? 0fb744241c }
            // n = 7, score = 100
            //   6a08                 | push                8
            //   8d4cf808             | lea                 ecx, [eax + edi*8 + 8]
            //   51                   | push                ecx
            //   8d542418             | lea                 edx, [esp + 0x18]
            //   52                   | push                edx
            //   e8????????           |                     
            //   0fb744241c           | movzx               eax, word ptr [esp + 0x1c]

    condition:
        7 of them and filesize < 107520
}