rule win_socelars_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.socelars."
        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.socelars"
        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 = { e9???????? 8b542424 8d4601 898388000000 8d0cb6 8b4358 42 }
            // n = 7, score = 100
            //   e9????????           |                     
            //   8b542424             | mov                 edx, dword ptr [esp + 0x24]
            //   8d4601               | lea                 eax, [esi + 1]
            //   898388000000         | mov                 dword ptr [ebx + 0x88], eax
            //   8d0cb6               | lea                 ecx, [esi + esi*4]
            //   8b4358               | mov                 eax, dword ptr [ebx + 0x58]
            //   42                   | inc                 edx

        $sequence_1 = { ff742458 6a00 e8???????? 83c410 8b5c2438 33c0 8b54240c }
            // n = 7, score = 100
            //   ff742458             | push                dword ptr [esp + 0x58]
            //   6a00                 | push                0
            //   e8????????           |                     
            //   83c410               | add                 esp, 0x10
            //   8b5c2438             | mov                 ebx, dword ptr [esp + 0x38]
            //   33c0                 | xor                 eax, eax
            //   8b54240c             | mov                 edx, dword ptr [esp + 0xc]

        $sequence_2 = { ff15???????? 8b4dfc 8981a4000000 68???????? 8b55e8 52 ff15???????? }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   8981a4000000         | mov                 dword ptr [ecx + 0xa4], eax
            //   68????????           |                     
            //   8b55e8               | mov                 edx, dword ptr [ebp - 0x18]
            //   52                   | push                edx
            //   ff15????????         |                     

        $sequence_3 = { ff742414 e8???????? 83c408 85c0 7411 50 8bd3 }
            // n = 7, score = 100
            //   ff742414             | push                dword ptr [esp + 0x14]
            //   e8????????           |                     
            //   83c408               | add                 esp, 8
            //   85c0                 | test                eax, eax
            //   7411                 | je                  0x13
            //   50                   | push                eax
            //   8bd3                 | mov                 edx, ebx

        $sequence_4 = { e9???????? 8bcf e8???????? 8bf0 e9???????? 83bd14feffff00 0f849e000000 }
            // n = 7, score = 100
            //   e9????????           |                     
            //   8bcf                 | mov                 ecx, edi
            //   e8????????           |                     
            //   8bf0                 | mov                 esi, eax
            //   e9????????           |                     
            //   83bd14feffff00       | cmp                 dword ptr [ebp - 0x1ec], 0
            //   0f849e000000         | je                  0xa4

        $sequence_5 = { e8???????? 8bf8 83c408 897c2414 85ff 0f842e020000 33f6 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   8bf8                 | mov                 edi, eax
            //   83c408               | add                 esp, 8
            //   897c2414             | mov                 dword ptr [esp + 0x14], edi
            //   85ff                 | test                edi, edi
            //   0f842e020000         | je                  0x234
            //   33f6                 | xor                 esi, esi

        $sequence_6 = { ff742460 ba6c000000 8bcf e8???????? 83c40c 89842498000000 eb32 }
            // n = 7, score = 100
            //   ff742460             | push                dword ptr [esp + 0x60]
            //   ba6c000000           | mov                 edx, 0x6c
            //   8bcf                 | mov                 ecx, edi
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   89842498000000       | mov                 dword ptr [esp + 0x98], eax
            //   eb32                 | jmp                 0x34

        $sequence_7 = { ff7004 e8???????? 8b7dd4 8bf0 8b4dbc 56 ff7704 }
            // n = 7, score = 100
            //   ff7004               | push                dword ptr [eax + 4]
            //   e8????????           |                     
            //   8b7dd4               | mov                 edi, dword ptr [ebp - 0x2c]
            //   8bf0                 | mov                 esi, eax
            //   8b4dbc               | mov                 ecx, dword ptr [ebp - 0x44]
            //   56                   | push                esi
            //   ff7704               | push                dword ptr [edi + 4]

        $sequence_8 = { ff7508 e8???????? 83c408 85c0 7426 8b442410 ff442418 }
            // n = 7, score = 100
            //   ff7508               | push                dword ptr [ebp + 8]
            //   e8????????           |                     
            //   83c408               | add                 esp, 8
            //   85c0                 | test                eax, eax
            //   7426                 | je                  0x28
            //   8b442410             | mov                 eax, dword ptr [esp + 0x10]
            //   ff442418             | inc                 dword ptr [esp + 0x18]

        $sequence_9 = { ff742424 6aff e8???????? 83c410 89442414 3b472c 7e03 }
            // n = 7, score = 100
            //   ff742424             | push                dword ptr [esp + 0x24]
            //   6aff                 | push                -1
            //   e8????????           |                     
            //   83c410               | add                 esp, 0x10
            //   89442414             | mov                 dword ptr [esp + 0x14], eax
            //   3b472c               | cmp                 eax, dword ptr [edi + 0x2c]
            //   7e03                 | jle                 5

    condition:
        7 of them and filesize < 2151424
}