rule win_fuwuqidrama_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.fuwuqidrama."
        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.fuwuqidrama"
        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 = { 899e00040000 899ef8030000 899ef0030000 899ee8030000 899ee0030000 899ed8030000 }
            // n = 6, score = 100
            //   899e00040000         | mov                 dword ptr [esi + 0x400], ebx
            //   899ef8030000         | mov                 dword ptr [esi + 0x3f8], ebx
            //   899ef0030000         | mov                 dword ptr [esi + 0x3f0], ebx
            //   899ee8030000         | mov                 dword ptr [esi + 0x3e8], ebx
            //   899ee0030000         | mov                 dword ptr [esi + 0x3e0], ebx
            //   899ed8030000         | mov                 dword ptr [esi + 0x3d8], ebx

        $sequence_1 = { 8db594020000 89442430 8d542430 8d442420 8d7e0c 52 50 }
            // n = 7, score = 100
            //   8db594020000         | lea                 esi, [ebp + 0x294]
            //   89442430             | mov                 dword ptr [esp + 0x30], eax
            //   8d542430             | lea                 edx, [esp + 0x30]
            //   8d442420             | lea                 eax, [esp + 0x20]
            //   8d7e0c               | lea                 edi, [esi + 0xc]
            //   52                   | push                edx
            //   50                   | push                eax

        $sequence_2 = { 8b4e0c 2bcd 57 f7e9 c1fa06 8bc2 }
            // n = 6, score = 100
            //   8b4e0c               | mov                 ecx, dword ptr [esi + 0xc]
            //   2bcd                 | sub                 ecx, ebp
            //   57                   | push                edi
            //   f7e9                 | imul                ecx
            //   c1fa06               | sar                 edx, 6
            //   8bc2                 | mov                 eax, edx

        $sequence_3 = { 75da 8b4604 50 89442420 e8???????? 8b442424 }
            // n = 6, score = 100
            //   75da                 | jne                 0xffffffdc
            //   8b4604               | mov                 eax, dword ptr [esi + 4]
            //   50                   | push                eax
            //   89442420             | mov                 dword ptr [esp + 0x20], eax
            //   e8????????           |                     
            //   8b442424             | mov                 eax, dword ptr [esp + 0x24]

        $sequence_4 = { 03d0 3bd5 0f8351010000 8b7704 85f6 741b 8bcb }
            // n = 7, score = 100
            //   03d0                 | add                 edx, eax
            //   3bd5                 | cmp                 edx, ebp
            //   0f8351010000         | jae                 0x157
            //   8b7704               | mov                 esi, dword ptr [edi + 4]
            //   85f6                 | test                esi, esi
            //   741b                 | je                  0x1d
            //   8bcb                 | mov                 ecx, ebx

        $sequence_5 = { 8b8bcc030000 8b93c8030000 8bc1 3bc1 741e }
            // n = 5, score = 100
            //   8b8bcc030000         | mov                 ecx, dword ptr [ebx + 0x3cc]
            //   8b93c8030000         | mov                 edx, dword ptr [ebx + 0x3c8]
            //   8bc1                 | mov                 eax, ecx
            //   3bc1                 | cmp                 eax, ecx
            //   741e                 | je                  0x20

        $sequence_6 = { 744f 8b4c2410 6a00 56 8b11 ff5220 55 }
            // n = 7, score = 100
            //   744f                 | je                  0x51
            //   8b4c2410             | mov                 ecx, dword ptr [esp + 0x10]
            //   6a00                 | push                0
            //   56                   | push                esi
            //   8b11                 | mov                 edx, dword ptr [ecx]
            //   ff5220               | call                dword ptr [edx + 0x20]
            //   55                   | push                ebp

        $sequence_7 = { 896b1c 8b98c0000000 0bf1 895c241c 8b5c2424 23f3 8b5c2414 }
            // n = 7, score = 100
            //   896b1c               | mov                 dword ptr [ebx + 0x1c], ebp
            //   8b98c0000000         | mov                 ebx, dword ptr [eax + 0xc0]
            //   0bf1                 | or                  esi, ecx
            //   895c241c             | mov                 dword ptr [esp + 0x1c], ebx
            //   8b5c2424             | mov                 ebx, dword ptr [esp + 0x24]
            //   23f3                 | and                 esi, ebx
            //   8b5c2414             | mov                 ebx, dword ptr [esp + 0x14]

        $sequence_8 = { 8d543818 898f04140000 899708140000 ffd3 8b5654 55 89971c140000 }
            // n = 7, score = 100
            //   8d543818             | lea                 edx, [eax + edi + 0x18]
            //   898f04140000         | mov                 dword ptr [edi + 0x1404], ecx
            //   899708140000         | mov                 dword ptr [edi + 0x1408], edx
            //   ffd3                 | call                ebx
            //   8b5654               | mov                 edx, dword ptr [esi + 0x54]
            //   55                   | push                ebp
            //   89971c140000         | mov                 dword ptr [edi + 0x141c], edx

        $sequence_9 = { 8bce 8bd0 8b01 3bc5 7406 8b00 3bc5 }
            // n = 7, score = 100
            //   8bce                 | mov                 ecx, esi
            //   8bd0                 | mov                 edx, eax
            //   8b01                 | mov                 eax, dword ptr [ecx]
            //   3bc5                 | cmp                 eax, ebp
            //   7406                 | je                  8
            //   8b00                 | mov                 eax, dword ptr [eax]
            //   3bc5                 | cmp                 eax, ebp

    condition:
        7 of them and filesize < 245760
}