rule win_loup_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.loup."
        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.loup"
        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 = { b904000000 6bd100 c78264a1410002000000 b804000000 6bc800 8b15???????? }
            // n = 6, score = 100
            //   b904000000           | mov                 ecx, 4
            //   6bd100               | imul                edx, ecx, 0
            //   c78264a1410002000000     | mov    dword ptr [edx + 0x41a164], 2
            //   b804000000           | mov                 eax, 4
            //   6bc800               | imul                ecx, eax, 0
            //   8b15????????         |                     

        $sequence_1 = { e8???????? 8945b4 8b45c0 50 e8???????? 837db400 750c }
            // n = 7, score = 100
            //   e8????????           |                     
            //   8945b4               | mov                 dword ptr [ebp - 0x4c], eax
            //   8b45c0               | mov                 eax, dword ptr [ebp - 0x40]
            //   50                   | push                eax
            //   e8????????           |                     
            //   837db400             | cmp                 dword ptr [ebp - 0x4c], 0
            //   750c                 | jne                 0xe

        $sequence_2 = { e8???????? e8???????? 85c0 750c c7853cffffff01000000 }
            // n = 5, score = 100
            //   e8????????           |                     
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   750c                 | jne                 0xe
            //   c7853cffffff01000000     | mov    dword ptr [ebp - 0xc4], 1

        $sequence_3 = { f3ab b9???????? e8???????? e8???????? 85c0 750c }
            // n = 6, score = 100
            //   f3ab                 | rep stosd           dword ptr es:[edi], eax
            //   b9????????           |                     
            //   e8????????           |                     
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   750c                 | jne                 0xe

        $sequence_4 = { 53 56 ff3485647b4100 50 e8???????? }
            // n = 5, score = 100
            //   53                   | push                ebx
            //   56                   | push                esi
            //   ff3485647b4100       | push                dword ptr [eax*4 + 0x417b64]
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_5 = { 8bcd 50 8d156c1b4100 e8???????? 58 5a 5f }
            // n = 7, score = 100
            //   8bcd                 | mov                 ecx, ebp
            //   50                   | push                eax
            //   8d156c1b4100         | lea                 edx, [0x411b6c]
            //   e8????????           |                     
            //   58                   | pop                 eax
            //   5a                   | pop                 edx
            //   5f                   | pop                 edi

        $sequence_6 = { 52 6802020000 68c0d40100 6a00 6a00 }
            // n = 5, score = 100
            //   52                   | push                edx
            //   6802020000           | push                0x202
            //   68c0d40100           | push                0x1d4c0
            //   6a00                 | push                0
            //   6a00                 | push                0

        $sequence_7 = { ff15???????? 83c40c 3bf4 e8???????? c745cfc8000000 }
            // n = 5, score = 100
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   3bf4                 | cmp                 esi, esp
            //   e8????????           |                     
            //   c745cfc8000000       | mov                 dword ptr [ebp - 0x31], 0xc8

        $sequence_8 = { c78568fcffff01000000 eb0a c78568fcffff00000000 8b8568fcffff 52 8bcd 50 }
            // n = 7, score = 100
            //   c78568fcffff01000000     | mov    dword ptr [ebp - 0x398], 1
            //   eb0a                 | jmp                 0xc
            //   c78568fcffff00000000     | mov    dword ptr [ebp - 0x398], 0
            //   8b8568fcffff         | mov                 eax, dword ptr [ebp - 0x398]
            //   52                   | push                edx
            //   8bcd                 | mov                 ecx, ebp
            //   50                   | push                eax

        $sequence_9 = { 8d156c1b4100 e8???????? 58 5a 5f }
            // n = 5, score = 100
            //   8d156c1b4100         | lea                 edx, [0x411b6c]
            //   e8????????           |                     
            //   58                   | pop                 eax
            //   5a                   | pop                 edx
            //   5f                   | pop                 edi

    condition:
        7 of them and filesize < 257024
}