rule win_crackedcantil_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.crackedcantil."
        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.crackedcantil"
        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 = { f30f7f00 488b8580010000 4883c020 488985e00d0000 488d85104d0000 f30f6f00 660f7f8590310000 }
            // n = 7, score = 100
            //   f30f7f00             | cmp                 dword ptr [esp + 4], eax
            //   488b8580010000       | jg                  0xe27
            //   4883c020             | dec                 eax
            //   488985e00d0000       | mov                 eax, dword ptr [esp + 0x30]
            //   488d85104d0000       | movzx               ecx, word ptr [esp + 4]
            //   f30f6f00             | mov                 eax, ecx
            //   660f7f8590310000     | mov                 dword ptr [esp + 4], eax

        $sequence_1 = { e8???????? 488d1517fc2400 488b8c24601b0000 e8???????? 8b442430 83c801 89442430 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   488d1517fc2400       | mov                 eax, 2
            //   488b8c24601b0000     | dec                 eax
            //   e8????????           |                     
            //   8b442430             | mov                 eax, dword ptr [esp + 0x28]
            //   83c801               | dec                 eax
            //   89442430             | mov                 edx, dword ptr [eax + 0x10]

        $sequence_2 = { c1e203 4863d2 4c8d05dbd40d00 418b541001 8b440104 33c2 8b4c2438 }
            // n = 7, score = 100
            //   c1e203               | mov                 eax, eax
            //   4863d2               | cmp                 dword ptr [esp + 0x48], 0
            //   4c8d05dbd40d00       | jne                 0x19df
            //   418b541001           | dec                 eax
            //   8b440104             | mov                 ecx, dword ptr [esp + 0x40]
            //   33c2                 | mov                 eax, dword ptr [esp + 0x20]
            //   8b4c2438             | jmp                 0x1a15

        $sequence_3 = { e9???????? 9c 6821a87c73 48891c24 53 48813424dbe8ef3f 5b }
            // n = 7, score = 100
            //   e9????????           |                     
            //   9c                   | mov                 eax, dword ptr [eax + 0x38]
            //   6821a87c73           | add                 eax, dword ptr [esp + 0x50]
            //   48891c24             | dec                 eax
            //   53                   | mov                 ecx, dword ptr [esp + 0x250]
            //   48813424dbe8ef3f     | mov                 dword ptr [ecx + 0x38], eax
            //   5b                   | jmp                 0xe9e

        $sequence_4 = { e8???????? 0fb68424c7000000 85c0 7405 e9???????? 488d8424002f0000 4889842448140000 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   0fb68424c7000000     | mov                 ecx, dword ptr [esp + 0x38]
            //   85c0                 | dec                 eax
            //   7405                 | mov                 dword ptr [esp + 0x30], eax
            //   e9????????           |                     
            //   488d8424002f0000     | jmp                 0x197c
            //   4889842448140000     | mov                 eax, 8

        $sequence_5 = { eb7a b818000000 486bc03c 488d0d29541a00 48894c2460 48c744243800000000 48c744243000000000 }
            // n = 7, score = 100
            //   eb7a                 | mov                 dword ptr [esp + 0x24], eax
            //   b818000000           | mov                 ecx, dword ptr [esp + 0x2c]
            //   486bc03c             | add                 ecx, eax
            //   488d0d29541a00       | mov                 eax, ecx
            //   48894c2460           | mov                 ecx, 4
            //   48c744243800000000     | dec    eax
            //   48c744243000000000     | imul    ecx, ecx, 0

        $sequence_6 = { e8???????? eb51 837c245400 7c4a 488b442478 0fbf400a 89442450 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   eb51                 | je                  0x57c
            //   837c245400           | mov                 eax, dword ptr [esp + 0x98]
            //   7c4a                 | dec                 esp
            //   488b442478           | lea                 eax, [esp + 0xa0]
            //   0fbf400a             | dec                 eax
            //   89442450             | mov                 edx, dword ptr [esp + 0x60]

        $sequence_7 = { f3aa 0fb644245a 88842490010000 660f6f842490190000 660f7f8424d00f0000 488b842408030000 f30f6f00 }
            // n = 7, score = 100
            //   f3aa                 | mov                 dword ptr [esp + 0x570], eax
            //   0fb644245a           | mov                 eax, 8
            //   88842490010000       | dec                 eax
            //   660f6f842490190000     | imul    eax, eax, 5
            //   660f7f8424d00f0000     | mov    ecx, ecx
            //   488b842408030000     | dec                 eax
            //   f30f6f00             | lea                 edx, [0x9feff]

        $sequence_8 = { f30f7f00 488b8424b80f0000 4889842428150000 488b942428150000 488d8c2440470000 e8???????? 90 }
            // n = 7, score = 100
            //   f30f7f00             | dec                 ecx
            //   488b8424b80f0000     | mov                 ecx, ecx
            //   4889842428150000     | mov                 eax, eax
            //   488b942428150000     | dec                 eax
            //   488d8c2440470000     | mov                 ecx, dword ptr [esp + 0x118]
            //   e8????????           |                     
            //   90                   | dec                 eax

        $sequence_9 = { eb23 488b442428 0fb74012 83e020 85c0 7413 488b442428 }
            // n = 7, score = 100
            //   eb23                 | mov                 eax, dword ptr [esp + 0x70]
            //   488b442428           | cmp                 dword ptr [esp + 0x48], eax
            //   0fb74012             | je                  0x1155
            //   83e020               | mov                 edx, dword ptr [esp + 0x48]
            //   85c0                 | dec                 eax
            //   7413                 | mov                 ecx, dword ptr [esp + 0x100]
            //   488b442428           | dec                 eax

    condition:
        7 of them and filesize < 37863424
}