rule win_fusiondrive_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.fusiondrive."
        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.fusiondrive"
        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???????? 90 488d1d56470100 488d35ef2b0100 48895c2420 488d054b470100 483bd8 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   90                   | dec                 eax
            //   488d1d56470100       | arpl                word ptr [edx + 0xc], dx
            //   488d35ef2b0100       | dec                 ecx
            //   48895c2420           | add                 edx, eax
            //   488d054b470100       | dec                 esp
            //   483bd8               | lea                 eax, [0xffffa0c4]

        $sequence_1 = { 4883ec20 8b1d???????? eb1d 488d058b6c0100 ffcb 488d0c9b }
            // n = 6, score = 100
            //   4883ec20             | dec                 eax
            //   8b1d????????         |                     
            //   eb1d                 | cmp                 ebx, edi
            //   488d058b6c0100       | je                  0x489
            //   ffcb                 | dec                 eax
            //   488d0c9b             | arpl                word ptr [edi + 8], dx

        $sequence_2 = { 4c8d05896b0100 33d2 488d4c2468 ff15???????? 85c0 0f95c3 84db }
            // n = 7, score = 100
            //   4c8d05896b0100       | dec                 eax
            //   33d2                 | mov                 edx, ebx
            //   488d4c2468           | dec                 eax
            //   ff15????????         |                     
            //   85c0                 | lea                 ecx, [ebp + 7]
            //   0f95c3               | dec                 eax
            //   84db                 | lea                 edx, [ebp + 7]

        $sequence_3 = { 57 4883ec20 418bf0 4c8d0d77810000 8bda }
            // n = 5, score = 100
            //   57                   | dec                 eax
            //   4883ec20             | mov                 esi, ebx
            //   418bf0               | dec                 eax
            //   4c8d0d77810000       | sar                 esi, 6
            //   8bda                 | dec                 eax

        $sequence_4 = { 85c0 0f84ae020000 c744245804000000 897c2420 4c8d4c2458 4c8d842480000000 }
            // n = 6, score = 100
            //   85c0                 | mov                 edi, edx
            //   0f84ae020000         | dec                 ebp
            //   c744245804000000     | cmovne              ebx, ecx
            //   897c2420             | dec                 eax
            //   4c8d4c2458           | test                edx, edx
            //   4c8d842480000000     | inc                 ecx

        $sequence_5 = { 4c8d0db9330100 4c8bc0 b201 b9fdffffff e8???????? c605????????01 b001 }
            // n = 7, score = 100
            //   4c8d0db9330100       | dec                 eax
            //   4c8bc0               | mov                 dword ptr [esp + 0x30], eax
            //   b201                 | inc                 ebp
            //   b9fdffffff           | xor                 edx, edx
            //   e8????????           |                     
            //   c605????????01       |                     
            //   b001                 | dec                 esp

        $sequence_6 = { 48c1f806 488d0d80000100 4183e23f 4903e8 }
            // n = 4, score = 100
            //   48c1f806             | dec                 eax
            //   488d0d80000100       | mov                 dword ptr [ebp - 9], edi
            //   4183e23f             | dec                 eax
            //   4903e8               | mov                 dword ptr [ebp - 1], 7

        $sequence_7 = { e8???????? 837b1000 75dd 488d051bf90000 483bd8 }
            // n = 5, score = 100
            //   e8????????           |                     
            //   837b1000             | dec                 eax
            //   75dd                 | add                 eax, eax
            //   488d051bf90000       | inc                 ecx
            //   483bd8               | mov                 eax, dword ptr [edi + eax*8 + 0x13bb0]

        $sequence_8 = { 8bd9 4c8d0d4d820000 b904000000 4c8d0539820000 }
            // n = 4, score = 100
            //   8bd9                 | je                  0x10c0
            //   4c8d0d4d820000       | dec                 eax
            //   b904000000           | lea                 edi, [esp + 0x20]
            //   4c8d0539820000       | dec                 ecx

        $sequence_9 = { 41ffc0 0fb60a 83e10f 4a0fbe8411a8150100 }
            // n = 4, score = 100
            //   41ffc0               | mov                 ebx, ecx
            //   0fb60a               | dec                 esp
            //   83e10f               | lea                 ecx, [0xb6dc]
            //   4a0fbe8411a8150100     | inc    eax

    condition:
        7 of them and filesize < 290816
}