rule win_fk_undead_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.fk_undead."
        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.fk_undead"
        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 = { 7d3f 8b4e40 8d4704 8d563c 8910 894f08 }
            // n = 6, score = 100
            //   7d3f                 | jge                 0x41
            //   8b4e40               | mov                 ecx, dword ptr [esi + 0x40]
            //   8d4704               | lea                 eax, [edi + 4]
            //   8d563c               | lea                 edx, [esi + 0x3c]
            //   8910                 | mov                 dword ptr [eax], edx
            //   894f08               | mov                 dword ptr [edi + 8], ecx

        $sequence_1 = { c70201000000 56 ff15???????? 8b442430 5f 5e 5d }
            // n = 7, score = 100
            //   c70201000000         | mov                 dword ptr [edx], 1
            //   56                   | push                esi
            //   ff15????????         |                     
            //   8b442430             | mov                 eax, dword ptr [esp + 0x30]
            //   5f                   | pop                 edi
            //   5e                   | pop                 esi
            //   5d                   | pop                 ebp

        $sequence_2 = { 6a01 6a00 50 55 e8???????? 85c0 }
            // n = 6, score = 100
            //   6a01                 | push                1
            //   6a00                 | push                0
            //   50                   | push                eax
            //   55                   | push                ebp
            //   e8????????           |                     
            //   85c0                 | test                eax, eax

        $sequence_3 = { e8???????? 397c2420 740d 8b54242c 52 e8???????? 83c404 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   397c2420             | cmp                 dword ptr [esp + 0x20], edi
            //   740d                 | je                  0xf
            //   8b54242c             | mov                 edx, dword ptr [esp + 0x2c]
            //   52                   | push                edx
            //   e8????????           |                     
            //   83c404               | add                 esp, 4

        $sequence_4 = { 8365fc00 8b049de0650a10 f644380401 740b 56 e8???????? }
            // n = 6, score = 100
            //   8365fc00             | and                 dword ptr [ebp - 4], 0
            //   8b049de0650a10       | mov                 eax, dword ptr [ebx*4 + 0x100a65e0]
            //   f644380401           | test                byte ptr [eax + edi + 4], 1
            //   740b                 | je                  0xd
            //   56                   | push                esi
            //   e8????????           |                     

        $sequence_5 = { 7408 3c2f 0f8598000000 837f1410 7204 8b07 eb02 }
            // n = 7, score = 100
            //   7408                 | je                  0xa
            //   3c2f                 | cmp                 al, 0x2f
            //   0f8598000000         | jne                 0x9e
            //   837f1410             | cmp                 dword ptr [edi + 0x14], 0x10
            //   7204                 | jb                  6
            //   8b07                 | mov                 eax, dword ptr [edi]
            //   eb02                 | jmp                 4

        $sequence_6 = { 0fb74d1c 894c2420 8b4d24 89542424 8b5520 894c2454 0fb64d0a }
            // n = 7, score = 100
            //   0fb74d1c             | movzx               ecx, word ptr [ebp + 0x1c]
            //   894c2420             | mov                 dword ptr [esp + 0x20], ecx
            //   8b4d24               | mov                 ecx, dword ptr [ebp + 0x24]
            //   89542424             | mov                 dword ptr [esp + 0x24], edx
            //   8b5520               | mov                 edx, dword ptr [ebp + 0x20]
            //   894c2454             | mov                 dword ptr [esp + 0x54], ecx
            //   0fb64d0a             | movzx               ecx, byte ptr [ebp + 0xa]

        $sequence_7 = { 85ff 7403 57 ffd5 53 ff15???????? 8b442410 }
            // n = 7, score = 100
            //   85ff                 | test                edi, edi
            //   7403                 | je                  5
            //   57                   | push                edi
            //   ffd5                 | call                ebp
            //   53                   | push                ebx
            //   ff15????????         |                     
            //   8b442410             | mov                 eax, dword ptr [esp + 0x10]

        $sequence_8 = { 8911 57 e8???????? 8b5c2418 8b74241c 83c404 56 }
            // n = 7, score = 100
            //   8911                 | mov                 dword ptr [ecx], edx
            //   57                   | push                edi
            //   e8????????           |                     
            //   8b5c2418             | mov                 ebx, dword ptr [esp + 0x18]
            //   8b74241c             | mov                 esi, dword ptr [esp + 0x1c]
            //   83c404               | add                 esp, 4
            //   56                   | push                esi

        $sequence_9 = { 33f6 8b54240c 52 ff15???????? 8bc6 5e 5d }
            // n = 7, score = 100
            //   33f6                 | xor                 esi, esi
            //   8b54240c             | mov                 edx, dword ptr [esp + 0xc]
            //   52                   | push                edx
            //   ff15????????         |                     
            //   8bc6                 | mov                 eax, esi
            //   5e                   | pop                 esi
            //   5d                   | pop                 ebp

    condition:
        7 of them and filesize < 1418240
}