rule win_dtrack_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.dtrack."
        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.dtrack"
        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 = { 52 8b4508 50 e8???????? 83c414 8b4d10 51 }
            // n = 7, score = 400
            //   52                   | push                edx
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   50                   | push                eax
            //   e8????????           |                     
            //   83c414               | add                 esp, 0x14
            //   8b4d10               | mov                 ecx, dword ptr [ebp + 0x10]
            //   51                   | push                ecx

        $sequence_1 = { 83c40c c685b0faffff00 6803010000 6a00 8d95b1faffff }
            // n = 5, score = 300
            //   83c40c               | add                 esp, 0xc
            //   c685b0faffff00       | mov                 byte ptr [ebp - 0x550], 0
            //   6803010000           | push                0x103
            //   6a00                 | push                0
            //   8d95b1faffff         | lea                 edx, [ebp - 0x54f]

        $sequence_2 = { 8b8588f5ffff 8a08 888d83f5ffff 838588f5ffff01 }
            // n = 4, score = 300
            //   8b8588f5ffff         | mov                 eax, dword ptr [ebp - 0xa78]
            //   8a08                 | mov                 cl, byte ptr [eax]
            //   888d83f5ffff         | mov                 byte ptr [ebp - 0xa7d], cl
            //   838588f5ffff01       | add                 dword ptr [ebp - 0xa78], 1

        $sequence_3 = { e8???????? 83c404 50 8d95c0fcffff 52 ff15???????? }
            // n = 6, score = 300
            //   e8????????           |                     
            //   83c404               | add                 esp, 4
            //   50                   | push                eax
            //   8d95c0fcffff         | lea                 edx, [ebp - 0x340]
            //   52                   | push                edx
            //   ff15????????         |                     

        $sequence_4 = { 8b550c 52 68???????? 8d85e8fbffff }
            // n = 4, score = 300
            //   8b550c               | mov                 edx, dword ptr [ebp + 0xc]
            //   52                   | push                edx
            //   68????????           |                     
            //   8d85e8fbffff         | lea                 eax, [ebp - 0x418]

        $sequence_5 = { e8???????? 83c410 8d8dd4faffff 51 8b5510 52 }
            // n = 6, score = 300
            //   e8????????           |                     
            //   83c410               | add                 esp, 0x10
            //   8d8dd4faffff         | lea                 ecx, [ebp - 0x52c]
            //   51                   | push                ecx
            //   8b5510               | mov                 edx, dword ptr [ebp + 0x10]
            //   52                   | push                edx

        $sequence_6 = { 8981fc180000 8b5508 8b82fc180000 8b4d08 8b55f8 }
            // n = 5, score = 300
            //   8981fc180000         | mov                 dword ptr [ecx + 0x18fc], eax
            //   8b5508               | mov                 edx, dword ptr [ebp + 8]
            //   8b82fc180000         | mov                 eax, dword ptr [edx + 0x18fc]
            //   8b4d08               | mov                 ecx, dword ptr [ebp + 8]
            //   8b55f8               | mov                 edx, dword ptr [ebp - 8]

        $sequence_7 = { 68???????? 8d95e0feffff 52 e8???????? 83c40c 8b4508 8985dcfeffff }
            // n = 7, score = 300
            //   68????????           |                     
            //   8d95e0feffff         | lea                 edx, [ebp - 0x120]
            //   52                   | push                edx
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   8985dcfeffff         | mov                 dword ptr [ebp - 0x124], eax

        $sequence_8 = { 8b4df0 3b4d10 0f8d90000000 8b5508 0355f0 }
            // n = 5, score = 200
            //   8b4df0               | mov                 ecx, dword ptr [ebp - 0x10]
            //   3b4d10               | cmp                 ecx, dword ptr [ebp + 0x10]
            //   0f8d90000000         | jge                 0x96
            //   8b5508               | mov                 edx, dword ptr [ebp + 8]
            //   0355f0               | add                 edx, dword ptr [ebp - 0x10]

        $sequence_9 = { 23c1 33d0 8b45fc c1e818 33d0 8b4df8 }
            // n = 6, score = 200
            //   23c1                 | and                 eax, ecx
            //   33d0                 | xor                 edx, eax
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   c1e818               | shr                 eax, 0x18
            //   33d0                 | xor                 edx, eax
            //   8b4df8               | mov                 ecx, dword ptr [ebp - 8]

        $sequence_10 = { c1e810 23c8 33d1 8855f7 8b4df8 }
            // n = 5, score = 200
            //   c1e810               | shr                 eax, 0x10
            //   23c8                 | and                 ecx, eax
            //   33d1                 | xor                 edx, ecx
            //   8855f7               | mov                 byte ptr [ebp - 9], dl
            //   8b4df8               | mov                 ecx, dword ptr [ebp - 8]

        $sequence_11 = { 33d0 8b4df8 c1e908 234df8 8b45f8 c1e810 23c8 }
            // n = 7, score = 200
            //   33d0                 | xor                 edx, eax
            //   8b4df8               | mov                 ecx, dword ptr [ebp - 8]
            //   c1e908               | shr                 ecx, 8
            //   234df8               | and                 ecx, dword ptr [ebp - 8]
            //   8b45f8               | mov                 eax, dword ptr [ebp - 8]
            //   c1e810               | shr                 eax, 0x10
            //   23c8                 | and                 ecx, eax

        $sequence_12 = { c1e908 8b55fc d1ea 3355fc 81e2ff000000 c1e217 }
            // n = 6, score = 200
            //   c1e908               | shr                 ecx, 8
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]
            //   d1ea                 | shr                 edx, 1
            //   3355fc               | xor                 edx, dword ptr [ebp - 4]
            //   81e2ff000000         | and                 edx, 0xff
            //   c1e217               | shl                 edx, 0x17

        $sequence_13 = { 8b4d10 51 6a00 8b55f4 52 e8???????? 83c40c }
            // n = 7, score = 200
            //   8b4d10               | mov                 ecx, dword ptr [ebp + 0x10]
            //   51                   | push                ecx
            //   6a00                 | push                0
            //   8b55f4               | mov                 edx, dword ptr [ebp - 0xc]
            //   52                   | push                edx
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc

        $sequence_14 = { 8b4dfc c1e908 0bc1 894518 8b5514 8955f8 }
            // n = 6, score = 200
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   c1e908               | shr                 ecx, 8
            //   0bc1                 | or                  eax, ecx
            //   894518               | mov                 dword ptr [ebp + 0x18], eax
            //   8b5514               | mov                 edx, dword ptr [ebp + 0x14]
            //   8955f8               | mov                 dword ptr [ebp - 8], edx

    condition:
        7 of them and filesize < 1736704
}