rule win_lambload_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.lambload."
        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.lambload"
        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 = { 33d2 8a93980f0710 8a5f01 47 8954241c 83e37f }
            // n = 6, score = 100
            //   33d2                 | xor                 edx, edx
            //   8a93980f0710         | mov                 dl, byte ptr [ebx + 0x10070f98]
            //   8a5f01               | mov                 bl, byte ptr [edi + 1]
            //   47                   | inc                 edi
            //   8954241c             | mov                 dword ptr [esp + 0x1c], edx
            //   83e37f               | and                 ebx, 0x7f

        $sequence_1 = { ff15???????? 33c0 eb57 8d45f0 50 }
            // n = 5, score = 100
            //   ff15????????         |                     
            //   33c0                 | xor                 eax, eax
            //   eb57                 | jmp                 0x59
            //   8d45f0               | lea                 eax, [ebp - 0x10]
            //   50                   | push                eax

        $sequence_2 = { 7705 3b550c 76c9 8b450c }
            // n = 4, score = 100
            //   7705                 | ja                  7
            //   3b550c               | cmp                 edx, dword ptr [ebp + 0xc]
            //   76c9                 | jbe                 0xffffffcb
            //   8b450c               | mov                 eax, dword ptr [ebp + 0xc]

        $sequence_3 = { 57 ffb6a4b40100 e8???????? 6a00 6a00 8d4dfc 51 }
            // n = 7, score = 100
            //   57                   | push                edi
            //   ffb6a4b40100         | push                dword ptr [esi + 0x1b4a4]
            //   e8????????           |                     
            //   6a00                 | push                0
            //   6a00                 | push                0
            //   8d4dfc               | lea                 ecx, [ebp - 4]
            //   51                   | push                ecx

        $sequence_4 = { 8d4edb 83f953 0f8761040000 33d2 8a9148110210 ff249518110210 48 }
            // n = 7, score = 100
            //   8d4edb               | lea                 ecx, [esi - 0x25]
            //   83f953               | cmp                 ecx, 0x53
            //   0f8761040000         | ja                  0x467
            //   33d2                 | xor                 edx, edx
            //   8a9148110210         | mov                 dl, byte ptr [ecx + 0x10021148]
            //   ff249518110210       | jmp                 dword ptr [edx*4 + 0x10021118]
            //   48                   | dec                 eax

        $sequence_5 = { 8d4802 668b10 83c002 6685d2 75f5 8bb5d0f4ffff }
            // n = 6, score = 100
            //   8d4802               | lea                 ecx, [eax + 2]
            //   668b10               | mov                 dx, word ptr [eax]
            //   83c002               | add                 eax, 2
            //   6685d2               | test                dx, dx
            //   75f5                 | jne                 0xfffffff7
            //   8bb5d0f4ffff         | mov                 esi, dword ptr [ebp - 0xb30]

        $sequence_6 = { 32d1 8895e8330710 45 81fdff030000 7c02 33ed }
            // n = 6, score = 100
            //   32d1                 | xor                 dl, cl
            //   8895e8330710         | mov                 byte ptr [ebp + 0x100733e8], dl
            //   45                   | inc                 ebp
            //   81fdff030000         | cmp                 ebp, 0x3ff
            //   7c02                 | jl                  4
            //   33ed                 | xor                 ebp, ebp

        $sequence_7 = { 03048d00490710 eb02 8bc2 f6402480 7418 e8???????? }
            // n = 6, score = 100
            //   03048d00490710       | add                 eax, dword ptr [ecx*4 + 0x10074900]
            //   eb02                 | jmp                 4
            //   8bc2                 | mov                 eax, edx
            //   f6402480             | test                byte ptr [eax + 0x24], 0x80
            //   7418                 | je                  0x1a
            //   e8????????           |                     

        $sequence_8 = { 6aff 8d85ecfdffff 50 ff7308 66a5 }
            // n = 5, score = 100
            //   6aff                 | push                -1
            //   8d85ecfdffff         | lea                 eax, [ebp - 0x214]
            //   50                   | push                eax
            //   ff7308               | push                dword ptr [ebx + 8]
            //   66a5                 | movsw               word ptr es:[edi], word ptr [esi]

        $sequence_9 = { 4d 3882980f0710 74ec 83fd03 7e1b }
            // n = 5, score = 100
            //   4d                   | dec                 ebp
            //   3882980f0710         | cmp                 byte ptr [edx + 0x10070f98], al
            //   74ec                 | je                  0xffffffee
            //   83fd03               | cmp                 ebp, 3
            //   7e1b                 | jle                 0x1d

    condition:
        7 of them and filesize < 1039360
}