rule win_octowave_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.octowave."
        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.octowave"
        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 = { ffd0 84c0 7527 807c241401 7513 384334 740e }
            // n = 7, score = 100
            //   ffd0                 | call                eax
            //   84c0                 | test                al, al
            //   7527                 | jne                 0x29
            //   807c241401           | cmp                 byte ptr [esp + 0x14], 1
            //   7513                 | jne                 0x15
            //   384334               | cmp                 byte ptr [ebx + 0x34], al
            //   740e                 | je                  0x10

        $sequence_1 = { ff7514 ff7510 ff750c ff7508 e8???????? 84c0 7518 }
            // n = 7, score = 100
            //   ff7514               | push                dword ptr [ebp + 0x14]
            //   ff7510               | push                dword ptr [ebp + 0x10]
            //   ff750c               | push                dword ptr [ebp + 0xc]
            //   ff7508               | push                dword ptr [ebp + 8]
            //   e8????????           |                     
            //   84c0                 | test                al, al
            //   7518                 | jne                 0x1a

        $sequence_2 = { ff75f8 ff75f4 57 e8???????? ff75e8 894610 e8???????? }
            // n = 7, score = 100
            //   ff75f8               | push                dword ptr [ebp - 8]
            //   ff75f4               | push                dword ptr [ebp - 0xc]
            //   57                   | push                edi
            //   e8????????           |                     
            //   ff75e8               | push                dword ptr [ebp - 0x18]
            //   894610               | mov                 dword ptr [esi + 0x10], eax
            //   e8????????           |                     

        $sequence_3 = { bd08000000 e8???????? 83c408 33f6 8b4308 0fb60430 50 }
            // n = 7, score = 100
            //   bd08000000           | mov                 ebp, 8
            //   e8????????           |                     
            //   83c408               | add                 esp, 8
            //   33f6                 | xor                 esi, esi
            //   8b4308               | mov                 eax, dword ptr [ebx + 8]
            //   0fb60430             | movzx               eax, byte ptr [eax + esi]
            //   50                   | push                eax

        $sequence_4 = { ff34857c712d10 8d46ff 50 ff7518 e8???????? 8b55f8 83c410 }
            // n = 7, score = 100
            //   ff34857c712d10       | push                dword ptr [eax*4 + 0x102d717c]
            //   8d46ff               | lea                 eax, [esi - 1]
            //   50                   | push                eax
            //   ff7518               | push                dword ptr [ebp + 0x18]
            //   e8????????           |                     
            //   8b55f8               | mov                 edx, dword ptr [ebp - 8]
            //   83c410               | add                 esp, 0x10

        $sequence_5 = { e8???????? 8bc8 83f9ff 0f8413010000 8bc6 83ff0f 7602 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   8bc8                 | mov                 ecx, eax
            //   83f9ff               | cmp                 ecx, -1
            //   0f8413010000         | je                  0x119
            //   8bc6                 | mov                 eax, esi
            //   83ff0f               | cmp                 edi, 0xf
            //   7602                 | jbe                 4

        $sequence_6 = { f30f5c442454 0f28e3 f30f114c241c f30f59e1 f30f100d???????? f30f11442404 f30f59442470 }
            // n = 7, score = 100
            //   f30f5c442454         | subss               xmm0, dword ptr [esp + 0x54]
            //   0f28e3               | movaps              xmm4, xmm3
            //   f30f114c241c         | movss               dword ptr [esp + 0x1c], xmm1
            //   f30f59e1             | mulss               xmm4, xmm1
            //   f30f100d????????     |                     
            //   f30f11442404         | movss               dword ptr [esp + 4], xmm0
            //   f30f59442470         | mulss               xmm0, dword ptr [esp + 0x70]

        $sequence_7 = { ff86201b0000 8b86201b0000 c684302013000000 52 55 ff742420 ff74242c }
            // n = 7, score = 100
            //   ff86201b0000         | inc                 dword ptr [esi + 0x1b20]
            //   8b86201b0000         | mov                 eax, dword ptr [esi + 0x1b20]
            //   c684302013000000     | mov                 byte ptr [eax + esi + 0x1320], 0
            //   52                   | push                edx
            //   55                   | push                ebp
            //   ff742420             | push                dword ptr [esp + 0x20]
            //   ff74242c             | push                dword ptr [esp + 0x2c]

        $sequence_8 = { f30f59f7 f30f5cd8 f30f58e6 0f28f3 39442470 7e5a 8b4c247c }
            // n = 7, score = 100
            //   f30f59f7             | mulss               xmm6, xmm7
            //   f30f5cd8             | subss               xmm3, xmm0
            //   f30f58e6             | addss               xmm4, xmm6
            //   0f28f3               | movaps              xmm6, xmm3
            //   39442470             | cmp                 dword ptr [esp + 0x70], eax
            //   7e5a                 | jle                 0x5c
            //   8b4c247c             | mov                 ecx, dword ptr [esp + 0x7c]

        $sequence_9 = { ff742420 ff742420 68???????? 56 e8???????? 0fb6442476 50 }
            // n = 7, score = 100
            //   ff742420             | push                dword ptr [esp + 0x20]
            //   ff742420             | push                dword ptr [esp + 0x20]
            //   68????????           |                     
            //   56                   | push                esi
            //   e8????????           |                     
            //   0fb6442476           | movzx               eax, byte ptr [esp + 0x76]
            //   50                   | push                eax

    condition:
        7 of them and filesize < 7258112
}