rule win_lethic_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.lethic."
        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.lethic"
        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 = { 33c0 e9???????? 8b45fc 8b4d10 894804 8b55fc c7823410000001000000 }
            // n = 7, score = 1200
            //   33c0                 | xor                 eax, eax
            //   e9????????           |                     
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   8b4d10               | mov                 ecx, dword ptr [ebp + 0x10]
            //   894804               | mov                 dword ptr [eax + 4], ecx
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   c7823410000001000000     | mov    dword ptr [edx + 0x1034], 1

        $sequence_1 = { 8b45fc c60000 8b4dfc 83c101 894dfc ebe7 8b4508 }
            // n = 7, score = 1200
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   c60000               | mov                 byte ptr [eax], 0
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   83c101               | add                 ecx, 1
            //   894dfc               | mov                 dword ptr [ebp - 4], ecx
            //   ebe7                 | jmp                 0xffffffe9
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]

        $sequence_2 = { 890a 8b55fc 8b02 8945fc 8b4df4 51 }
            // n = 6, score = 1200
            //   890a                 | mov                 dword ptr [edx], ecx
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   8b02                 | mov                 eax, dword ptr [edx]
            //   8945fc               | mov                 dword ptr [ebp - 4], eax
            //   8b4df4               | mov                 ecx, dword ptr [ebp - 0xc]
            //   51                   | push                ecx

        $sequence_3 = { 8b55fc 83c208 52 8b45fc 8b4818 }
            // n = 5, score = 1200
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   83c208               | add                 edx, 8
            //   52                   | push                edx
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   8b4818               | mov                 ecx, dword ptr [eax + 0x18]

        $sequence_4 = { 894df8 8b55fc 3b55f8 7411 8b45fc }
            // n = 5, score = 1200
            //   894df8               | mov                 dword ptr [ebp - 8], ecx
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   3b55f8               | cmp                 edx, dword ptr [ebp - 8]
            //   7411                 | je                  0x13
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]

        $sequence_5 = { 7420 8d45f8 50 687e660480 8b4dfc 8b5118 52 }
            // n = 7, score = 1200
            //   7420                 | je                  0x22
            //   8d45f8               | lea                 eax, [ebp - 8]
            //   50                   | push                eax
            //   687e660480           | push                0x8004667e
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   8b5118               | mov                 edx, dword ptr [ecx + 0x18]
            //   52                   | push                edx

        $sequence_6 = { 8955f8 837df800 7418 8b45f8 50 8b4dfc 51 }
            // n = 7, score = 1200
            //   8955f8               | mov                 dword ptr [ebp - 8], edx
            //   837df800             | cmp                 dword ptr [ebp - 8], 0
            //   7418                 | je                  0x1a
            //   8b45f8               | mov                 eax, dword ptr [ebp - 8]
            //   50                   | push                eax
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   51                   | push                ecx

        $sequence_7 = { 83c101 894dfc ebe7 8b4508 }
            // n = 4, score = 1200
            //   83c101               | add                 ecx, 1
            //   894dfc               | mov                 dword ptr [ebp - 4], ecx
            //   ebe7                 | jmp                 0xffffffe9
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]

        $sequence_8 = { 8945fc 8b4dfc 034d0c 894df8 8b55fc 3b55f8 7411 }
            // n = 7, score = 1200
            //   8945fc               | mov                 dword ptr [ebp - 4], eax
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   034d0c               | add                 ecx, dword ptr [ebp + 0xc]
            //   894df8               | mov                 dword ptr [ebp - 8], ecx
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   3b55f8               | cmp                 edx, dword ptr [ebp - 8]
            //   7411                 | je                  0x13

        $sequence_9 = { 8b4dfc 034d0c 894df8 8b55fc 3b55f8 7411 }
            // n = 6, score = 1200
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   034d0c               | add                 ecx, dword ptr [ebp + 0xc]
            //   894df8               | mov                 dword ptr [ebp - 8], ecx
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   3b55f8               | cmp                 edx, dword ptr [ebp - 8]
            //   7411                 | je                  0x13

    condition:
        7 of them and filesize < 81920
}