rule win_shortleash_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.shortleash."
        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.shortleash"
        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 = { e8???????? 894304 488b8fb0000000 e8???????? 448b4304 8b13 488b08 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   894304               | dec                 eax
            //   488b8fb0000000       | mov                 dword ptr [ebx + 8], ecx
            //   e8????????           |                     
            //   448b4304             | dec                 eax
            //   8b13                 | mov                 dword ptr [ebx], eax
            //   488b08               | dec                 eax

        $sequence_1 = { c3 488d4c2450 e8???????? 4c8d4c2430 41b843000000 488d1504b40500 488d0d05b40500 }
            // n = 7, score = 100
            //   c3                   | lea                 ecx, [esp + 0x20]
            //   488d4c2450           | test                eax, eax
            //   e8????????           |                     
            //   4c8d4c2430           | jne                 0x8d8
            //   41b843000000         | dec                 ebp
            //   488d1504b40500       | mov                 eax, ebp
            //   488d0d05b40500       | dec                 eax

        $sequence_2 = { c1e81d 488bda 41c1e003 488d1515a40500 440bc0 428d0ccd00000000 4488442424 }
            // n = 7, score = 100
            //   c1e81d               | dec                 esp
            //   488bda               | lea                 ebx, [esp + 0x60]
            //   41c1e003             | dec                 eax
            //   488d1515a40500       | mov                 eax, esi
            //   440bc0               | dec                 ecx
            //   428d0ccd00000000     | mov                 ebx, dword ptr [ebx + 0x10]
            //   4488442424           | dec                 ecx

        $sequence_3 = { e8???????? 3da1000000 0f85d2000000 488bcd e8???????? 3db1000000 0f85bf000000 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   3da1000000           | xor                 edx, edx
            //   0f85d2000000         | xor                 ecx, ecx
            //   488bcd               | dec                 eax
            //   e8????????           |                     
            //   3db1000000           | mov                 dword ptr [edi], eax
            //   0f85bf000000         | dec                 eax

        $sequence_4 = { e8???????? 0fb6c8 483bd9 7243 488bcf e8???????? 0fb6d8 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   0fb6c8               | and                 al, 0x30
            //   483bd9               | dec                 eax
            //   7243                 | mov                 edx, edi
            //   488bcf               | dec                 eax
            //   e8????????           |                     
            //   0fb6d8               | lea                 ecx, [esp + 0x60]

        $sequence_5 = { bf18000000 448d47eb 8bd7 e8???????? 90 4883a39001000000 c6839801000000 }
            // n = 7, score = 100
            //   bf18000000           | mov                 ecx, edi
            //   448d47eb             | dec                 eax
            //   8bd7                 | mov                 eax, dword ptr [edi + 0x18]
            //   e8????????           |                     
            //   90                   | dec                 eax
            //   4883a39001000000     | cmp                 eax, dword ptr [edi + 0x20]
            //   c6839801000000       | jne                 0x147

        $sequence_6 = { 488bcb 488bd7 e8???????? 85c0 7407 0500deffff eb10 }
            // n = 7, score = 100
            //   488bcb               | inc                 ecx
            //   488bd7               | shr                 eax, 1
            //   e8????????           |                     
            //   85c0                 | inc                 ecx
            //   7407                 | and                 eax, 1
            //   0500deffff           | dec                 eax
            //   eb10                 | mov                 eax, dword ptr [ebx]

        $sequence_7 = { ba01000000 488b4d28 e8???????? 488b4d28 e8???????? 90 48b80000000000000000 }
            // n = 7, score = 100
            //   ba01000000           | dec                 eax
            //   488b4d28             | mov                 ecx, ebx
            //   e8????????           |                     
            //   488b4d28             | inc                 edi
            //   e8????????           |                     
            //   90                   | dec                 eax
            //   48b80000000000000000     | add    esi, 0x90

        $sequence_8 = { 498b4808 4885c9 0f8440010000 488b07 448a20 4c8d7801 4c893f }
            // n = 7, score = 100
            //   498b4808             | and                 dword ptr [ebx + 0x10], 0
            //   4885c9               | dec                 eax
            //   0f8440010000         | and                 dword ptr [ebx + 8], 0
            //   488b07               | dec                 eax
            //   448a20               | mov                 ebx, dword ptr [esp + 0x30]
            //   4c8d7801             | dec                 eax
            //   4c893f               | add                 esp, 0x20

        $sequence_9 = { b880c2ffff e9???????? 4c8d45e0 488bd7 488d4d30 e8???????? 8bd8 }
            // n = 7, score = 100
            //   b880c2ffff           | mov                 eax, dword ptr [ebx + 0x58]
            //   e9????????           |                     
            //   4c8d45e0             | mov                 edx, dword ptr [eax + 0x24]
            //   488bd7               | xor                 eax, eax
            //   488d4d30             | dec                 eax
            //   e8????????           |                     
            //   8bd8                 | mov                 ebx, dword ptr [esp + 0x40]

    condition:
        7 of them and filesize < 2415616
}