rule win_fonix_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.fonix."
        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.fonix"
        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 = { 42 6bd206 8b75c4 8a84c1f0bb4c00 880416 8b45dc c1e808 }
            // n = 7, score = 100
            //   42                   | inc                 edx
            //   6bd206               | imul                edx, edx, 6
            //   8b75c4               | mov                 esi, dword ptr [ebp - 0x3c]
            //   8a84c1f0bb4c00       | mov                 al, byte ptr [ecx + eax*8 + 0x4cbbf0]
            //   880416               | mov                 byte ptr [esi + edx], al
            //   8b45dc               | mov                 eax, dword ptr [ebp - 0x24]
            //   c1e808               | shr                 eax, 8

        $sequence_1 = { 7416 e8???????? 8d8d98faffff c645fc06 e8???????? eb22 }
            // n = 6, score = 100
            //   7416                 | je                  0x18
            //   e8????????           |                     
            //   8d8d98faffff         | lea                 ecx, [ebp - 0x568]
            //   c645fc06             | mov                 byte ptr [ebp - 4], 6
            //   e8????????           |                     
            //   eb22                 | jmp                 0x24

        $sequence_2 = { 68???????? 8d8dc0fcffff c645fc18 e8???????? 68???????? 8d8dd8fcffff c645fc19 }
            // n = 7, score = 100
            //   68????????           |                     
            //   8d8dc0fcffff         | lea                 ecx, [ebp - 0x340]
            //   c645fc18             | mov                 byte ptr [ebp - 4], 0x18
            //   e8????????           |                     
            //   68????????           |                     
            //   8d8dd8fcffff         | lea                 ecx, [ebp - 0x328]
            //   c645fc19             | mov                 byte ptr [ebp - 4], 0x19

        $sequence_3 = { c5fe7f85a0e9ffff c5fe6f85a0e9ffff c5fe7f85c0feffff c5fe6f8540feffff c5fdfe8560fdffff c5fe7f8580e9ffff }
            // n = 6, score = 100
            //   c5fe7f85a0e9ffff     | vmovdqu             ymmword ptr [ebp - 0x1660], ymm0
            //   c5fe6f85a0e9ffff     | vmovdqu             ymm0, ymmword ptr [ebp - 0x1660]
            //   c5fe7f85c0feffff     | vmovdqu             ymmword ptr [ebp - 0x140], ymm0
            //   c5fe6f8540feffff     | vmovdqu             ymm0, ymmword ptr [ebp - 0x1c0]
            //   c5fdfe8560fdffff     | vpaddd              ymm0, ymm0, ymmword ptr [ebp - 0x2a0]
            //   c5fe7f8580e9ffff     | vmovdqu             ymmword ptr [ebp - 0x1680], ymm0

        $sequence_4 = { 85f6 7408 8b06 8bce 6a01 ff10 8d8d5cffffff }
            // n = 7, score = 100
            //   85f6                 | test                esi, esi
            //   7408                 | je                  0xa
            //   8b06                 | mov                 eax, dword ptr [esi]
            //   8bce                 | mov                 ecx, esi
            //   6a01                 | push                1
            //   ff10                 | call                dword ptr [eax]
            //   8d8d5cffffff         | lea                 ecx, [ebp - 0xa4]

        $sequence_5 = { c700???????? c74708???????? c74720ac294b00 e8???????? c3 c701???????? }
            // n = 6, score = 100
            //   c700????????         |                     
            //   c74708????????       |                     
            //   c74720ac294b00       | mov                 dword ptr [edi + 0x20], 0x4b29ac
            //   e8????????           |                     
            //   c3                   | ret                 
            //   c701????????         |                     

        $sequence_6 = { 8b55fc 8b4c8a08 c1e900 0fb6c9 0fb68950734900 3304cd03c44c00 8b4df8 }
            // n = 7, score = 100
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   8b4c8a08             | mov                 ecx, dword ptr [edx + ecx*4 + 8]
            //   c1e900               | shr                 ecx, 0
            //   0fb6c9               | movzx               ecx, cl
            //   0fb68950734900       | movzx               ecx, byte ptr [ecx + 0x497350]
            //   3304cd03c44c00       | xor                 eax, dword ptr [ecx*8 + 0x4cc403]
            //   8b4df8               | mov                 ecx, dword ptr [ebp - 8]

        $sequence_7 = { e8???????? 8d8df4fbffff 8bf0 e8???????? 83feff 0f85f3010000 80bd4ffcffff00 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   8d8df4fbffff         | lea                 ecx, [ebp - 0x40c]
            //   8bf0                 | mov                 esi, eax
            //   e8????????           |                     
            //   83feff               | cmp                 esi, -1
            //   0f85f3010000         | jne                 0x1f9
            //   80bd4ffcffff00       | cmp                 byte ptr [ebp - 0x3b1], 0

        $sequence_8 = { eb02 32c0 e8???????? c21000 68???????? }
            // n = 5, score = 100
            //   eb02                 | jmp                 4
            //   32c0                 | xor                 al, al
            //   e8????????           |                     
            //   c21000               | ret                 0x10
            //   68????????           |                     

        $sequence_9 = { 8d4dc4 e8???????? 56 e8???????? 59 57 e8???????? }
            // n = 7, score = 100
            //   8d4dc4               | lea                 ecx, [ebp - 0x3c]
            //   e8????????           |                     
            //   56                   | push                esi
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   57                   | push                edi
            //   e8????????           |                     

    condition:
        7 of them and filesize < 2226176
}