rule win_victorygate_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.victorygate."
        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.victorygate"
        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 = { 8b95e0fcffff 8d8d0cfdffff 8d7102 f6c210 0f84f9010000 0f1f8000000000 668b01 }
            // n = 7, score = 100
            //   8b95e0fcffff         | mov                 edx, dword ptr [ebp - 0x320]
            //   8d8d0cfdffff         | lea                 ecx, [ebp - 0x2f4]
            //   8d7102               | lea                 esi, [ecx + 2]
            //   f6c210               | test                dl, 0x10
            //   0f84f9010000         | je                  0x1ff
            //   0f1f8000000000       | nop                 dword ptr [eax]
            //   668b01               | mov                 ax, word ptr [ecx]

        $sequence_1 = { 64a12c000000 8b3488 80be6411000000 750b 8d8e00100000 e8???????? }
            // n = 6, score = 100
            //   64a12c000000         | mov                 eax, dword ptr fs:[0x2c]
            //   8b3488               | mov                 esi, dword ptr [eax + ecx*4]
            //   80be6411000000       | cmp                 byte ptr [esi + 0x1164], 0
            //   750b                 | jne                 0xd
            //   8d8e00100000         | lea                 ecx, [esi + 0x1000]
            //   e8????????           |                     

        $sequence_2 = { c1f906 56 57 6bf838 8b048d98d64700 894df0 }
            // n = 6, score = 100
            //   c1f906               | sar                 ecx, 6
            //   56                   | push                esi
            //   57                   | push                edi
            //   6bf838               | imul                edi, eax, 0x38
            //   8b048d98d64700       | mov                 eax, dword ptr [ecx*4 + 0x47d698]
            //   894df0               | mov                 dword ptr [ebp - 0x10], ecx

        $sequence_3 = { 03c0 03c0 03c0 660f2898e09e4600 660f2835???????? 660f59cf 660f58d1 }
            // n = 7, score = 100
            //   03c0                 | add                 eax, eax
            //   03c0                 | add                 eax, eax
            //   03c0                 | add                 eax, eax
            //   660f2898e09e4600     | movapd              xmm3, xmmword ptr [eax + 0x469ee0]
            //   660f2835????????     |                     
            //   660f59cf             | mulpd               xmm1, xmm7
            //   660f58d1             | addpd               xmm2, xmm1

        $sequence_4 = { 7438 8d5e0c 53 e8???????? 83c404 }
            // n = 5, score = 100
            //   7438                 | je                  0x3a
            //   8d5e0c               | lea                 ebx, [esi + 0xc]
            //   53                   | push                ebx
            //   e8????????           |                     
            //   83c404               | add                 esp, 4

        $sequence_5 = { 6a00 6a00 50 ffb424a8000000 6a00 ff15???????? 85c0 }
            // n = 7, score = 100
            //   6a00                 | push                0
            //   6a00                 | push                0
            //   50                   | push                eax
            //   ffb424a8000000       | push                dword ptr [esp + 0xa8]
            //   6a00                 | push                0
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax

        $sequence_6 = { 8d044501000000 56 03c3 50 ff7508 e8???????? 8b5dec }
            // n = 7, score = 100
            //   8d044501000000       | lea                 eax, [eax*2 + 1]
            //   56                   | push                esi
            //   03c3                 | add                 eax, ebx
            //   50                   | push                eax
            //   ff7508               | push                dword ptr [ebp + 8]
            //   e8????????           |                     
            //   8b5dec               | mov                 ebx, dword ptr [ebp - 0x14]

        $sequence_7 = { 8d4dd0 0f57c0 c645d000 660fd645d8 8b12 e8???????? c645fc14 }
            // n = 7, score = 100
            //   8d4dd0               | lea                 ecx, [ebp - 0x30]
            //   0f57c0               | xorps               xmm0, xmm0
            //   c645d000             | mov                 byte ptr [ebp - 0x30], 0
            //   660fd645d8           | movq                qword ptr [ebp - 0x28], xmm0
            //   8b12                 | mov                 edx, dword ptr [edx]
            //   e8????????           |                     
            //   c645fc14             | mov                 byte ptr [ebp - 4], 0x14

        $sequence_8 = { 8b5708 894708 894f0c 8955d8 8975dc c645fc13 }
            // n = 6, score = 100
            //   8b5708               | mov                 edx, dword ptr [edi + 8]
            //   894708               | mov                 dword ptr [edi + 8], eax
            //   894f0c               | mov                 dword ptr [edi + 0xc], ecx
            //   8955d8               | mov                 dword ptr [ebp - 0x28], edx
            //   8975dc               | mov                 dword ptr [ebp - 0x24], esi
            //   c645fc13             | mov                 byte ptr [ebp - 4], 0x13

        $sequence_9 = { 6a00 6a02 68162b0000 ba???????? }
            // n = 4, score = 100
            //   6a00                 | push                0
            //   6a02                 | push                2
            //   68162b0000           | push                0x2b16
            //   ba????????           |                     

    condition:
        7 of them and filesize < 1209344
}