rule win_collectorgoomba_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        version = "1"
        description = "Detects win.collectorgoomba."
        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.collectorgoomba"
        malpedia_rule_date = "20260422"
        malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14"
        malpedia_version = "20260504"
        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 = { ff75f8 8b4508 ff7050 6a00 ff7508 e8???????? 83c410 }
            // n = 7, score = 200
            //   ff75f8               | push                dword ptr [ebp - 8]
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   ff7050               | push                dword ptr [eax + 0x50]
            //   6a00                 | push                0
            //   ff7508               | push                dword ptr [ebp + 8]
            //   e8????????           |                     
            //   83c410               | add                 esp, 0x10

        $sequence_1 = { ff5590 83c40c 8b4508 8b4010 c1e810 25ff000000 8845f4 }
            // n = 7, score = 200
            //   ff5590               | call                dword ptr [ebp - 0x70]
            //   83c40c               | add                 esp, 0xc
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   8b4010               | mov                 eax, dword ptr [eax + 0x10]
            //   c1e810               | shr                 eax, 0x10
            //   25ff000000           | and                 eax, 0xff
            //   8845f4               | mov                 byte ptr [ebp - 0xc], al

        $sequence_2 = { f7d8 8b4dfc 894114 eb31 8b45fc c6401c00 8b45fc }
            // n = 7, score = 200
            //   f7d8                 | neg                 eax
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   894114               | mov                 dword ptr [ecx + 0x14], eax
            //   eb31                 | jmp                 0x33
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   c6401c00             | mov                 byte ptr [eax + 0x1c], 0
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]

        $sequence_3 = { ff750c ff75f8 e8???????? 59 59 50 8b45fc }
            // n = 7, score = 200
            //   ff750c               | push                dword ptr [ebp + 0xc]
            //   ff75f8               | push                dword ptr [ebp - 8]
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   59                   | pop                 ecx
            //   50                   | push                eax
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]

        $sequence_4 = { ff7598 ff750c ff7508 e8???????? 83c40c 6b451028 8b4d0c }
            // n = 7, score = 200
            //   ff7598               | push                dword ptr [ebp - 0x68]
            //   ff750c               | push                dword ptr [ebp + 0xc]
            //   ff7508               | push                dword ptr [ebp + 8]
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   6b451028             | imul                eax, dword ptr [ebp + 0x10], 0x28
            //   8b4d0c               | mov                 ecx, dword ptr [ebp + 0xc]

        $sequence_5 = { ff75f0 e8???????? 59 8945d8 837de410 7246 8b45fc }
            // n = 7, score = 200
            //   ff75f0               | push                dword ptr [ebp - 0x10]
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   8945d8               | mov                 dword ptr [ebp - 0x28], eax
            //   837de410             | cmp                 dword ptr [ebp - 0x1c], 0x10
            //   7246                 | jb                  0x48
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]

        $sequence_6 = { 8b45f0 8b4dfc 8d44c108 50 ff15???????? 83c40c 8b450c }
            // n = 7, score = 200
            //   8b45f0               | mov                 eax, dword ptr [ebp - 0x10]
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   8d44c108             | lea                 eax, [ecx + eax*8 + 8]
            //   50                   | push                eax
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   8b450c               | mov                 eax, dword ptr [ebp + 0xc]

        $sequence_7 = { c705????????080d0a0a c705????????03020a06 c705????????030b0208 833d????????00 740a c705????????000f0903 c705????????08000a07 }
            // n = 7, score = 200
            //   c705????????080d0a0a     |     
            //   c705????????03020a06     |     
            //   c705????????030b0208     |     
            //   833d????????00       |                     
            //   740a                 | je                  0xc
            //   c705????????000f0903     |     
            //   c705????????08000a07     |     

        $sequence_8 = { ff15???????? 59 85c0 7402 ebe2 8b4508 0345fc }
            // n = 7, score = 200
            //   ff15????????         |                     
            //   59                   | pop                 ecx
            //   85c0                 | test                eax, eax
            //   7402                 | je                  4
            //   ebe2                 | jmp                 0xffffffe4
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   0345fc               | add                 eax, dword ptr [ebp - 4]

        $sequence_9 = { ffb57cffffff 68???????? ff75f4 e8???????? 83c414 8945a4 eb04 }
            // n = 7, score = 200
            //   ffb57cffffff         | push                dword ptr [ebp - 0x84]
            //   68????????           |                     
            //   ff75f4               | push                dword ptr [ebp - 0xc]
            //   e8????????           |                     
            //   83c414               | add                 esp, 0x14
            //   8945a4               | mov                 dword ptr [ebp - 0x5c], eax
            //   eb04                 | jmp                 6

    condition:
        7 of them and filesize < 1400832
}