rule win_touchmove_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.touchmove."
        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.touchmove"
        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 = { 90 c6859000000000 33d2 41b800020000 }
            // n = 4, score = 100
            //   90                   | mov                 dword ptr [esp + 0x28], eax
            //   c6859000000000       | dec                 eax
            //   33d2                 | lea                 eax, [0x11d3c]
            //   41b800020000         | dec                 eax

        $sequence_1 = { e8???????? 488d8d361a0000 33d2 660f6f2d???????? }
            // n = 4, score = 100
            //   e8????????           |                     
            //   488d8d361a0000       | mov                 ecx, ebx
            //   33d2                 | dec                 eax
            //   660f6f2d????????     |                     

        $sequence_2 = { 4889442430 488d8580450000 4889442428 488d8580440000 4889442420 4c8d8d80460000 4c8d8580480000 }
            // n = 7, score = 100
            //   4889442430           | dec                 eax
            //   488d8580450000       | lea                 edx, [ebp + 0x2920]
            //   4889442428           | dec                 eax
            //   488d8580440000       | mov                 ecx, ebx
            //   4889442420           | dec                 eax
            //   4c8d8d80460000       | lea                 edx, [ebp + 0x220]
            //   4c8d8580480000       | dec                 eax

        $sequence_3 = { e8???????? 482be0 0f29b424302b0000 488b05???????? 4833c4 488985202a0000 488d8d2d0a0000 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   482be0               | nop                 dword ptr [eax + eax]
            //   0f29b424302b0000     | xor                 ecx, ecx
            //   488b05????????       |                     
            //   4833c4               | dec                 ecx
            //   488985202a0000       | mov                 edx, edx
            //   488d8d2d0a0000       | inc                 ecx

        $sequence_4 = { 4889442428 488d8580450000 4889442420 4533c9 }
            // n = 4, score = 100
            //   4889442428           | inc                 ebp
            //   488d8580450000       | xor                 ecx, ecx
            //   4889442420           | inc                 ebp
            //   4533c9               | mov                 eax, esi

        $sequence_5 = { 660f6f2d???????? 660f7fad80420000 66c785904200006e00 33d2 41b8ee000000 }
            // n = 5, score = 100
            //   660f6f2d????????     |                     
            //   660f7fad80420000     | mov                 ecx, 4
            //   66c785904200006e00     | dec    ebp
            //   33d2                 | mov                 eax, esp
            //   41b8ee000000         | inc                 ecx

        $sequence_6 = { e8???????? eb0d 4c8d0d3af90000 e8???????? 90 33db 66899c2450010000 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   eb0d                 | dec                 esp
            //   4c8d0d3af90000       | lea                 eax, [0xf735]
            //   e8????????           |                     
            //   90                   | dec                 eax
            //   33db                 | mov                 eax, dword ptr [esp + 0x40]
            //   66899c2450010000     | inc                 ecx

        $sequence_7 = { 4885c0 7509 488d051bfd0000 eb04 4883c014 4883c428 c3 }
            // n = 7, score = 100
            //   4885c0               | add                 byte ptr [ebx + 0x65], ch
            //   7509                 | jb                  0x7b
            //   488d051bfd0000       | mov                 dword ptr [ebp + 0xa24], 0x32336c65
            //   eb04                 | mov                 dword ptr [ebp + 0xa28], 0x6c6c642e
            //   4883c014             | dec                 eax
            //   4883c428             | lea                 ecx, [ebp + 0xb2d]
            //   c3                   | xor                 edx, edx

        $sequence_8 = { e8???????? 90 c6859000000000 33d2 41b800020000 }
            // n = 5, score = 100
            //   e8????????           |                     
            //   90                   | lea                 ecx, [ebp + 0xa2d]
            //   c6859000000000       | xor                 edx, edx
            //   33d2                 | inc                 ecx
            //   41b800020000         | mov                 eax, 0xf3

        $sequence_9 = { 66f3ab 488d3dda030100 482bfd 8a041f }
            // n = 4, score = 100
            //   66f3ab               | dec                 eax
            //   488d3dda030100       | mov                 eax, ebp
            //   482bfd               | and                 ebp, 0x1f
            //   8a041f               | dec                 eax

    condition:
        7 of them and filesize < 224256
}