rule win_graphican_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.graphican."
        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.graphican"
        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 = { c1e105 034e08 3bd9 7411 8b4508 e8???????? 84c0 }
            // n = 7, score = 200
            //   c1e105               | shl                 ecx, 5
            //   034e08               | add                 ecx, dword ptr [esi + 8]
            //   3bd9                 | cmp                 ebx, ecx
            //   7411                 | je                  0x13
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   e8????????           |                     
            //   84c0                 | test                al, al

        $sequence_1 = { 83c104 4a 75d7 33db 895dfc 85ff }
            // n = 6, score = 200
            //   83c104               | add                 ecx, 4
            //   4a                   | dec                 edx
            //   75d7                 | jne                 0xffffffd9
            //   33db                 | xor                 ebx, ebx
            //   895dfc               | mov                 dword ptr [ebp - 4], ebx
            //   85ff                 | test                edi, edi

        $sequence_2 = { e8???????? 83c40c 53 e8???????? 83c404 83c710 }
            // n = 6, score = 200
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   53                   | push                ebx
            //   e8????????           |                     
            //   83c404               | add                 esp, 4
            //   83c710               | add                 edi, 0x10

        $sequence_3 = { 8d04c2 894c8608 8b86d0030000 2b45ec 8d0cc2 }
            // n = 5, score = 200
            //   8d04c2               | lea                 eax, [edx + eax*8]
            //   894c8608             | mov                 dword ptr [esi + eax*4 + 8], ecx
            //   8b86d0030000         | mov                 eax, dword ptr [esi + 0x3d0]
            //   2b45ec               | sub                 eax, dword ptr [ebp - 0x14]
            //   8d0cc2               | lea                 ecx, [edx + eax*8]

        $sequence_4 = { 8d55c8 52 68???????? 57 ffd0 85c0 7837 }
            // n = 7, score = 200
            //   8d55c8               | lea                 edx, [ebp - 0x38]
            //   52                   | push                edx
            //   68????????           |                     
            //   57                   | push                edi
            //   ffd0                 | call                eax
            //   85c0                 | test                eax, eax
            //   7837                 | js                  0x39

        $sequence_5 = { 3c45 0f8570010000 47 807def00 }
            // n = 4, score = 200
            //   3c45                 | cmp                 al, 0x45
            //   0f8570010000         | jne                 0x176
            //   47                   | inc                 edi
            //   807def00             | cmp                 byte ptr [ebp - 0x11], 0

        $sequence_6 = { 50 68???????? 6a00 e8???????? 8bc8 83c418 }
            // n = 6, score = 200
            //   50                   | push                eax
            //   68????????           |                     
            //   6a00                 | push                0
            //   e8????????           |                     
            //   8bc8                 | mov                 ecx, eax
            //   83c418               | add                 esp, 0x18

        $sequence_7 = { 6876060000 68???????? 68???????? e8???????? 83c40c 833e00 }
            // n = 6, score = 200
            //   6876060000           | push                0x676
            //   68????????           |                     
            //   68????????           |                     
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   833e00               | cmp                 dword ptr [esi], 0

        $sequence_8 = { e8???????? 395f18 0f85cd000000 8bff 8b0e 8b5604 43 }
            // n = 7, score = 200
            //   e8????????           |                     
            //   395f18               | cmp                 dword ptr [edi + 0x18], ebx
            //   0f85cd000000         | jne                 0xd3
            //   8bff                 | mov                 edi, edi
            //   8b0e                 | mov                 ecx, dword ptr [esi]
            //   8b5604               | mov                 edx, dword ptr [esi + 4]
            //   43                   | inc                 ebx

        $sequence_9 = { 8bcb 8bd6 e8???????? 83c404 8bf0 }
            // n = 5, score = 200
            //   8bcb                 | mov                 ecx, ebx
            //   8bd6                 | mov                 edx, esi
            //   e8????????           |                     
            //   83c404               | add                 esp, 4
            //   8bf0                 | mov                 esi, eax

    condition:
        7 of them and filesize < 362496
}