rule win_unidentified_116_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.unidentified_116."
        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.unidentified_116"
        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 = { 8ac8 44 8bd2 45 8d43fc 83f905 7f65 }
            // n = 7, score = 100
            //   8ac8                 | mov                 cl, al
            //   44                   | inc                 esp
            //   8bd2                 | mov                 edx, edx
            //   45                   | inc                 ebp
            //   8d43fc               | lea                 eax, [ebx - 4]
            //   83f905               | cmp                 ecx, 5
            //   7f65                 | jg                  0x67

        $sequence_1 = { 8d4dc7 e8???????? 44 8d4306 48 8d55c7 48 }
            // n = 7, score = 100
            //   8d4dc7               | lea                 ecx, [ebp - 0x39]
            //   e8????????           |                     
            //   44                   | inc                 esp
            //   8d4306               | lea                 eax, [ebx + 6]
            //   48                   | dec                 eax
            //   8d55c7               | lea                 edx, [ebp - 0x39]
            //   48                   | dec                 eax

        $sequence_2 = { c1eb18 44 331432 44 0bd9 0fb64332 44 }
            // n = 7, score = 100
            //   c1eb18               | shr                 ebx, 0x18
            //   44                   | inc                 esp
            //   331432               | xor                 edx, dword ptr [edx + esi]
            //   44                   | inc                 esp
            //   0bd9                 | or                  ebx, ecx
            //   0fb64332             | movzx               eax, byte ptr [ebx + 0x32]
            //   44                   | inc                 esp

        $sequence_3 = { c7c201f0ffff 48 897de8 897de0 e9???????? 8b4b58 81e1ff7effff }
            // n = 7, score = 100
            //   c7c201f0ffff         | mov                 edx, 0xfffff001
            //   48                   | dec                 eax
            //   897de8               | mov                 dword ptr [ebp - 0x18], edi
            //   897de0               | mov                 dword ptr [ebp - 0x20], edi
            //   e9????????           |                     
            //   8b4b58               | mov                 ecx, dword ptr [ebx + 0x58]
            //   81e1ff7effff         | and                 ecx, 0xffff7eff

        $sequence_4 = { 3305???????? 48 8d155c2bfdff 48 8bcb 48 8905???????? }
            // n = 7, score = 100
            //   3305????????         |                     
            //   48                   | dec                 eax
            //   8d155c2bfdff         | lea                 edx, [0xfffd2b5c]
            //   48                   | dec                 eax
            //   8bcb                 | mov                 ecx, ebx
            //   48                   | dec                 eax
            //   8905????????         |                     

        $sequence_5 = { ff15???????? 33ed 8bc8 817c2430020000c0 7505 48 892b }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   33ed                 | xor                 ebp, ebp
            //   8bc8                 | mov                 ecx, eax
            //   817c2430020000c0     | cmp                 dword ptr [esp + 0x30], 0xc0000002
            //   7505                 | jne                 7
            //   48                   | dec                 eax
            //   892b                 | mov                 dword ptr [ebx], ebp

        $sequence_6 = { 8bc4 48 895818 48 897020 48 895010 }
            // n = 7, score = 100
            //   8bc4                 | mov                 eax, esp
            //   48                   | dec                 eax
            //   895818               | mov                 dword ptr [eax + 0x18], ebx
            //   48                   | dec                 eax
            //   897020               | mov                 dword ptr [eax + 0x20], esi
            //   48                   | dec                 eax
            //   895010               | mov                 dword ptr [eax + 0x10], edx

        $sequence_7 = { 8bcb e8???????? 48 8b4b38 41 bf00000400 48 }
            // n = 7, score = 100
            //   8bcb                 | mov                 ecx, ebx
            //   e8????????           |                     
            //   48                   | dec                 eax
            //   8b4b38               | mov                 ecx, dword ptr [ebx + 0x38]
            //   41                   | inc                 ecx
            //   bf00000400           | mov                 edi, 0x40000
            //   48                   | dec                 eax

        $sequence_8 = { e8???????? 49 8bd6 48 8bcf 4c 896038 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   49                   | dec                 ecx
            //   8bd6                 | mov                 edx, esi
            //   48                   | dec                 eax
            //   8bcf                 | mov                 ecx, edi
            //   4c                   | dec                 esp
            //   896038               | mov                 dword ptr [eax + 0x38], esp

        $sequence_9 = { 8bf9 0f84be000000 48 895c2430 48 89742438 48 }
            // n = 7, score = 100
            //   8bf9                 | mov                 edi, ecx
            //   0f84be000000         | je                  0xc4
            //   48                   | dec                 eax
            //   895c2430             | mov                 dword ptr [esp + 0x30], ebx
            //   48                   | dec                 eax
            //   89742438             | mov                 dword ptr [esp + 0x38], esi
            //   48                   | dec                 eax

    condition:
        7 of them and filesize < 1040384
}