rule win_unidentified_103_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.unidentified_103."
        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.unidentified_103"
        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 = { 034704 8b4028 890424 ff570c 83ec18 85c0 }
            // n = 6, score = 100
            //   034704               | add                 ecx, 1
            //   8b4028               | add                 eax, dword ptr [esp + 0x3c]
            //   890424               | mov                 byte ptr [esp + 0x27], 0
            //   ff570c               | sar                 eax, 1
            //   83ec18               | cmp                 dword ptr [esp + 0x3c], 1
            //   85c0                 | mov                 dword ptr [esp + 4], eax

        $sequence_1 = { c784246c01000050726f63 6689842478010000 8d84246c010000 89442404 c784247001000065737333 c784247401000032466972 }
            // n = 6, score = 100
            //   c784246c01000050726f63     | mov    dword ptr [esp + 0xe4], eax
            //   6689842478010000     | lea                 eax, [esp + 0x33f]
            //   8d84246c010000       | mov                 dword ptr [esp + 0x26a], 0x656c64
            //   89442404             | mov                 dword ptr [esp], ebx
            //   c784247001000065737333     | mov    dword ptr [esp + 0xc4], eax
            //   c784247401000032466972     | lea    eax, [esp + 0x3fa]

        $sequence_2 = { 56 53 81ecfc000000 8db42498000000 8b9c2428010000 c744240401000000 893424 }
            // n = 7, score = 100
            //   56                   | mov                 eax, dword ptr [eax]
            //   53                   | push                esi
            //   81ecfc000000         | push                ebx
            //   8db42498000000       | sub                 esp, 0x84c
            //   8b9c2428010000       | mov                 eax, dword ptr [esp + 0x860]
            //   c744240401000000     | mov                 dword ptr [esp + 0x18], 0
            //   893424               | mov                 dword ptr [esp + 0x14], 0x80

        $sequence_3 = { 8b442440 01d0 39c3 0f8377ffffff 8b4e24 8b5c2444 89c8 }
            // n = 7, score = 100
            //   8b442440             | mov                 dword ptr [esp + 4], eax
            //   01d0                 | add                 esp, 0x20
            //   39c3                 | mov                 eax, edi
            //   0f8377ffffff         | mov                 eax, dword ptr [esp + 0x3c]
            //   8b4e24               | mov                 dword ptr [esp + 0x17], 0x33323130
            //   8b5c2444             | mov                 edi, dword ptr [esp + 0x40]
            //   89c8                 | mov                 dword ptr [esp + 0x1b], 0x37363534

        $sequence_4 = { 85ed 0f85e20e0000 8b842408010000 85c0 7442 8b9c2490000000 890424 }
            // n = 7, score = 100
            //   85ed                 | mov                 dword ptr [esp + 0x30], edx
            //   0f85e20e0000         | mov                 dword ptr [esp + 0x34], eax
            //   8b842408010000       | jle                 0x5e
            //   85c0                 | test                ebp, ebp
            //   7442                 | je                  0xfffff41e
            //   8b9c2490000000       | lea                 eax, [esp + 0xb78]
            //   890424               | mov                 ebp, dword ptr [esp + 0xc4]

        $sequence_5 = { ff942464080000 83ec0c 8bb42484080000 8d7c2440 8906 8d44243c c744243c00000000 }
            // n = 7, score = 100
            //   ff942464080000       | mov                 esi, dword ptr [esp + 0x150]
            //   83ec0c               | mov                 esi, dword ptr [esi]
            //   8bb42484080000       | lea                 edx, [esi + 1]
            //   8d7c2440             | call                dword ptr [esp + 0x158]
            //   8906                 | mov                 dword ptr [esp + 8], ebx
            //   8d44243c             | mov                 dword ptr [esp + 4], 0
            //   c744243c00000000     | mov                 dword ptr [esp], eax

        $sequence_6 = { 89742418 895c2414 892c24 89442404 e8???????? 8d842498010000 89742418 }
            // n = 7, score = 100
            //   89742418             | mov                 eax, dword ptr [esp + 0x7c]
            //   895c2414             | mov                 dword ptr [esp + 0x14], ebp
            //   892c24               | mov                 dword ptr [esp + 8], edi
            //   89442404             | mov                 dword ptr [esp + 0x18], esi
            //   e8????????           |                     
            //   8d842498010000       | mov                 dword ptr [esp + 0x10], eax
            //   89742418             | lea                 eax, [esp + 0x4c]

        $sequence_7 = { 0fbe5101 0f95c0 83c101 89c6 8d7436ff 31c0 84d2 }
            // n = 7, score = 100
            //   0fbe5101             | cmp                 cl, 9
            //   0f95c0               | mov                 ecx, 0
            //   83c101               | ja                  0xfffff1f3
            //   89c6                 | mov                 esi, eax
            //   8d7436ff             | lea                 eax, [ecx + ecx*4]
            //   31c0                 | movsx               edx, byte ptr [esi]
            //   84d2                 | lea                 ebp, [edx - 0x61]

        $sequence_8 = { 8d842411050000 89442404 66898c2425050000 c78424110500004c6f6f6b c784241505000075705072 c78424190500006976696c }
            // n = 6, score = 100
            //   8d842411050000       | mov                 dword ptr [esp + 0x417], 0x74786574
            //   89442404             | lea                 eax, [esp + 0x10c]
            //   66898c2425050000     | mov                 dword ptr [esp + 4], eax
            //   c78424110500004c6f6f6b     | mov    dword ptr [esp + 0x10c], 0x75736552
            //   c784241505000075705072     | mov    dword ptr [esp + 0x110], 0x6854656d
            //   c78424190500006976696c     | mov    dword ptr [esp + 0x114], 0x64616572

        $sequence_9 = { 89442478 e8???????? c68424fe00000000 c78424f20000004c6f6164 89c3 }
            // n = 5, score = 100
            //   89442478             | lea                 eax, [esp + 0x184]
            //   e8????????           |                     
            //   c68424fe00000000     | mov                 dword ptr [esp + 0x70], eax
            //   c78424f20000004c6f6164     | mov    dword ptr [esp + 0x78], eax
            //   89c3                 | mov                 eax, dword ptr [esp + 0xc0]

    condition:
        7 of them and filesize < 188416
}