rule win_fudmodule_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.fudmodule."
        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.fudmodule"
        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 = { 11d8 48ffc9 4889d9 18c4 18d0 4883ec20 488d04a500900f7e }
            // n = 7, score = 100
            //   11d8                 | clc                 
            //   48ffc9               | repne scasb         al, byte ptr es:[edi]
            //   4889d9               | jae                 0xfffff208
            //   18c4                 | jne                 0xffff4bb9
            //   18d0                 | neg                 ch
            //   4883ec20             | mov                 ax, 0xbce4
            //   488d04a500900f7e     | sub                 ax, 0xbbbc

        $sequence_1 = { 4889542448 483bf2 0f84c3000000 90 }
            // n = 4, score = 100
            //   4889542448           | dec                 esp
            //   483bf2               | mov                 ecx, ecx
            //   0f84c3000000         | inc                 ebp
            //   90                   | movzx               eax, byte ptr [ecx]

        $sequence_2 = { 480fa3c5 f5 50 66c1c903 0f9dc0 4889d9 }
            // n = 6, score = 100
            //   480fa3c5             | test                esi, esi
            //   f5                   | je                  0x7a
            //   50                   | dec                 eax
            //   66c1c903             | lea                 edi, [esp + 0x60]
            //   0f9dc0               | dec                 eax
            //   4889d9               | lea                 ebx, [esp + 0x260]

        $sequence_3 = { 4889e5 01c2 d2fe 660fb6d3 }
            // n = 4, score = 100
            //   4889e5               | je                  0x25
            //   01c2                 | dec                 eax
            //   d2fe                 | arpl                di, ax
            //   660fb6d3             | dec                 eax

        $sequence_4 = { 66b8e4bc 662dbcbb c0f005 fec4 89d0 d2d0 }
            // n = 6, score = 100
            //   66b8e4bc             | inc                 ecx
            //   662dbcbb             | call                dword ptr [esp + 0xdd0]
            //   c0f005               | dec                 eax
            //   fec4                 | mov                 edx, dword ptr [esp + 0x68]
            //   89d0                 | dec                 eax
            //   d2d0                 | mov                 ecx, dword ptr [edi]

        $sequence_5 = { 488b542458 493bd4 0f85ecfdffff 49ffc5 4983c410 }
            // n = 5, score = 100
            //   488b542458           | dec                 ecx
            //   493bd4               | inc                 ecx
            //   0f85ecfdffff         | inc                 ecx
            //   49ffc5               | lea                 eax, [eax - 0x41]
            //   4983c410             | cmp                 eax, 0x19

        $sequence_6 = { 4889d9 f9 660fbcc3 f6dc }
            // n = 4, score = 100
            //   4889d9               | mov                 ebp, esi
            //   f9                   | dec                 eax
            //   660fbcc3             | mov                 esi, dword ptr [ebx]
            //   f6dc                 | dec                 eax

        $sequence_7 = { 41b964000000 488bc8 488d45bf 4c8bc7 }
            // n = 4, score = 100
            //   41b964000000         | inc                 ecx
            //   488bc8               | mov                 ecx, 0x64
            //   488d45bf             | dec                 eax
            //   4c8bc7               | mov                 ecx, eax

        $sequence_8 = { 4889b42480000000 c745e06e746f73 c745e46b726e6c 8945c8 c745e82e657865 }
            // n = 5, score = 100
            //   4889b42480000000     | mov                 dword ptr [esp + 0x48], 0x500065
            //   c745e06e746f73       | mov                 dword ptr [esp + 0x4c], 0x740061
            //   c745e46b726e6c       | mov                 dword ptr [esp + 0x50], 0x68
            //   8945c8               | mov                 dword ptr [esp + 0x58], 0x740053
            //   c745e82e657865       | dec                 eax

        $sequence_9 = { 5d c3 4c8bc9 450fb601 49ffc1 418d40bf 83f819 }
            // n = 7, score = 100
            //   5d                   | mov                 dword ptr [esp + 0x80], esi
            //   c3                   | mov                 dword ptr [ebp - 0x20], 0x736f746e
            //   4c8bc9               | mov                 dword ptr [ebp - 0x1c], 0x6c6e726b
            //   450fb601             | mov                 dword ptr [ebp - 0x38], eax
            //   49ffc1               | mov                 dword ptr [ebp - 0x18], 0x6578652e
            //   418d40bf             | pop                 ebp
            //   83f819               | ret                 

        $sequence_10 = { c744244865005000 c744244c61007400 c744245068000000 c744245853007400 }
            // n = 4, score = 100
            //   c744244865005000     | dec                 eax
            //   c744244c61007400     | lea                 eax, [ebp - 0x41]
            //   c744245068000000     | dec                 esp
            //   c744245853007400     | mov                 eax, edi

        $sequence_11 = { 4889442420 41ff9424d00d0000 488b542468 488b0f }
            // n = 4, score = 100
            //   4889442420           | nop                 
            //   41ff9424d00d0000     | dec                 eax
            //   488b542468           | mov                 edx, dword ptr [esp + 0x58]
            //   488b0f               | dec                 ecx

        $sequence_12 = { 69d20a000000 f5 0f892bd8fdff f9 6681fd8600 }
            // n = 5, score = 100
            //   69d20a000000         | mov                 ebp, esp
            //   f5                   | add                 edx, eax
            //   0f892bd8fdff         | sar                 dh, cl
            //   f9                   | movzx               dx, bl
            //   6681fd8600           | cmc                 

        $sequence_13 = { f5 f5 69d20a000000 660fa3fb }
            // n = 4, score = 100
            //   f5                   | bt                  ebp, eax
            //   f5                   | cmc                 
            //   69d20a000000         | push                eax
            //   660fa3fb             | ror                 cx, 3

        $sequence_14 = { f5 f8 f2ae 0f8300f2ffff 0f85ab4bffff f6dd }
            // n = 6, score = 100
            //   f5                   | lea                 ecx, [eax + eax*4]
            //   f8                   | dec                 eax
            //   f2ae                 | lea                 ecx, [ebp + ecx*2 - 0x30]
            //   0f8300f2ffff         | inc                 edi
            //   0f85ab4bffff         | dec                 eax
            //   f6dd                 | mov                 dword ptr [esp + 0x20], eax

        $sequence_15 = { 7423 4863c7 488d0c80 488d4c4dd0 e8???????? ffc7 }
            // n = 6, score = 100
            //   7423                 | dec                 eax
            //   4863c7               | mov                 dword ptr [esp + 0x48], edx
            //   488d0c80             | dec                 eax
            //   488d4c4dd0           | cmp                 esi, edx
            //   e8????????           |                     
            //   ffc7                 | je                  0xcc

    condition:
        7 of them and filesize < 795648
}