rule win_graphdrop_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.graphdrop."
        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.graphdrop"
        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 = { 52 50 58 5a 49ffc9 }
            // n = 5, score = 300
            //   52                   | inc                 ecx
            //   50                   | push                edx
            //   58                   | psrlq               mm4, 0x1e
            //   5a                   | inc                 esp
            //   49ffc9               | mov                 edx, eax

        $sequence_1 = { 53 0f77 5b 90 }
            // n = 4, score = 300
            //   53                   | dec                 eax
            //   0f77                 | add                 eax, 1
            //   5b                   | dec                 eax
            //   90                   | mov                 ecx, dword ptr [esp + 0x38]

        $sequence_2 = { 52 90 5a 0f77 }
            // n = 4, score = 300
            //   52                   | dec                 eax
            //   90                   | mov                 ecx, dword ptr [esp + 0x38]
            //   5a                   | dec                 eax
            //   0f77                 | mov                 dword ptr [ecx], eax

        $sequence_3 = { 49c7c501000000 4150 4152 415a 4158 }
            // n = 5, score = 300
            //   49c7c501000000       | mov                 dword ptr [esp + 0x34], eax
            //   4150                 | mov                 ebx, 0x24
            //   4152                 | mov                 eax, 0x300
            //   415a                 | inc                 ecx
            //   4158                 | mov                 esi, eax

        $sequence_4 = { 4152 415a 4158 49ffcd }
            // n = 4, score = 300
            //   4152                 | movlhps             xmm1, xmm3
            //   415a                 | pop                 eax
            //   4158                 | pxor                mm6, mm1
            //   49ffcd               | inc                 ecx

        $sequence_5 = { 90 415f 90 415d }
            // n = 4, score = 300
            //   90                   | dec                 eax
            //   415f                 | mov                 eax, edx
            //   90                   | dec                 esp
            //   415d                 | mov                 edi, edx

        $sequence_6 = { 49c7c501000000 4150 4152 415a }
            // n = 4, score = 300
            //   49c7c501000000       | mov                 ecx, 0xffff
            //   4150                 | inc                 cx
            //   4152                 | cmp                 eax, ecx
            //   415a                 | dec                 eax

        $sequence_7 = { 90 0f77 415c e9???????? }
            // n = 4, score = 300
            //   90                   | mov                 eax, 0x23
            //   0f77                 | dec                 eax
            //   415c                 | lea                 edx, [0x10e1c4]
            //   e9????????           |                     

        $sequence_8 = { 52 4156 415e 5a }
            // n = 4, score = 300
            //   52                   | mov                 dword ptr [esp + 0x24], eax
            //   4156                 | dec                 eax
            //   415e                 | mov                 ecx, dword ptr [esp + 0x30]
            //   5a                   | dec                 eax

        $sequence_9 = { 4155 49c7c501000000 4150 4152 415a 4158 49ffcd }
            // n = 7, score = 300
            //   4155                 | lea                 eax, [ebp + 0xb0]
            //   49c7c501000000       | dec                 eax
            //   4150                 | mov                 dword ptr [eax + 0x28], ecx
            //   4152                 | dec                 eax
            //   415a                 | lea                 ecx, [ebp + 0x760]
            //   4158                 | dec                 eax
            //   49ffcd               | mov                 dword ptr [eax + 0x20], ecx

    condition:
        7 of them and filesize < 4186112
}