rule win_avaddon_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.avaddon."
        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.avaddon"
        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 = { 85f6 0f8486630000 8b4d10 85c9 0f847b630000 394514 0f8472630000 }
            // n = 7, score = 200
            //   85f6                 | test                esi, esi
            //   0f8486630000         | je                  0x638c
            //   8b4d10               | mov                 ecx, dword ptr [ebp + 0x10]
            //   85c9                 | test                ecx, ecx
            //   0f847b630000         | je                  0x6381
            //   394514               | cmp                 dword ptr [ebp + 0x14], eax
            //   0f8472630000         | je                  0x6378

        $sequence_1 = { e8???????? 84c0 0f84f9000000 8d45d8 50 8d5598 }
            // n = 6, score = 200
            //   e8????????           |                     
            //   84c0                 | test                al, al
            //   0f84f9000000         | je                  0xff
            //   8d45d8               | lea                 eax, [ebp - 0x28]
            //   50                   | push                eax
            //   8d5598               | lea                 edx, [ebp - 0x68]

        $sequence_2 = { 8bc6 7202 8b06 8d4ddc 51 8d4dd8 }
            // n = 6, score = 200
            //   8bc6                 | mov                 eax, esi
            //   7202                 | jb                  4
            //   8b06                 | mov                 eax, dword ptr [esi]
            //   8d4ddc               | lea                 ecx, [ebp - 0x24]
            //   51                   | push                ecx
            //   8d4dd8               | lea                 ecx, [ebp - 0x28]

        $sequence_3 = { 50 52 e8???????? 51 8d45a4 c645fc02 50 }
            // n = 7, score = 200
            //   50                   | push                eax
            //   52                   | push                edx
            //   e8????????           |                     
            //   51                   | push                ecx
            //   8d45a4               | lea                 eax, [ebp - 0x5c]
            //   c645fc02             | mov                 byte ptr [ebp - 4], 2
            //   50                   | push                eax

        $sequence_4 = { 8bc8 85c9 742c 8b45e8 3bc8 7716 837dec08 }
            // n = 7, score = 200
            //   8bc8                 | mov                 ecx, eax
            //   85c9                 | test                ecx, ecx
            //   742c                 | je                  0x2e
            //   8b45e8               | mov                 eax, dword ptr [ebp - 0x18]
            //   3bc8                 | cmp                 ecx, eax
            //   7716                 | ja                  0x18
            //   837dec08             | cmp                 dword ptr [ebp - 0x14], 8

        $sequence_5 = { 8bc8 83c410 83f9ff 7468 33c0 c744242000000000 6689442410 }
            // n = 7, score = 200
            //   8bc8                 | mov                 ecx, eax
            //   83c410               | add                 esp, 0x10
            //   83f9ff               | cmp                 ecx, -1
            //   7468                 | je                  0x6a
            //   33c0                 | xor                 eax, eax
            //   c744242000000000     | mov                 dword ptr [esp + 0x20], 0
            //   6689442410           | mov                 word ptr [esp + 0x10], ax

        $sequence_6 = { c645fc1c eb47 3bc2 766a 83ec10 8d85c4feffff }
            // n = 6, score = 200
            //   c645fc1c             | mov                 byte ptr [ebp - 4], 0x1c
            //   eb47                 | jmp                 0x49
            //   3bc2                 | cmp                 eax, edx
            //   766a                 | jbe                 0x6c
            //   83ec10               | sub                 esp, 0x10
            //   8d85c4feffff         | lea                 eax, [ebp - 0x13c]

        $sequence_7 = { 50 6a04 8d45f8 c745f404000000 50 6a14 ff75f0 }
            // n = 7, score = 200
            //   50                   | push                eax
            //   6a04                 | push                4
            //   8d45f8               | lea                 eax, [ebp - 8]
            //   c745f404000000       | mov                 dword ptr [ebp - 0xc], 4
            //   50                   | push                eax
            //   6a14                 | push                0x14
            //   ff75f0               | push                dword ptr [ebp - 0x10]

        $sequence_8 = { 8945ec 03c1 8945e8 ff750c c745fc00000000 8d4820 }
            // n = 6, score = 200
            //   8945ec               | mov                 dword ptr [ebp - 0x14], eax
            //   03c1                 | add                 eax, ecx
            //   8945e8               | mov                 dword ptr [ebp - 0x18], eax
            //   ff750c               | push                dword ptr [ebp + 0xc]
            //   c745fc00000000       | mov                 dword ptr [ebp - 4], 0
            //   8d4820               | lea                 ecx, [eax + 0x20]

        $sequence_9 = { 8bf9 8b0f 85c9 7444 8b5704 51 e8???????? }
            // n = 7, score = 200
            //   8bf9                 | mov                 edi, ecx
            //   8b0f                 | mov                 ecx, dword ptr [edi]
            //   85c9                 | test                ecx, ecx
            //   7444                 | je                  0x46
            //   8b5704               | mov                 edx, dword ptr [edi + 4]
            //   51                   | push                ecx
            //   e8????????           |                     

    condition:
        7 of them and filesize < 2343936
}