rule win_catchamas_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.catchamas."
        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.catchamas"
        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 = { ff15???????? 83c42c e9???????? ffd6 8b0d???????? }
            // n = 5, score = 200
            //   ff15????????         |                     
            //   83c42c               | add                 esp, 0x2c
            //   e9????????           |                     
            //   ffd6                 | call                esi
            //   8b0d????????         |                     

        $sequence_1 = { 43 3b5c2410 7c86 5e 5d 57 ff15???????? }
            // n = 7, score = 200
            //   43                   | inc                 ebx
            //   3b5c2410             | cmp                 ebx, dword ptr [esp + 0x10]
            //   7c86                 | jl                  0xffffff88
            //   5e                   | pop                 esi
            //   5d                   | pop                 ebp
            //   57                   | push                edi
            //   ff15????????         |                     

        $sequence_2 = { 7722 0fb68878124000 ff248d68124000 680e000780 e8???????? 6857000780 }
            // n = 6, score = 200
            //   7722                 | ja                  0x24
            //   0fb68878124000       | movzx               ecx, byte ptr [eax + 0x401278]
            //   ff248d68124000       | jmp                 dword ptr [ecx*4 + 0x401268]
            //   680e000780           | push                0x8007000e
            //   e8????????           |                     
            //   6857000780           | push                0x80070057

        $sequence_3 = { ff15???????? 56 8be8 55 53 57 ff15???????? }
            // n = 7, score = 200
            //   ff15????????         |                     
            //   56                   | push                esi
            //   8be8                 | mov                 ebp, eax
            //   55                   | push                ebp
            //   53                   | push                ebx
            //   57                   | push                edi
            //   ff15????????         |                     

        $sequence_4 = { 53 8b1d???????? 56 57 683f000f00 }
            // n = 5, score = 200
            //   53                   | push                ebx
            //   8b1d????????         |                     
            //   56                   | push                esi
            //   57                   | push                edi
            //   683f000f00           | push                0xf003f

        $sequence_5 = { 5b 8b8c241c010000 33cc e8???????? 81c42c010000 c3 }
            // n = 6, score = 200
            //   5b                   | pop                 ebx
            //   8b8c241c010000       | mov                 ecx, dword ptr [esp + 0x11c]
            //   33cc                 | xor                 ecx, esp
            //   e8????????           |                     
            //   81c42c010000         | add                 esp, 0x12c
            //   c3                   | ret                 

        $sequence_6 = { a4 894c2420 ff15???????? 837c241000 751e 53 }
            // n = 6, score = 200
            //   a4                   | movsb               byte ptr es:[edi], byte ptr [esi]
            //   894c2420             | mov                 dword ptr [esp + 0x20], ecx
            //   ff15????????         |                     
            //   837c241000           | cmp                 dword ptr [esp + 0x10], 0
            //   751e                 | jne                 0x20
            //   53                   | push                ebx

        $sequence_7 = { 8b10 8bc8 8b420c ffd0 8bc8 8b442418 }
            // n = 6, score = 200
            //   8b10                 | mov                 edx, dword ptr [eax]
            //   8bc8                 | mov                 ecx, eax
            //   8b420c               | mov                 eax, dword ptr [edx + 0xc]
            //   ffd0                 | call                eax
            //   8bc8                 | mov                 ecx, eax
            //   8b442418             | mov                 eax, dword ptr [esp + 0x18]

        $sequence_8 = { 6808080000 8d54246c 52 51 ffd7 }
            // n = 5, score = 200
            //   6808080000           | push                0x808
            //   8d54246c             | lea                 edx, [esp + 0x6c]
            //   52                   | push                edx
            //   51                   | push                ecx
            //   ffd7                 | call                edi

        $sequence_9 = { e8???????? 8b45dc 6a00 8d4de8 51 57 }
            // n = 6, score = 200
            //   e8????????           |                     
            //   8b45dc               | mov                 eax, dword ptr [ebp - 0x24]
            //   6a00                 | push                0
            //   8d4de8               | lea                 ecx, [ebp - 0x18]
            //   51                   | push                ecx
            //   57                   | push                edi

    condition:
        7 of them and filesize < 368640
}