rule win_strongpity_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.strongpity."
        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.strongpity"
        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 = { c60100 41 83ea01 75f7 50 e8???????? 59 }
            // n = 7, score = 700
            //   c60100               | mov                 byte ptr [ecx], 0
            //   41                   | inc                 ecx
            //   83ea01               | sub                 edx, 1
            //   75f7                 | jne                 0xfffffff9
            //   50                   | push                eax
            //   e8????????           |                     
            //   59                   | pop                 ecx

        $sequence_1 = { 68???????? 6a02 59 03c1 50 }
            // n = 5, score = 700
            //   68????????           |                     
            //   6a02                 | push                2
            //   59                   | pop                 ecx
            //   03c1                 | add                 eax, ecx
            //   50                   | push                eax

        $sequence_2 = { 75f8 395dd0 7463 8b45d4 6a02 40 5a }
            // n = 7, score = 700
            //   75f8                 | jne                 0xfffffffa
            //   395dd0               | cmp                 dword ptr [ebp - 0x30], ebx
            //   7463                 | je                  0x65
            //   8b45d4               | mov                 eax, dword ptr [ebp - 0x2c]
            //   6a02                 | push                2
            //   40                   | inc                 eax
            //   5a                   | pop                 edx

        $sequence_3 = { ff75f4 68???????? 8d0441 50 e8???????? 8b4608 83c418 }
            // n = 7, score = 700
            //   ff75f4               | push                dword ptr [ebp - 0xc]
            //   68????????           |                     
            //   8d0441               | lea                 eax, [ecx + eax*2]
            //   50                   | push                eax
            //   e8????????           |                     
            //   8b4608               | mov                 eax, dword ptr [esi + 8]
            //   83c418               | add                 esp, 0x18

        $sequence_4 = { 5f 85c9 7418 8b45ec 6a02 5a }
            // n = 6, score = 700
            //   5f                   | pop                 edi
            //   85c9                 | test                ecx, ecx
            //   7418                 | je                  0x1a
            //   8b45ec               | mov                 eax, dword ptr [ebp - 0x14]
            //   6a02                 | push                2
            //   5a                   | pop                 edx

        $sequence_5 = { 56 ff15???????? 85c0 7427 53 8d45f8 }
            // n = 6, score = 700
            //   56                   | push                esi
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7427                 | je                  0x29
            //   53                   | push                ebx
            //   8d45f8               | lea                 eax, [ebp - 8]

        $sequence_6 = { 03f9 33c9 6a02 5a 8d4701 f7e2 }
            // n = 6, score = 700
            //   03f9                 | add                 edi, ecx
            //   33c9                 | xor                 ecx, ecx
            //   6a02                 | push                2
            //   5a                   | pop                 edx
            //   8d4701               | lea                 eax, [edi + 1]
            //   f7e2                 | mul                 edx

        $sequence_7 = { 8bce 8818 40 83e901 75f8 8bce }
            // n = 6, score = 700
            //   8bce                 | mov                 ecx, esi
            //   8818                 | mov                 byte ptr [eax], bl
            //   40                   | inc                 eax
            //   83e901               | sub                 ecx, 1
            //   75f8                 | jne                 0xfffffffa
            //   8bce                 | mov                 ecx, esi

        $sequence_8 = { 5f c7866c02000001000000 5e 83c410 }
            // n = 4, score = 300
            //   5f                   | pop                 edi
            //   c7866c02000001000000     | mov    dword ptr [esi + 0x26c], 1
            //   5e                   | pop                 esi
            //   83c410               | add                 esp, 0x10

        $sequence_9 = { 0107 83be8800000002 8b07 0f85ad000000 83f814 }
            // n = 5, score = 300
            //   0107                 | add                 dword ptr [edi], eax
            //   83be8800000002       | cmp                 dword ptr [esi + 0x88], 2
            //   8b07                 | mov                 eax, dword ptr [edi]
            //   0f85ad000000         | jne                 0xb3
            //   83f814               | cmp                 eax, 0x14

        $sequence_10 = { 5f c7462402000000 5e 5d 33c0 5b 8b4c246c }
            // n = 7, score = 300
            //   5f                   | pop                 edi
            //   c7462402000000       | mov                 dword ptr [esi + 0x24], 2
            //   5e                   | pop                 esi
            //   5d                   | pop                 ebp
            //   33c0                 | xor                 eax, eax
            //   5b                   | pop                 ebx
            //   8b4c246c             | mov                 ecx, dword ptr [esp + 0x6c]

        $sequence_11 = { 5f c78498080c000000000000 5b c3 8b8c9808100000 83e900 7425 }
            // n = 7, score = 300
            //   5f                   | pop                 edi
            //   c78498080c000000000000     | mov    dword ptr [eax + ebx*4 + 0xc08], 0
            //   5b                   | pop                 ebx
            //   c3                   | ret                 
            //   8b8c9808100000       | mov                 ecx, dword ptr [eax + ebx*4 + 0x1008]
            //   83e900               | sub                 ecx, 0
            //   7425                 | je                  0x27

        $sequence_12 = { 012e 885c240a ebc3 80fb5d 7520 837c240c00 0f85fe020000 }
            // n = 7, score = 300
            //   012e                 | add                 dword ptr [esi], ebp
            //   885c240a             | mov                 byte ptr [esp + 0xa], bl
            //   ebc3                 | jmp                 0xffffffc5
            //   80fb5d               | cmp                 bl, 0x5d
            //   7520                 | jne                 0x22
            //   837c240c00           | cmp                 dword ptr [esp + 0xc], 0
            //   0f85fe020000         | jne                 0x304

        $sequence_13 = { 012e 885c240a e9???????? 84db 0f8434020000 }
            // n = 5, score = 300
            //   012e                 | add                 dword ptr [esi], ebp
            //   885c240a             | mov                 byte ptr [esp + 0xa], bl
            //   e9????????           |                     
            //   84db                 | test                bl, bl
            //   0f8434020000         | je                  0x23a

        $sequence_14 = { 5f c3 8b74240c c7400400000000 8938 }
            // n = 5, score = 300
            //   5f                   | pop                 edi
            //   c3                   | ret                 
            //   8b74240c             | mov                 esi, dword ptr [esp + 0xc]
            //   c7400400000000       | mov                 dword ptr [eax + 4], 0
            //   8938                 | mov                 dword ptr [eax], edi

        $sequence_15 = { 7419 5f c70001000000 33c0 5d 8b4c2450 33cc }
            // n = 7, score = 300
            //   7419                 | je                  0x1b
            //   5f                   | pop                 edi
            //   c70001000000         | mov                 dword ptr [eax], 1
            //   33c0                 | xor                 eax, eax
            //   5d                   | pop                 ebp
            //   8b4c2450             | mov                 ecx, dword ptr [esp + 0x50]
            //   33cc                 | xor                 ecx, esp

    condition:
        7 of them and filesize < 999424
}