rule win_nosu_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        version = "1"
        description = "Detects win.nosu."
        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.nosu"
        malpedia_rule_date = "20260422"
        malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14"
        malpedia_version = "20260504"
        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 = { 8bd5 50 51 6a00 6a00 53 bb01000080 }
            // n = 7, score = 200
            //   8bd5                 | mov                 edx, ebp
            //   50                   | push                eax
            //   51                   | push                ecx
            //   6a00                 | push                0
            //   6a00                 | push                0
            //   53                   | push                ebx
            //   bb01000080           | mov                 ebx, 0x80000001

        $sequence_1 = { 50 50 50 8d442420 50 8d8424b4000000 50 }
            // n = 7, score = 200
            //   50                   | push                eax
            //   50                   | push                eax
            //   50                   | push                eax
            //   8d442420             | lea                 eax, [esp + 0x20]
            //   50                   | push                eax
            //   8d8424b4000000       | lea                 eax, [esp + 0xb4]
            //   50                   | push                eax

        $sequence_2 = { 59 59 84c0 7448 8d85f8f7ffff }
            // n = 5, score = 200
            //   59                   | pop                 ecx
            //   59                   | pop                 ecx
            //   84c0                 | test                al, al
            //   7448                 | je                  0x4a
            //   8d85f8f7ffff         | lea                 eax, [ebp - 0x808]

        $sequence_3 = { ff74241c ff36 e8???????? 83c40c 88442404 8d4c2408 e8???????? }
            // n = 7, score = 200
            //   ff74241c             | push                dword ptr [esp + 0x1c]
            //   ff36                 | push                dword ptr [esi]
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   88442404             | mov                 byte ptr [esp + 4], al
            //   8d4c2408             | lea                 ecx, [esp + 8]
            //   e8????????           |                     

        $sequence_4 = { 8b4d08 50 ff7524 ff742414 ff742428 ff751c ff7518 }
            // n = 7, score = 200
            //   8b4d08               | mov                 ecx, dword ptr [ebp + 8]
            //   50                   | push                eax
            //   ff7524               | push                dword ptr [ebp + 0x24]
            //   ff742414             | push                dword ptr [esp + 0x14]
            //   ff742428             | push                dword ptr [esp + 0x28]
            //   ff751c               | push                dword ptr [ebp + 0x1c]
            //   ff7518               | push                dword ptr [ebp + 0x18]

        $sequence_5 = { 8bf2 8d442410 8b5508 8bf9 50 89742410 e8???????? }
            // n = 7, score = 200
            //   8bf2                 | mov                 esi, edx
            //   8d442410             | lea                 eax, [esp + 0x10]
            //   8b5508               | mov                 edx, dword ptr [ebp + 8]
            //   8bf9                 | mov                 edi, ecx
            //   50                   | push                eax
            //   89742410             | mov                 dword ptr [esp + 0x10], esi
            //   e8????????           |                     

        $sequence_6 = { 8bce e8???????? 8d97e0c80300 8d4c2418 e8???????? 8d9718b40300 8d4c2418 }
            // n = 7, score = 200
            //   8bce                 | mov                 ecx, esi
            //   e8????????           |                     
            //   8d97e0c80300         | lea                 edx, [edi + 0x3c8e0]
            //   8d4c2418             | lea                 ecx, [esp + 0x18]
            //   e8????????           |                     
            //   8d9718b40300         | lea                 edx, [edi + 0x3b418]
            //   8d4c2418             | lea                 ecx, [esp + 0x18]

        $sequence_7 = { ff742408 50 8d87d8000000 50 }
            // n = 4, score = 200
            //   ff742408             | push                dword ptr [esp + 8]
            //   50                   | push                eax
            //   8d87d8000000         | lea                 eax, [edi + 0xd8]
            //   50                   | push                eax

        $sequence_8 = { 50 56 ff15???????? 85c0 0f95c1 884c2413 85c0 }
            // n = 7, score = 200
            //   50                   | push                eax
            //   56                   | push                esi
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   0f95c1               | setne               cl
            //   884c2413             | mov                 byte ptr [esp + 0x13], cl
            //   85c0                 | test                eax, eax

        $sequence_9 = { 50 56 ff15???????? 85c0 7535 85f6 }
            // n = 6, score = 200
            //   50                   | push                eax
            //   56                   | push                esi
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7535                 | jne                 0x37
            //   85f6                 | test                esi, esi

    condition:
        7 of them and filesize < 513024
}