rule win_gcleaner_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.gcleaner."
        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.gcleaner"
        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 = { 50 ffb5f0feffff 56 ff15???????? }
            // n = 4, score = 700
            //   50                   | push                eax
            //   ffb5f0feffff         | push                dword ptr [ebp - 0x110]
            //   56                   | push                esi
            //   ff15????????         |                     

        $sequence_1 = { 66a1???????? f30f7e05???????? 68fa000000 66898500ffffff }
            // n = 4, score = 700
            //   66a1????????         |                     
            //   f30f7e05????????     |                     
            //   68fa000000           | push                0xfa
            //   66898500ffffff       | mov                 word ptr [ebp - 0x100], ax

        $sequence_2 = { 2bfb eb03 83cfff 3bf7 }
            // n = 4, score = 700
            //   2bfb                 | sub                 edi, ebx
            //   eb03                 | jmp                 5
            //   83cfff               | or                  edi, 0xffffffff
            //   3bf7                 | cmp                 esi, edi

        $sequence_3 = { 85f6 7416 56 6a2f 53 e8???????? 8bf8 }
            // n = 7, score = 700
            //   85f6                 | test                esi, esi
            //   7416                 | je                  0x18
            //   56                   | push                esi
            //   6a2f                 | push                0x2f
            //   53                   | push                ebx
            //   e8????????           |                     
            //   8bf8                 | mov                 edi, eax

        $sequence_4 = { 83c410 8d4dc0 e8???????? 8d4da8 e8???????? }
            // n = 5, score = 700
            //   83c410               | add                 esp, 0x10
            //   8d4dc0               | lea                 ecx, [ebp - 0x40]
            //   e8????????           |                     
            //   8d4da8               | lea                 ecx, [ebp - 0x58]
            //   e8????????           |                     

        $sequence_5 = { 6a2f 53 e8???????? 8bf8 83c40c 85ff 7404 }
            // n = 7, score = 700
            //   6a2f                 | push                0x2f
            //   53                   | push                ebx
            //   e8????????           |                     
            //   8bf8                 | mov                 edi, eax
            //   83c40c               | add                 esp, 0xc
            //   85ff                 | test                edi, edi
            //   7404                 | je                  6

        $sequence_6 = { 89b5f4feffff ff15???????? 8bf8 85ff 741c 6804010000 }
            // n = 6, score = 700
            //   89b5f4feffff         | mov                 dword ptr [ebp - 0x10c], esi
            //   ff15????????         |                     
            //   8bf8                 | mov                 edi, eax
            //   85ff                 | test                edi, edi
            //   741c                 | je                  0x1e
            //   6804010000           | push                0x104

        $sequence_7 = { 6804010000 8d85f8feffff 50 ffb5f0feffff 56 ff15???????? 56 }
            // n = 7, score = 700
            //   6804010000           | push                0x104
            //   8d85f8feffff         | lea                 eax, [ebp - 0x108]
            //   50                   | push                eax
            //   ffb5f0feffff         | push                dword ptr [ebp - 0x110]
            //   56                   | push                esi
            //   ff15????????         |                     
            //   56                   | push                esi

        $sequence_8 = { 89bdf0feffff 66a1???????? f30f7e05???????? 68fa000000 66898500ffffff 8d8502ffffff 6a00 }
            // n = 7, score = 700
            //   89bdf0feffff         | mov                 dword ptr [ebp - 0x110], edi
            //   66a1????????         |                     
            //   f30f7e05????????     |                     
            //   68fa000000           | push                0xfa
            //   66898500ffffff       | mov                 word ptr [ebp - 0x100], ax
            //   8d8502ffffff         | lea                 eax, [ebp - 0xfe]
            //   6a00                 | push                0

        $sequence_9 = { 52 50 ff5110 c645fc00 8bf8 }
            // n = 5, score = 700
            //   52                   | push                edx
            //   50                   | push                eax
            //   ff5110               | call                dword ptr [ecx + 0x10]
            //   c645fc00             | mov                 byte ptr [ebp - 4], 0
            //   8bf8                 | mov                 edi, eax

    condition:
        7 of them and filesize < 540672
}