rule win_hyperbro_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.hyperbro."
        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.hyperbro"
        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 = { 6a00 50 ff15???????? 85c0 7522 8b06 }
            // n = 6, score = 400
            //   6a00                 | push                0
            //   50                   | push                eax
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7522                 | jne                 0x24
            //   8b06                 | mov                 eax, dword ptr [esi]

        $sequence_1 = { 85c0 7461 8b442410 85c0 0f8691000000 8d54241c }
            // n = 6, score = 400
            //   85c0                 | test                eax, eax
            //   7461                 | je                  0x63
            //   8b442410             | mov                 eax, dword ptr [esp + 0x10]
            //   85c0                 | test                eax, eax
            //   0f8691000000         | jbe                 0x97
            //   8d54241c             | lea                 edx, [esp + 0x1c]

        $sequence_2 = { e8???????? 83c404 55 6a00 50 8944241c }
            // n = 6, score = 400
            //   e8????????           |                     
            //   83c404               | add                 esp, 4
            //   55                   | push                ebp
            //   6a00                 | push                0
            //   50                   | push                eax
            //   8944241c             | mov                 dword ptr [esp + 0x1c], eax

        $sequence_3 = { 8b5604 8b06 83ea04 52 8d4804 51 50 }
            // n = 7, score = 400
            //   8b5604               | mov                 edx, dword ptr [esi + 4]
            //   8b06                 | mov                 eax, dword ptr [esi]
            //   83ea04               | sub                 edx, 4
            //   52                   | push                edx
            //   8d4804               | lea                 ecx, [eax + 4]
            //   51                   | push                ecx
            //   50                   | push                eax

        $sequence_4 = { 8b4618 33ff 3bc7 7412 }
            // n = 4, score = 400
            //   8b4618               | mov                 eax, dword ptr [esi + 0x18]
            //   33ff                 | xor                 edi, edi
            //   3bc7                 | cmp                 eax, edi
            //   7412                 | je                  0x14

        $sequence_5 = { eb0a 8b16 03d1 891a }
            // n = 4, score = 400
            //   eb0a                 | jmp                 0xc
            //   8b16                 | mov                 edx, dword ptr [esi]
            //   03d1                 | add                 edx, ecx
            //   891a                 | mov                 dword ptr [edx], ebx

        $sequence_6 = { 8bd6 2bd7 c1e802 2bd0 81ea01080000 41 3bd3 }
            // n = 7, score = 400
            //   8bd6                 | mov                 edx, esi
            //   2bd7                 | sub                 edx, edi
            //   c1e802               | shr                 eax, 2
            //   2bd0                 | sub                 edx, eax
            //   81ea01080000         | sub                 edx, 0x801
            //   41                   | inc                 ecx
            //   3bd3                 | cmp                 edx, ebx

        $sequence_7 = { 50 8903 e8???????? 83c40c c7460848484848 e8???????? 83c018 }
            // n = 7, score = 400
            //   50                   | push                eax
            //   8903                 | mov                 dword ptr [ebx], eax
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   c7460848484848       | mov                 dword ptr [esi + 8], 0x48484848
            //   e8????????           |                     
            //   83c018               | add                 eax, 0x18

        $sequence_8 = { e8???????? 6882000000 6a00 50 894628 }
            // n = 5, score = 400
            //   e8????????           |                     
            //   6882000000           | push                0x82
            //   6a00                 | push                0
            //   50                   | push                eax
            //   894628               | mov                 dword ptr [esi + 0x28], eax

        $sequence_9 = { 53 e8???????? 8b470c 89042b 8b06 50 e8???????? }
            // n = 7, score = 400
            //   53                   | push                ebx
            //   e8????????           |                     
            //   8b470c               | mov                 eax, dword ptr [edi + 0xc]
            //   89042b               | mov                 dword ptr [ebx + ebp], eax
            //   8b06                 | mov                 eax, dword ptr [esi]
            //   50                   | push                eax
            //   e8????????           |                     

    condition:
        7 of them and filesize < 352256
}