rule win_mount_locker_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.mount_locker."
        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.mount_locker"
        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 = { 498be8 4d8bc8 4c8bc2 4c8bf2 }
            // n = 4, score = 500
            //   498be8               | test                eax, eax
            //   4d8bc8               | dec                 ecx
            //   4c8bc2               | mov                 ebp, eax
            //   4c8bf2               | dec                 ebp

        $sequence_1 = { 4c8b05???????? 488bcb 488b15???????? e8???????? 85c0 }
            // n = 5, score = 500
            //   4c8b05????????       |                     
            //   488bcb               | dec                 eax
            //   488b15????????       |                     
            //   e8????????           |                     
            //   85c0                 | mov                 ecx, ebx

        $sequence_2 = { f30f5905???????? 0f5ad0 66490f7ed0 e8???????? }
            // n = 4, score = 500
            //   f30f5905????????     |                     
            //   0f5ad0               | lea                 eax, [esp + 0x30]
            //   66490f7ed0           | dec                 eax
            //   e8????????           |                     

        $sequence_3 = { 488364242800 4c8d442430 488364242000 4533c9 488b4c2458 33d2 c744243001000000 }
            // n = 7, score = 500
            //   488364242800         | mov                 ecx, eax
            //   4c8d442430           | dec                 esp
            //   488364242000         | mov                 eax, edx
            //   4533c9               | dec                 esp
            //   488b4c2458           | mov                 esi, edx
            //   33d2                 | dec                 eax
            //   c744243001000000     | and                 dword ptr [esp + 0x28], 0

        $sequence_4 = { 81e10000ffff 81f900000780 7503 0fb7c0 }
            // n = 4, score = 500
            //   81e10000ffff         | inc                 ebp
            //   81f900000780         | xor                 ecx, ecx
            //   7503                 | dec                 eax
            //   0fb7c0               | mov                 ecx, dword ptr [esp + 0x58]

        $sequence_5 = { 488d4df0 4889442428 4533c9 4533c0 }
            // n = 4, score = 500
            //   488d4df0             | xor                 ecx, ecx
            //   4889442428           | dec                 eax
            //   4533c9               | mov                 ecx, dword ptr [esp + 0x58]
            //   4533c0               | xor                 edx, edx

        $sequence_6 = { 4c8bf2 8bf1 33d2 33c9 }
            // n = 4, score = 500
            //   4c8bf2               | dec                 esp
            //   8bf1                 | lea                 eax, [esp + 0x30]
            //   33d2                 | dec                 eax
            //   33c9                 | and                 dword ptr [esp + 0x20], 0

        $sequence_7 = { 488b0b 41b902000000 4533c0 33d2 }
            // n = 4, score = 500
            //   488b0b               | mov                 ecx, dword ptr [esp + 0x58]
            //   41b902000000         | xor                 edx, edx
            //   4533c0               | mov                 dword ptr [esp + 0x30], 1
            //   33d2                 | dec                 esp

        $sequence_8 = { ff15???????? 8bc8 81e10000ffff 81f900000780 }
            // n = 4, score = 300
            //   ff15????????         |                     
            //   8bc8                 | mov                 ebp, eax
            //   81e10000ffff         | dec                 ebp
            //   81f900000780         | mov                 ecx, eax

        $sequence_9 = { ff15???????? 85c0 7509 f0ff05???????? }
            // n = 4, score = 300
            //   ff15????????         |                     
            //   85c0                 | and                 dword ptr [esp + 0x20], 0
            //   7509                 | inc                 ebp
            //   f0ff05????????       |                     

        $sequence_10 = { 488bcb ff15???????? 4c8b05???????? 488bcb }
            // n = 4, score = 300
            //   488bcb               | xor                 eax, eax
            //   ff15????????         |                     
            //   4c8b05????????       |                     
            //   488bcb               | xor                 edx, edx

        $sequence_11 = { 7505 e8???????? 833d????????00 7409 }
            // n = 4, score = 300
            //   7505                 | dec                 esp
            //   e8????????           |                     
            //   833d????????00       |                     
            //   7409                 | mov                 eax, edx

        $sequence_12 = { 83f835 7513 8d44242c 50 68???????? e8???????? 59 }
            // n = 7, score = 100
            //   83f835               | mov                 ecx, dword ptr [esp + 0x58]
            //   7513                 | xor                 edx, edx
            //   8d44242c             | mov                 dword ptr [esp + 0x30], 1
            //   50                   | mov                 dword ptr [esp + 0x3c], 2
            //   68????????           |                     
            //   e8????????           |                     
            //   59                   | dec                 eax

        $sequence_13 = { 8bf8 85ff 7523 f0ff05???????? 53 }
            // n = 5, score = 100
            //   8bf8                 | and                 dword ptr [esp + 0x20], 0
            //   85ff                 | inc                 ebp
            //   7523                 | xor                 ecx, ecx
            //   f0ff05????????       |                     
            //   53                   | dec                 eax

        $sequence_14 = { 6a02 50 ff15???????? 03c0 50 }
            // n = 5, score = 100
            //   6a02                 | and                 dword ptr [esp + 0x20], 0
            //   50                   | inc                 ebp
            //   ff15????????         |                     
            //   03c0                 | xor                 ecx, ecx
            //   50                   | dec                 eax

        $sequence_15 = { e8???????? 83c40c e8???????? ff15???????? 50 68???????? 57 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   83c40c               | mov                 dword ptr [esp + 0x30], 1
            //   e8????????           |                     
            //   ff15????????         |                     
            //   50                   | mov                 dword ptr [esp + 0x3c], 2
            //   68????????           |                     
            //   57                   | dec                 eax

    condition:
        7 of them and filesize < 368640
}