rule win_atomsilo_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.atomsilo."
        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.atomsilo"
        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 = { 486bd204 4c8b442460 8a0408 41880410 0fb6442438 488d0dac7a0900 488d04c1 }
            // n = 7, score = 100
            //   486bd204             | lea                 eax, [edi - 1]
            //   4c8b442460           | dec                 esp
            //   8a0408               | mov                 dword ptr [esp + 0x68], edi
            //   41880410             | dec                 esp
            //   0fb6442438           | mov                 dword ptr [esp + 0x70], edi
            //   488d0dac7a0900       | dec                 esp
            //   488d04c1             | mov                 dword ptr [esp + 0x78], edi

        $sequence_1 = { 6666660f1f840000000000 48ffc9 4883e808 498b1400 483b10 7714 }
            // n = 6, score = 100
            //   6666660f1f840000000000     | dec    eax
            //   48ffc9               | mov                 edi, dword ptr [ebx]
            //   4883e808             | dec                 ebp
            //   498b1400             | mov                 eax, edi
            //   483b10               | dec                 ecx
            //   7714                 | shr                 eax, 0x3f

        $sequence_2 = { 90 488d05752a0700 488906 488b55f7 4883fa10 7232 48ffc2 }
            // n = 7, score = 100
            //   90                   | lea                 ecx, [esp + 0x28]
            //   488d05752a0700       | mov                 dword ptr [esp + 0x50], esi
            //   488906               | dec                 eax
            //   488b55f7             | lea                 edx, [esp + 0x28]
            //   4883fa10             | dec                 eax
            //   7232                 | mov                 ecx, ebx
            //   48ffc2               | nop                 

        $sequence_3 = { 90 4c8d45b0 488d5580 488d4c2420 e8???????? 90 4d8bc4 }
            // n = 7, score = 100
            //   90                   | arpl                cx, cx
            //   4c8d45b0             | mov                 ecx, dword ptr [edx + ecx*4]
            //   488d5580             | shr                 ecx, 8
            //   488d4c2420           | movzx               ecx, cl
            //   e8????????           |                     
            //   90                   | dec                 eax
            //   4d8bc4               | lea                 edx, [0x5baa7]

        $sequence_4 = { 412bc8 83f901 77e0 8bc8 41b807000000 413bc0 440f47c1 }
            // n = 7, score = 100
            //   412bc8               | dec                 ecx
            //   83f901               | mov                 dword ptr [esi + 0x38], ebp
            //   77e0                 | jmp                 0x456
            //   8bc8                 | dec                 eax
            //   41b807000000         | lea                 eax, [0x3e168]
            //   413bc0               | inc                 eax
            //   440f47c1             | test                bh, bh

        $sequence_5 = { 488bd1 488bcf e8???????? 488d059ee70700 488907 8b4320 488b5c2430 }
            // n = 7, score = 100
            //   488bd1               | dec                 eax
            //   488bcf               | stosd               dword ptr es:[edi], eax
            //   e8????????           |                     
            //   488d059ee70700       | dec                 eax
            //   488907               | lea                 ecx, [ebx + 0x78]
            //   8b4320               | dec                 eax
            //   488b5c2430           | mov                 edi, dword ptr [edi - 8]

        $sequence_6 = { e8???????? 4a8d0c6d00000000 4903cd 48c1e104 48034daf 488b5d77 488bd3 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   4a8d0c6d00000000     | dec                 eax
            //   4903cd               | lea                 ecx, [esp + 0x50]
            //   48c1e104             | ret                 
            //   48034daf             | dec                 eax
            //   488b5d77             | lea                 edx, [0x63f60]
            //   488bd3               | dec                 eax

        $sequence_7 = { ff15???????? eb0b 498bce ff15???????? 33c0 4c8bac2410140000 4c8ba42408140000 }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   eb0b                 | test                esi, esi
            //   498bce               | je                  0x7a7
            //   ff15????????         |                     
            //   33c0                 | nop                 dword ptr [eax]
            //   4c8bac2410140000     | dec                 ecx
            //   4c8ba42408140000     | mov                 eax, dword ptr [edi]

        $sequence_8 = { 0f8eb6030000 83f943 7535 448d41be 488d15a17b0200 488d4de0 e8???????? }
            // n = 7, score = 100
            //   0f8eb6030000         | movdqu              xmmword ptr [ebp + 0x17], xmm0
            //   83f943               | movups              xmm0, xmmword ptr [eax]
            //   7535                 | movups              xmmword ptr [ebp + 7], xmm0
            //   448d41be             | movups              xmm1, xmmword ptr [eax + 0x10]
            //   488d15a17b0200       | movups              xmmword ptr [ebp + 0x17], xmm1
            //   488d4de0             | xor                 esi, esi
            //   e8????????           |                     

        $sequence_9 = { 410f47d7 e9???????? 8bc8 85c0 0f84b4feffff 488d04cf 4c2bc7 }
            // n = 7, score = 100
            //   410f47d7             | mov                 dword ptr [esp + 0x28], esi
            //   e9????????           |                     
            //   8bc8                 | dec                 ebp
            //   85c0                 | mov                 esi, ecx
            //   0f84b4feffff         | inc                 eax
            //   488d04cf             | push                edi
            //   4c2bc7               | dec                 eax

    condition:
        7 of them and filesize < 1785856
}