rule win_isaacwiper_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.isaacwiper."
        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.isaacwiper"
        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 = { 81ec18010000 56 57 6a00 8d4c241c e8???????? 8b3d???????? }
            // n = 7, score = 100
            //   81ec18010000         | sub                 esp, 0x118
            //   56                   | push                esi
            //   57                   | push                edi
            //   6a00                 | push                0
            //   8d4c241c             | lea                 ecx, [esp + 0x1c]
            //   e8????????           |                     
            //   8b3d????????         |                     

        $sequence_1 = { ff5010 0fb7c0 89442410 8a03 3c7f 0f8492000000 84c0 }
            // n = 7, score = 100
            //   ff5010               | call                dword ptr [eax + 0x10]
            //   0fb7c0               | movzx               eax, ax
            //   89442410             | mov                 dword ptr [esp + 0x10], eax
            //   8a03                 | mov                 al, byte ptr [ebx]
            //   3c7f                 | cmp                 al, 0x7f
            //   0f8492000000         | je                  0x98
            //   84c0                 | test                al, al

        $sequence_2 = { 331486 81e2ffffff7f 331486 8bca d1ea }
            // n = 5, score = 100
            //   331486               | xor                 edx, dword ptr [esi + eax*4]
            //   81e2ffffff7f         | and                 edx, 0x7fffffff
            //   331486               | xor                 edx, dword ptr [esi + eax*4]
            //   8bca                 | mov                 ecx, edx
            //   d1ea                 | shr                 edx, 1

        $sequence_3 = { e8???????? 8ad0 83c404 33c0 85db }
            // n = 5, score = 100
            //   e8????????           |                     
            //   8ad0                 | mov                 dl, al
            //   83c404               | add                 esp, 4
            //   33c0                 | xor                 eax, eax
            //   85db                 | test                ebx, ebx

        $sequence_4 = { e8???????? 8b4de0 8b01 8b4008 ffd0 85c0 740a }
            // n = 7, score = 100
            //   e8????????           |                     
            //   8b4de0               | mov                 ecx, dword ptr [ebp - 0x20]
            //   8b01                 | mov                 eax, dword ptr [ecx]
            //   8b4008               | mov                 eax, dword ptr [eax + 8]
            //   ffd0                 | call                eax
            //   85c0                 | test                eax, eax
            //   740a                 | je                  0xc

        $sequence_5 = { 8bc8 e8???????? 8bce c744242000000000 }
            // n = 4, score = 100
            //   8bc8                 | mov                 ecx, eax
            //   e8????????           |                     
            //   8bce                 | mov                 ecx, esi
            //   c744242000000000     | mov                 dword ptr [esp + 0x20], 0

        $sequence_6 = { c1e80b 47 33c8 897df8 8bc1 25ad583aff c1e007 }
            // n = 7, score = 100
            //   c1e80b               | shr                 eax, 0xb
            //   47                   | inc                 edi
            //   33c8                 | xor                 ecx, eax
            //   897df8               | mov                 dword ptr [ebp - 8], edi
            //   8bc1                 | mov                 eax, ecx
            //   25ad583aff           | and                 eax, 0xff3a58ad
            //   c1e007               | shl                 eax, 7

        $sequence_7 = { 57 6bf838 8955fc 8b0495e8670310 }
            // n = 4, score = 100
            //   57                   | push                edi
            //   6bf838               | imul                edi, eax, 0x38
            //   8955fc               | mov                 dword ptr [ebp - 4], edx
            //   8b0495e8670310       | mov                 eax, dword ptr [edx*4 + 0x100367e8]

        $sequence_8 = { 0f84dd000000 50 8d458c 50 e8???????? }
            // n = 5, score = 100
            //   0f84dd000000         | je                  0xe3
            //   50                   | push                eax
            //   8d458c               | lea                 eax, [ebp - 0x74]
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_9 = { 8d41e0 89443184 8b4698 8b4004 c7443098d8270310 8b4698 }
            // n = 6, score = 100
            //   8d41e0               | lea                 eax, [ecx - 0x20]
            //   89443184             | mov                 dword ptr [ecx + esi - 0x7c], eax
            //   8b4698               | mov                 eax, dword ptr [esi - 0x68]
            //   8b4004               | mov                 eax, dword ptr [eax + 4]
            //   c7443098d8270310     | mov                 dword ptr [eax + esi - 0x68], 0x100327d8
            //   8b4698               | mov                 eax, dword ptr [esi - 0x68]

    condition:
        7 of them and filesize < 467968
}