rule win_svcready_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.svcready."
        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.svcready"
        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 = { 5d 5b 83c41c c3 807e2500 740e 5f }
            // n = 7, score = 500
            //   5d                   | pop                 ebp
            //   5b                   | pop                 ebx
            //   83c41c               | add                 esp, 0x1c
            //   c3                   | ret                 
            //   807e2500             | cmp                 byte ptr [esi + 0x25], 0
            //   740e                 | je                  0x10
            //   5f                   | pop                 edi

        $sequence_1 = { 233d???????? 33d7 33d5 8bc8 a3???????? 0bcb 8915???????? }
            // n = 7, score = 500
            //   233d????????         |                     
            //   33d7                 | xor                 edx, edi
            //   33d5                 | xor                 edx, ebp
            //   8bc8                 | mov                 ecx, eax
            //   a3????????           |                     
            //   0bcb                 | or                  ecx, ebx
            //   8915????????         |                     

        $sequence_2 = { 8bec 83ec08 8b5110 53 56 }
            // n = 5, score = 500
            //   8bec                 | mov                 ebp, esp
            //   83ec08               | sub                 esp, 8
            //   8b5110               | mov                 edx, dword ptr [ecx + 0x10]
            //   53                   | push                ebx
            //   56                   | push                esi

        $sequence_3 = { 6689442418 e8???????? 8b08 8d442418 50 ff7520 8a09 }
            // n = 7, score = 500
            //   6689442418           | mov                 word ptr [esp + 0x18], ax
            //   e8????????           |                     
            //   8b08                 | mov                 ecx, dword ptr [eax]
            //   8d442418             | lea                 eax, [esp + 0x18]
            //   50                   | push                eax
            //   ff7520               | push                dword ptr [ebp + 0x20]
            //   8a09                 | mov                 cl, byte ptr [ecx]

        $sequence_4 = { ff36 e8???????? 33c0 59 59 8906 894604 }
            // n = 7, score = 500
            //   ff36                 | push                dword ptr [esi]
            //   e8????????           |                     
            //   33c0                 | xor                 eax, eax
            //   59                   | pop                 ecx
            //   59                   | pop                 ecx
            //   8906                 | mov                 dword ptr [esi], eax
            //   894604               | mov                 dword ptr [esi + 4], eax

        $sequence_5 = { 83c408 eb1f 8d4514 50 56 e8???????? 6a02 }
            // n = 7, score = 500
            //   83c408               | add                 esp, 8
            //   eb1f                 | jmp                 0x21
            //   8d4514               | lea                 eax, [ebp + 0x14]
            //   50                   | push                eax
            //   56                   | push                esi
            //   e8????????           |                     
            //   6a02                 | push                2

        $sequence_6 = { 6a14 8d542420 66c747240100 8bce 33db e8???????? 59 }
            // n = 7, score = 500
            //   6a14                 | push                0x14
            //   8d542420             | lea                 edx, [esp + 0x20]
            //   66c747240100         | mov                 word ptr [edi + 0x24], 1
            //   8bce                 | mov                 ecx, esi
            //   33db                 | xor                 ebx, ebx
            //   e8????????           |                     
            //   59                   | pop                 ecx

        $sequence_7 = { 56 8bd9 57 8b7d08 893b 8b17 }
            // n = 6, score = 500
            //   56                   | push                esi
            //   8bd9                 | mov                 ebx, ecx
            //   57                   | push                edi
            //   8b7d08               | mov                 edi, dword ptr [ebp + 8]
            //   893b                 | mov                 dword ptr [ebx], edi
            //   8b17                 | mov                 edx, dword ptr [edi]

        $sequence_8 = { 33d5 0bc5 33c1 8b2d???????? 23ca 8915???????? }
            // n = 6, score = 500
            //   33d5                 | xor                 edx, ebp
            //   0bc5                 | or                  eax, ebp
            //   33c1                 | xor                 eax, ecx
            //   8b2d????????         |                     
            //   23ca                 | and                 ecx, edx
            //   8915????????         |                     

        $sequence_9 = { 895dec e8???????? 99 8d4dec 83c404 83e203 03c2 }
            // n = 7, score = 500
            //   895dec               | mov                 dword ptr [ebp - 0x14], ebx
            //   e8????????           |                     
            //   99                   | cdq                 
            //   8d4dec               | lea                 ecx, [ebp - 0x14]
            //   83c404               | add                 esp, 4
            //   83e203               | and                 edx, 3
            //   03c2                 | add                 eax, edx

    condition:
        7 of them and filesize < 1187840
}