rule win_cryptoshuffler_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        version = "1"
        description = "Detects win.cryptoshuffler."
        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.cryptoshuffler"
        malpedia_rule_date = "20260422"
        malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14"
        malpedia_version = "20260504"
        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 = { c745e05c4c0210 e9???????? c745e0644c0210 e9???????? }
            // n = 4, score = 100
            //   c745e05c4c0210       | mov                 dword ptr [ebp - 0x20], 0x10024c5c
            //   e9????????           |                     
            //   c745e0644c0210       | mov                 dword ptr [ebp - 0x20], 0x10024c64
            //   e9????????           |                     

        $sequence_1 = { 8b7508 57 8b7d0c 8955f8 894dd4 }
            // n = 5, score = 100
            //   8b7508               | mov                 esi, dword ptr [ebp + 8]
            //   57                   | push                edi
            //   8b7d0c               | mov                 edi, dword ptr [ebp + 0xc]
            //   8955f8               | mov                 dword ptr [ebp - 8], edx
            //   894dd4               | mov                 dword ptr [ebp - 0x2c], ecx

        $sequence_2 = { 8bc7 894de4 399828e10210 0f84ea000000 41 83c030 }
            // n = 6, score = 100
            //   8bc7                 | mov                 eax, edi
            //   894de4               | mov                 dword ptr [ebp - 0x1c], ecx
            //   399828e10210         | cmp                 dword ptr [eax + 0x1002e128], ebx
            //   0f84ea000000         | je                  0xf0
            //   41                   | inc                 ecx
            //   83c030               | add                 eax, 0x30

        $sequence_3 = { 8b5d08 8b550c 8b7510 c745dc00000000 }
            // n = 4, score = 100
            //   8b5d08               | mov                 ebx, dword ptr [ebp + 8]
            //   8b550c               | mov                 edx, dword ptr [ebp + 0xc]
            //   8b7510               | mov                 esi, dword ptr [ebp + 0x10]
            //   c745dc00000000       | mov                 dword ptr [ebp - 0x24], 0

        $sequence_4 = { 660fd645e8 85ff 742f 8bd7 85d2 }
            // n = 5, score = 100
            //   660fd645e8           | movq                qword ptr [ebp - 0x18], xmm0
            //   85ff                 | test                edi, edi
            //   742f                 | je                  0x31
            //   8bd7                 | mov                 edx, edi
            //   85d2                 | test                edx, edx

        $sequence_5 = { 8bf1 e8???????? 8bd0 0f57c0 83c404 8955fc }
            // n = 6, score = 100
            //   8bf1                 | mov                 esi, ecx
            //   e8????????           |                     
            //   8bd0                 | mov                 edx, eax
            //   0f57c0               | xorps               xmm0, xmm0
            //   83c404               | add                 esp, 4
            //   8955fc               | mov                 dword ptr [ebp - 4], edx

        $sequence_6 = { c745fc00000000 833d????????00 8945e0 897de4 897dd4 c745e800000000 }
            // n = 6, score = 100
            //   c745fc00000000       | mov                 dword ptr [ebp - 4], 0
            //   833d????????00       |                     
            //   8945e0               | mov                 dword ptr [ebp - 0x20], eax
            //   897de4               | mov                 dword ptr [ebp - 0x1c], edi
            //   897dd4               | mov                 dword ptr [ebp - 0x2c], edi
            //   c745e800000000       | mov                 dword ptr [ebp - 0x18], 0

        $sequence_7 = { 0f84bc000000 6aff 53 8d45d0 50 8d4d08 }
            // n = 6, score = 100
            //   0f84bc000000         | je                  0xc2
            //   6aff                 | push                -1
            //   53                   | push                ebx
            //   8d45d0               | lea                 eax, [ebp - 0x30]
            //   50                   | push                eax
            //   8d4d08               | lea                 ecx, [ebp + 8]

        $sequence_8 = { e8???????? c7460c00000000 6a00 8bce c745fc00000000 e8???????? }
            // n = 6, score = 100
            //   e8????????           |                     
            //   c7460c00000000       | mov                 dword ptr [esi + 0xc], 0
            //   6a00                 | push                0
            //   8bce                 | mov                 ecx, esi
            //   c745fc00000000       | mov                 dword ptr [ebp - 4], 0
            //   e8????????           |                     

        $sequence_9 = { 7502 d9e0 833d????????00 0f85d9670000 }
            // n = 4, score = 100
            //   7502                 | jne                 4
            //   d9e0                 | fchs                
            //   833d????????00       |                     
            //   0f85d9670000         | jne                 0x67df

    condition:
        7 of them and filesize < 425984
}