rule win_jessiecontea_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.jessiecontea."
        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.jessiecontea"
        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 = { c785a0fdffff00000000 0f57c0 8d9598fdffff 50 8bcf 660f138598fdffff e8???????? }
            // n = 7, score = 300
            //   c785a0fdffff00000000     | mov    dword ptr [ebp - 0x260], 0
            //   0f57c0               | xorps               xmm0, xmm0
            //   8d9598fdffff         | lea                 edx, [ebp - 0x268]
            //   50                   | push                eax
            //   8bcf                 | mov                 ecx, edi
            //   660f138598fdffff     | movlpd              qword ptr [ebp - 0x268], xmm0
            //   e8????????           |                     

        $sequence_1 = { 660fdf1d???????? 0f28cb 660fdbeb 660f6e58b8 }
            // n = 4, score = 300
            //   660fdf1d????????     |                     
            //   0f28cb               | movaps              xmm1, xmm3
            //   660fdbeb             | pand                xmm5, xmm3
            //   660f6e58b8           | movd                xmm3, dword ptr [eax - 0x48]

        $sequence_2 = { 81ecac0a0000 a1???????? 33c5 8945fc 53 56 57 }
            // n = 7, score = 300
            //   81ecac0a0000         | sub                 esp, 0xaac
            //   a1????????           |                     
            //   33c5                 | xor                 eax, ebp
            //   8945fc               | mov                 dword ptr [ebp - 4], eax
            //   53                   | push                ebx
            //   56                   | push                esi
            //   57                   | push                edi

        $sequence_3 = { 56 ff15???????? 56 ff15???????? ffb598f5ffff 6a08 ff15???????? }
            // n = 7, score = 300
            //   56                   | push                esi
            //   ff15????????         |                     
            //   56                   | push                esi
            //   ff15????????         |                     
            //   ffb598f5ffff         | push                dword ptr [ebp - 0xa68]
            //   6a08                 | push                8
            //   ff15????????         |                     

        $sequence_4 = { 53 ffd7 3d04010000 0f8d63010000 }
            // n = 4, score = 300
            //   53                   | push                ebx
            //   ffd7                 | call                edi
            //   3d04010000           | cmp                 eax, 0x104
            //   0f8d63010000         | jge                 0x169

        $sequence_5 = { 50 ffd6 8d85e8fdffff 50 8d85a2f6ffff }
            // n = 5, score = 300
            //   50                   | push                eax
            //   ffd6                 | call                esi
            //   8d85e8fdffff         | lea                 eax, [ebp - 0x218]
            //   50                   | push                eax
            //   8d85a2f6ffff         | lea                 eax, [ebp - 0x95e]

        $sequence_6 = { eb19 6a5c 57 e8???????? 83c408 85c0 7462 }
            // n = 7, score = 300
            //   eb19                 | jmp                 0x1b
            //   6a5c                 | push                0x5c
            //   57                   | push                edi
            //   e8????????           |                     
            //   83c408               | add                 esp, 8
            //   85c0                 | test                eax, eax
            //   7462                 | je                  0x64

        $sequence_7 = { 50 6a01 6a00 6a00 ff15???????? 8b55fc }
            // n = 6, score = 300
            //   50                   | push                eax
            //   6a01                 | push                1
            //   6a00                 | push                0
            //   6a00                 | push                0
            //   ff15????????         |                     
            //   8b55fc               | mov                 edx, dword ptr [ebp - 4]

        $sequence_8 = { 488b4de8 ff15???????? 488b4de0 33d2 ff15???????? }
            // n = 5, score = 100
            //   488b4de8             | movzx               eax, word ptr [eax + ecx]
            //   ff15????????         |                     
            //   488b4de0             | dec                 esp
            //   33d2                 | mov                 dword ptr [esp + 0x12d0], edi
            //   ff15????????         |                     

        $sequence_9 = { 4c89bc24d0120000 448b7c2470 c744242004000000 c7442450959dd460 f20f1145e0 }
            // n = 5, score = 100
            //   4c89bc24d0120000     | lea                 eax, [edx + 0x7ffffff9]
            //   448b7c2470           | dec                 eax
            //   c744242004000000     | test                eax, eax
            //   c7442450959dd460     | je                  0x19
            //   f20f1145e0           | inc                 ecx

        $sequence_10 = { 0f284c2460 0f114020 0f28442470 0f114830 }
            // n = 4, score = 100
            //   0f284c2460           | xor                 edx, edx
            //   0f114020             | nop                 
            //   0f28442470           | lea                 eax, [edi + 1]
            //   0f114830             | dec                 esp

        $sequence_11 = { 4881c4a0120000 5f 5e 5d c3 }
            // n = 5, score = 100
            //   4881c4a0120000       | movsd               qword ptr [ebp - 0x20], xmm0
            //   5f                   | dec                 eax
            //   5e                   | mov                 ecx, dword ptr [ebp - 0x18]
            //   5d                   | dec                 eax
            //   c3                   | mov                 ecx, dword ptr [ebp - 0x20]

        $sequence_12 = { 6690 8d4701 4c8d0c40 8bc7 }
            // n = 4, score = 100
            //   6690                 | inc                 esp
            //   8d4701               | mov                 edi, dword ptr [esp + 0x70]
            //   4c8d0c40             | mov                 dword ptr [esp + 0x20], 4
            //   8bc7                 | mov                 dword ptr [esp + 0x50], 0x60d49d95

        $sequence_13 = { ff15???????? 488b0d???????? 4c8d442440 41b904000000 c744244020bf0200 }
            // n = 5, score = 100
            //   ff15????????         |                     
            //   488b0d????????       |                     
            //   4c8d442440           | lea                 ecx, [eax + eax*2]
            //   41b904000000         | mov                 eax, edi
            //   c744244020bf0200     | dec                 eax

        $sequence_14 = { 4533c9 4533c0 c744242003000000 ba00000040 ff15???????? 4533c9 }
            // n = 6, score = 100
            //   4533c9               | inc                 ebp
            //   4533c0               | xor                 ecx, ecx
            //   c744242003000000     | inc                 ebp
            //   ba00000040           | xor                 eax, eax
            //   ff15????????         |                     
            //   4533c9               | mov                 dword ptr [esp + 0x20], 3

        $sequence_15 = { 488d82f9ffff7f 4885c0 7417 410fb70408 }
            // n = 4, score = 100
            //   488d82f9ffff7f       | mov                 edx, 0x40000000
            //   4885c0               | inc                 ebp
            //   7417                 | xor                 ecx, ecx
            //   410fb70408           | dec                 eax

    condition:
        7 of them and filesize < 413696
}