rule win_prestige_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.prestige."
        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.prestige"
        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 = { 3b45d8 752c 3bd6 7528 8b45e8 8b4de0 3bce }
            // n = 7, score = 100
            //   3b45d8               | cmp                 eax, dword ptr [ebp - 0x28]
            //   752c                 | jne                 0x2e
            //   3bd6                 | cmp                 edx, esi
            //   7528                 | jne                 0x2a
            //   8b45e8               | mov                 eax, dword ptr [ebp - 0x18]
            //   8b4de0               | mov                 ecx, dword ptr [ebp - 0x20]
            //   3bce                 | cmp                 ecx, esi

        $sequence_1 = { 7210 7707 3d00a0724e 7207 6a0e e9???????? 81f9e8000000 }
            // n = 7, score = 100
            //   7210                 | jb                  0x12
            //   7707                 | ja                  9
            //   3d00a0724e           | cmp                 eax, 0x4e72a000
            //   7207                 | jb                  9
            //   6a0e                 | push                0xe
            //   e9????????           |                     
            //   81f9e8000000         | cmp                 ecx, 0xe8

        $sequence_2 = { 6a09 58 03d0 8955c8 81fa08070000 7d6e 8b4dd0 }
            // n = 7, score = 100
            //   6a09                 | push                9
            //   58                   | pop                 eax
            //   03d0                 | add                 edx, eax
            //   8955c8               | mov                 dword ptr [ebp - 0x38], edx
            //   81fa08070000         | cmp                 edx, 0x708
            //   7d6e                 | jge                 0x70
            //   8b4dd0               | mov                 ecx, dword ptr [ebp - 0x30]

        $sequence_3 = { 8d8dd8f9ffff c645fc80 e8???????? 51 68???????? 8d8df0f9ffff c645fc81 }
            // n = 7, score = 100
            //   8d8dd8f9ffff         | lea                 ecx, [ebp - 0x628]
            //   c645fc80             | mov                 byte ptr [ebp - 4], 0x80
            //   e8????????           |                     
            //   51                   | push                ecx
            //   68????????           |                     
            //   8d8df0f9ffff         | lea                 ecx, [ebp - 0x610]
            //   c645fc81             | mov                 byte ptr [ebp - 4], 0x81

        $sequence_4 = { 33d2 42 e9???????? ff75e0 56 e8???????? 8b75e8 }
            // n = 7, score = 100
            //   33d2                 | xor                 edx, edx
            //   42                   | inc                 edx
            //   e9????????           |                     
            //   ff75e0               | push                dword ptr [ebp - 0x20]
            //   56                   | push                esi
            //   e8????????           |                     
            //   8b75e8               | mov                 esi, dword ptr [ebp - 0x18]

        $sequence_5 = { 84c0 7509 53 56 e8???????? eb04 c6465000 }
            // n = 7, score = 100
            //   84c0                 | test                al, al
            //   7509                 | jne                 0xb
            //   53                   | push                ebx
            //   56                   | push                esi
            //   e8????????           |                     
            //   eb04                 | jmp                 6
            //   c6465000             | mov                 byte ptr [esi + 0x50], 0

        $sequence_6 = { 8d042f 894310 8bc3 83f910 7202 8b03 8d3428 }
            // n = 7, score = 100
            //   8d042f               | lea                 eax, [edi + ebp]
            //   894310               | mov                 dword ptr [ebx + 0x10], eax
            //   8bc3                 | mov                 eax, ebx
            //   83f910               | cmp                 ecx, 0x10
            //   7202                 | jb                  4
            //   8b03                 | mov                 eax, dword ptr [ebx]
            //   8d3428               | lea                 esi, [eax + ebp]

        $sequence_7 = { 8bec 8b5110 3b5114 731b 83791410 8d4201 894110 }
            // n = 7, score = 100
            //   8bec                 | mov                 ebp, esp
            //   8b5110               | mov                 edx, dword ptr [ecx + 0x10]
            //   3b5114               | cmp                 edx, dword ptr [ecx + 0x14]
            //   731b                 | jae                 0x1d
            //   83791410             | cmp                 dword ptr [ecx + 0x14], 0x10
            //   8d4201               | lea                 eax, [edx + 1]
            //   894110               | mov                 dword ptr [ecx + 0x10], eax

        $sequence_8 = { 743f 8b45f0 33d2 48 f7f6 33d2 8bc8 }
            // n = 7, score = 100
            //   743f                 | je                  0x41
            //   8b45f0               | mov                 eax, dword ptr [ebp - 0x10]
            //   33d2                 | xor                 edx, edx
            //   48                   | dec                 eax
            //   f7f6                 | div                 esi
            //   33d2                 | xor                 edx, edx
            //   8bc8                 | mov                 ecx, eax

        $sequence_9 = { 53 52 51 8d5e40 8bcf 53 ff5018 }
            // n = 7, score = 100
            //   53                   | push                ebx
            //   52                   | push                edx
            //   51                   | push                ecx
            //   8d5e40               | lea                 ebx, [esi + 0x40]
            //   8bcf                 | mov                 ecx, edi
            //   53                   | push                ebx
            //   ff5018               | call                dword ptr [eax + 0x18]

    condition:
        7 of them and filesize < 1518592
}