rule win_syscon_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.syscon."
        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.syscon"
        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 = { 8935???????? ffd7 e8???????? a1???????? 3bc6 7430 }
            // n = 6, score = 200
            //   8935????????         |                     
            //   ffd7                 | call                edi
            //   e8????????           |                     
            //   a1????????           |                     
            //   3bc6                 | cmp                 eax, esi
            //   7430                 | je                  0x32

        $sequence_1 = { 8935???????? 8935???????? c705????????10000000 8935???????? ffd7 e8???????? }
            // n = 6, score = 200
            //   8935????????         |                     
            //   8935????????         |                     
            //   c705????????10000000     |     
            //   8935????????         |                     
            //   ffd7                 | call                edi
            //   e8????????           |                     

        $sequence_2 = { 50 c705????????10000000 ff15???????? 5d c20400 }
            // n = 5, score = 200
            //   50                   | push                eax
            //   c705????????10000000     |     
            //   ff15????????         |                     
            //   5d                   | pop                 ebp
            //   c20400               | ret                 4

        $sequence_3 = { 0f84f9000000 6a00 57 ff15???????? }
            // n = 4, score = 200
            //   0f84f9000000         | je                  0xff
            //   6a00                 | push                0
            //   57                   | push                edi
            //   ff15????????         |                     

        $sequence_4 = { 0f846affffff 833d????????00 7415 ff15???????? }
            // n = 4, score = 200
            //   0f846affffff         | je                  0xffffff70
            //   833d????????00       |                     
            //   7415                 | je                  0x17
            //   ff15????????         |                     

        $sequence_5 = { 53 891d???????? ff15???????? 8b0d???????? 6aff }
            // n = 5, score = 200
            //   53                   | push                ebx
            //   891d????????         |                     
            //   ff15????????         |                     
            //   8b0d????????         |                     
            //   6aff                 | push                -1

        $sequence_6 = { ffd7 8b0d???????? b801000000 68???????? 51 }
            // n = 5, score = 200
            //   ffd7                 | call                edi
            //   8b0d????????         |                     
            //   b801000000           | mov                 eax, 1
            //   68????????           |                     
            //   51                   | push                ecx

        $sequence_7 = { 8b3d???????? 68???????? ffd7 6800010000 6a00 68???????? c744242000000000 }
            // n = 7, score = 200
            //   8b3d????????         |                     
            //   68????????           |                     
            //   ffd7                 | call                edi
            //   6800010000           | push                0x100
            //   6a00                 | push                0
            //   68????????           |                     
            //   c744242000000000     | mov                 dword ptr [esp + 0x20], 0

        $sequence_8 = { 89442430 894c2428 89542420 4c8d4590 488d8d200a0000 488d15963c0000 }
            // n = 6, score = 100
            //   89442430             | dec                 eax
            //   894c2428             | lea                 edx, [esp + 0x20]
            //   89542420             | dec                 eax
            //   4c8d4590             | mov                 ecx, edi
            //   488d8d200a0000       | dec                 eax
            //   488d15963c0000       | lea                 ecx, [esp + 0x20]

        $sequence_9 = { 488d0d82260000 448bc0 e8???????? 488d9560010000 488d4c2450 e8???????? e9???????? }
            // n = 7, score = 100
            //   488d0d82260000       | dec                 eax
            //   448bc0               | arpl                ax, cx
            //   e8????????           |                     
            //   488d9560010000       | dec                 eax
            //   488d4c2450           | lea                 ebx, [ecx + ecx + 8]
            //   e8????????           |                     
            //   e9????????           |                     

        $sequence_10 = { eb1e 83f904 740f c705????????02000000 83f901 }
            // n = 5, score = 100
            //   eb1e                 | dec                 eax
            //   83f904               | mov                 ebx, dword ptr [esp + 0x240]
            //   740f                 | dec                 eax
            //   c705????????02000000     |     
            //   83f901               | lea                 edx, [ebp - 0x70]

        $sequence_11 = { 488d4c2420 ff15???????? 4885c0 7405 e8???????? 488b9c2440020000 }
            // n = 6, score = 100
            //   488d4c2420           | jmp                 0xffffffcd
            //   ff15????????         |                     
            //   4885c0               | dec                 eax
            //   7405                 | lea                 edx, [esp + 0x20]
            //   e8????????           |                     
            //   488b9c2440020000     | dec                 eax

        $sequence_12 = { ff15???????? 488bf0 4883f8ff 0f841a010000 448b85e80f0000 488364242000 4c8d8de00f0000 }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   488bf0               | dec                 eax
            //   4883f8ff             | mov                 esi, eax
            //   0f841a010000         | dec                 eax
            //   448b85e80f0000       | cmp                 eax, -1
            //   488364242000         | je                  0x120
            //   4c8d8de00f0000       | inc                 esp

        $sequence_13 = { ff15???????? 488d542420 488d0d70500000 448bc0 e8???????? 488d542420 488bcf }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   488d542420           | dec                 esp
            //   488d0d70500000       | lea                 ecx, [ebp + 0xfe0]
            //   448bc0               | jne                 0xd
            //   e8????????           |                     
            //   488d542420           | dec                 eax
            //   488bcf               | mov                 ecx, edi

        $sequence_14 = { ff15???????? 488d5590 4863c8 488d5c0908 }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   488d5590             | lea                 ecx, [0x5070]
            //   4863c8               | inc                 esp
            //   488d5c0908           | mov                 eax, eax

        $sequence_15 = { 750b 488bcf ff15???????? ebcb }
            // n = 4, score = 100
            //   750b                 | mov                 eax, dword ptr [ebp + 0xfe8]
            //   488bcf               | dec                 eax
            //   ff15????????         |                     
            //   ebcb                 | and                 dword ptr [esp + 0x20], 0

    condition:
        7 of them and filesize < 120832
}