rule win_mydogs_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.mydogs."
        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.mydogs"
        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 = { 50 57 68???????? 8d8588f9ffff 6808020000 50 e8???????? }
            // n = 7, score = 200
            //   50                   | push                eax
            //   57                   | push                edi
            //   68????????           |                     
            //   8d8588f9ffff         | lea                 eax, [ebp - 0x678]
            //   6808020000           | push                0x208
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_1 = { 50 8d8598fcffff 50 ff15???????? 8bf0 83feff 0f84cd010000 }
            // n = 7, score = 200
            //   50                   | push                eax
            //   8d8598fcffff         | lea                 eax, [ebp - 0x368]
            //   50                   | push                eax
            //   ff15????????         |                     
            //   8bf0                 | mov                 esi, eax
            //   83feff               | cmp                 esi, -1
            //   0f84cd010000         | je                  0x1d3

        $sequence_2 = { 50 8d8598fcffff 50 ff15???????? 8bf0 83feff 0f84ca000000 }
            // n = 7, score = 200
            //   50                   | push                eax
            //   8d8598fcffff         | lea                 eax, [ebp - 0x368]
            //   50                   | push                eax
            //   ff15????????         |                     
            //   8bf0                 | mov                 esi, eax
            //   83feff               | cmp                 esi, -1
            //   0f84ca000000         | je                  0xd0

        $sequence_3 = { e8???????? c9 c3 55 8bec 51 668b4508 }
            // n = 7, score = 200
            //   e8????????           |                     
            //   c9                   | leave               
            //   c3                   | ret                 
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   51                   | push                ecx
            //   668b4508             | mov                 ax, word ptr [ebp + 8]

        $sequence_4 = { 668908 43 83c004 8945d8 }
            // n = 4, score = 200
            //   668908               | mov                 word ptr [eax], cx
            //   43                   | inc                 ebx
            //   83c004               | add                 eax, 4
            //   8945d8               | mov                 dword ptr [ebp - 0x28], eax

        $sequence_5 = { 83fe20 750f 57 6a01 }
            // n = 4, score = 200
            //   83fe20               | cmp                 esi, 0x20
            //   750f                 | jne                 0x11
            //   57                   | push                edi
            //   6a01                 | push                1

        $sequence_6 = { 8d4900 8bc6 83e001 0bc8 }
            // n = 4, score = 200
            //   8d4900               | lea                 ecx, [ecx]
            //   8bc6                 | mov                 eax, esi
            //   83e001               | and                 eax, 1
            //   0bc8                 | or                  ecx, eax

        $sequence_7 = { 0facc110 c1f810 8b4358 0facd018 89855cfbffff 8845f0 8a4350 }
            // n = 7, score = 200
            //   0facc110             | shrd                ecx, eax, 0x10
            //   c1f810               | sar                 eax, 0x10
            //   8b4358               | mov                 eax, dword ptr [ebx + 0x58]
            //   0facd018             | shrd                eax, edx, 0x18
            //   89855cfbffff         | mov                 dword ptr [ebp - 0x4a4], eax
            //   8845f0               | mov                 byte ptr [ebp - 0x10], al
            //   8a4350               | mov                 al, byte ptr [ebx + 0x50]

        $sequence_8 = { 8d8424c0050000 68???????? 50 e8???????? 50 6800080000 53 }
            // n = 7, score = 200
            //   8d8424c0050000       | lea                 eax, [esp + 0x5c0]
            //   68????????           |                     
            //   50                   | push                eax
            //   e8????????           |                     
            //   50                   | push                eax
            //   6800080000           | push                0x800
            //   53                   | push                ebx

        $sequence_9 = { 740d 80bd66fbffff00 0f847a000000 668b856cfbffff 6689b56efbffff a801 750f }
            // n = 7, score = 200
            //   740d                 | je                  0xf
            //   80bd66fbffff00       | cmp                 byte ptr [ebp - 0x49a], 0
            //   0f847a000000         | je                  0x80
            //   668b856cfbffff       | mov                 ax, word ptr [ebp - 0x494]
            //   6689b56efbffff       | mov                 word ptr [ebp - 0x492], si
            //   a801                 | test                al, 1
            //   750f                 | jne                 0x11

    condition:
        7 of them and filesize < 313344
}