rule win_whiteblackcrypt_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.whiteblackcrypt."
        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.whiteblackcrypt"
        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 = { ffd7 83f804 74d8 ffc3 83fb1a }
            // n = 5, score = 100
            //   ffd7                 | dec                 eax
            //   83f804               | lea                 ecx, [0x1db2]
            //   74d8                 | dec                 eax
            //   ffc3                 | mov                 dword ptr [esp + 0x30], eax
            //   83fb1a               | inc                 ecx

        $sequence_1 = { 48897808 ff15???????? 488b05???????? 488d0d84660000 }
            // n = 4, score = 100
            //   48897808             | xor                 ebp, ecx
            //   ff15????????         |                     
            //   488b05????????       |                     
            //   488d0d84660000       | movzx               ecx, cl

        $sequence_2 = { 83fb0a 418a4301 41885301 418a5309 41885305 418a530d 4188430d }
            // n = 7, score = 100
            //   83fb0a               | dec                 eax
            //   418a4301             | test                ebp, ebp
            //   41885301             | je                  0xb0
            //   418a5309             | dec                 eax
            //   41885305             | lea                 ecx, [0x3d58]
            //   418a530d             | jne                 0xc7
            //   4188430d             | dec                 eax

        $sequence_3 = { 4889d9 e8???????? 4401e6 4d63c4 4889f9 4989d9 ba01000000 }
            // n = 7, score = 100
            //   4889d9               | dec                 eax
            //   e8????????           |                     
            //   4401e6               | add                 esp, 0x158
            //   4d63c4               | pop                 ebx
            //   4889f9               | dec                 eax
            //   4989d9               | mov                 edx, esi
            //   ba01000000           | test                eax, eax

        $sequence_4 = { 488d0d287a0000 4889c2 488905???????? e8???????? 488d0da8420000 }
            // n = 5, score = 100
            //   488d0d287a0000       | lea                 ecx, [0x1679]
            //   4889c2               | xor                 eax, eax
            //   488905????????       |                     
            //   e8????????           |                     
            //   488d0da8420000       | imul                eax, edx

        $sequence_5 = { 790d b910270000 ff15???????? ebea e8???????? b805000030 31c9 }
            // n = 7, score = 100
            //   790d                 | dec                 eax
            //   b910270000           | mov                 eax, ecx
            //   ff15????????         |                     
            //   ebea                 | dec                 eax
            //   e8????????           |                     
            //   b805000030           | mov                 ecx, dword ptr [eax + 0x10]
            //   31c9                 | dec                 eax

        $sequence_6 = { 66894306 0fb7442428 66894308 0fb744242a 6689430a }
            // n = 5, score = 100
            //   66894306             | mov                 ebp, ecx
            //   0fb7442428           | inc                 ecx
            //   66894308             | mov                 edi, ecx
            //   0fb744242a           | inc                 ecx
            //   6689430a             | movzx               ecx, ah

        $sequence_7 = { ff15???????? 488d542468 4889c1 ff15???????? b902000000 }
            // n = 5, score = 100
            //   ff15????????         |                     
            //   488d542468           | test                ebx, ebx
            //   4889c1               | mov                 dword ptr [eax], 0
            //   ff15????????         |                     
            //   b902000000           | je                  0x9c3

        $sequence_8 = { e8???????? 0fb64c243c 89c7 e8???????? 0fb6c8 884c243f e8???????? }
            // n = 7, score = 100
            //   e8????????           |                     
            //   0fb64c243c           | mov                 ecx, esi
            //   89c7                 | mov                 byte ptr [esp + 0x2c], al
            //   e8????????           |                     
            //   0fb6c8               | call                edi
            //   884c243f             | cmp                 eax, 3
            //   e8????????           |                     

        $sequence_9 = { 4c01cb 3c5c 7496 3c2f 7492 }
            // n = 5, score = 100
            //   4c01cb               | movzx               edx, byte ptr [esi + 2]
            //   3c5c                 | cmp                 al, 0x5c
            //   7496                 | je                  0x42
            //   3c2f                 | cmp                 al, 0x2f
            //   7492                 | je                  0x42

    condition:
        7 of them and filesize < 99328
}