rule win_hotcroissant_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.hotcroissant."
        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.hotcroissant"
        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 = { e8???????? 6a00 c705????????00000000 ff15???????? 6a00 c705????????00000000 c705????????00000000 }
            // n = 7, score = 600
            //   e8????????           |                     
            //   6a00                 | push                0
            //   c705????????00000000     |     
            //   ff15????????         |                     
            //   6a00                 | push                0
            //   c705????????00000000     |     
            //   c705????????00000000     |     

        $sequence_1 = { c705????????01000000 ffd6 6800040000 68???????? 68???????? }
            // n = 5, score = 600
            //   c705????????01000000     |     
            //   ffd6                 | call                esi
            //   6800040000           | push                0x400
            //   68????????           |                     
            //   68????????           |                     

        $sequence_2 = { c3 e8???????? 6a00 c705????????00000000 ff15???????? 6a00 }
            // n = 6, score = 600
            //   c3                   | ret                 
            //   e8????????           |                     
            //   6a00                 | push                0
            //   c705????????00000000     |     
            //   ff15????????         |                     
            //   6a00                 | push                0

        $sequence_3 = { 6a00 ffd7 85c0 7506 46 83fe08 }
            // n = 6, score = 600
            //   6a00                 | push                0
            //   ffd7                 | call                edi
            //   85c0                 | test                eax, eax
            //   7506                 | jne                 8
            //   46                   | inc                 esi
            //   83fe08               | cmp                 esi, 8

        $sequence_4 = { 68???????? ffd6 a1???????? 85c0 7409 6a01 }
            // n = 6, score = 600
            //   68????????           |                     
            //   ffd6                 | call                esi
            //   a1????????           |                     
            //   85c0                 | test                eax, eax
            //   7409                 | je                  0xb
            //   6a01                 | push                1

        $sequence_5 = { c1e711 c1e808 46 0bc7 }
            // n = 4, score = 600
            //   c1e711               | shl                 edi, 0x11
            //   c1e808               | shr                 eax, 8
            //   46                   | inc                 esi
            //   0bc7                 | or                  eax, edi

        $sequence_6 = { 3bc7 7473 56 6a01 50 ff15???????? }
            // n = 6, score = 600
            //   3bc7                 | cmp                 eax, edi
            //   7473                 | je                  0x75
            //   56                   | push                esi
            //   6a01                 | push                1
            //   50                   | push                eax
            //   ff15????????         |                     

        $sequence_7 = { a3???????? a3???????? ffd6 a1???????? 50 }
            // n = 5, score = 600
            //   a3????????           |                     
            //   a3????????           |                     
            //   ffd6                 | call                esi
            //   a1????????           |                     
            //   50                   | push                eax

        $sequence_8 = { 52 0fb610 51 52 68???????? 68???????? ff15???????? }
            // n = 7, score = 600
            //   52                   | push                edx
            //   0fb610               | movzx               edx, byte ptr [eax]
            //   51                   | push                ecx
            //   52                   | push                edx
            //   68????????           |                     
            //   68????????           |                     
            //   ff15????????         |                     

        $sequence_9 = { ffd6 8b15???????? 33c0 52 a3???????? a3???????? a3???????? }
            // n = 7, score = 600
            //   ffd6                 | call                esi
            //   8b15????????         |                     
            //   33c0                 | xor                 eax, eax
            //   52                   | push                edx
            //   a3????????           |                     
            //   a3????????           |                     
            //   a3????????           |                     

    condition:
        7 of them and filesize < 591872
}