rule win_hoplight_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.hoplight."
        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.hoplight"
        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 = { 488b442448 4805a0000000 4889442420 48837c242000 }
            // n = 4, score = 100
            //   488b442448           | mov                 eax, dword ptr [eax]
            //   4805a0000000         | and                 eax, 0xff
            //   4889442420           | mov                 eax, eax
            //   48837c242000         | dec                 eax

        $sequence_1 = { 488d15433c0200 488b4c2420 e8???????? 85c0 }
            // n = 4, score = 100
            //   488d15433c0200       | dec                 eax
            //   488b4c2420           | mov                 eax, dword ptr [esp + 0x570]
            //   e8????????           |                     
            //   85c0                 | dec                 eax

        $sequence_2 = { 750a 83bc24800400000e 7469 837c242c33 }
            // n = 4, score = 100
            //   750a                 | inc                 eax
            //   83bc24800400000e     | dec                 eax
            //   7469                 | mov                 dword ptr [esp], eax
            //   837c242c33           | cmp                 dword ptr [esp + 0x14], 2

        $sequence_3 = { 48ffc0 48890424 837c241402 7e16 }
            // n = 4, score = 100
            //   48ffc0               | mov                 dword ptr [esp + 0x30], eax
            //   48890424             | dec                 eax
            //   837c241402           | lea                 edx, [0x23c43]
            //   7e16                 | dec                 eax

        $sequence_4 = { 488b8c2470010000 e8???????? 488b842470050000 4883783800 }
            // n = 4, score = 100
            //   488b8c2470010000     | mov                 eax, dword ptr [esp + 0x40]
            //   e8????????           |                     
            //   488b842470050000     | dec                 eax
            //   4883783800           | mov                 edx, dword ptr [eax + 0x1afa0]

        $sequence_5 = { 488d8c2452080000 4533f6 33d2 41b8fe070000 }
            // n = 4, score = 100
            //   488d8c2452080000     | mov                 ecx, dword ptr [esp + 0x20]
            //   4533f6               | test                eax, eax
            //   33d2                 | dec                 eax
            //   41b8fe070000         | mov                 eax, dword ptr [esp + 0x168]

        $sequence_6 = { 488b842468010000 8b00 25ff000000 8bc0 }
            // n = 4, score = 100
            //   488b842468010000     | cmp                 dword ptr [eax + 0x38], 0
            //   8b00                 | jne                 0x13
            //   25ff000000           | mov                 eax, dword ptr [esp + 0x30]
            //   8bc0                 | dec                 eax

        $sequence_7 = { 7511 8b442430 ffc8 89442430 }
            // n = 4, score = 100
            //   7511                 | dec                 eax
            //   8b442430             | mov                 eax, dword ptr [esp + 0x40]
            //   ffc8                 | dec                 eax
            //   89442430             | mov                 ecx, dword ptr [esp + 0x170]

    condition:
        7 of them and filesize < 765952
}