rule win_strongpity_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        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 = "20260422"
        malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14"
        malpedia_version = "20260504"
        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 = { 6a68 668945ea 58 6a3a 668945ee 58 6a20 }
            // n = 7, score = 700
            //   6a68                 | push                0x68
            //   668945ea             | mov                 word ptr [ebp - 0x16], ax
            //   58                   | pop                 eax
            //   6a3a                 | push                0x3a
            //   668945ee             | mov                 word ptr [ebp - 0x12], ax
            //   58                   | pop                 eax
            //   6a20                 | push                0x20

        $sequence_1 = { ff75d0 68???????? ff36 e8???????? 8b45d4 83c40c 894604 }
            // n = 7, score = 700
            //   ff75d0               | push                dword ptr [ebp - 0x30]
            //   68????????           |                     
            //   ff36                 | push                dword ptr [esi]
            //   e8????????           |                     
            //   8b45d4               | mov                 eax, dword ptr [ebp - 0x2c]
            //   83c40c               | add                 esp, 0xc
            //   894604               | mov                 dword ptr [esi + 4], eax

        $sequence_2 = { 6a65 59 6a2d 668945d6 }
            // n = 4, score = 700
            //   6a65                 | push                0x65
            //   59                   | pop                 ecx
            //   6a2d                 | push                0x2d
            //   668945d6             | mov                 word ptr [ebp - 0x2a], ax

        $sequence_3 = { 680c020000 8945c8 8945d4 8945f0 }
            // n = 4, score = 700
            //   680c020000           | push                0x20c
            //   8945c8               | mov                 dword ptr [ebp - 0x38], eax
            //   8945d4               | mov                 dword ptr [ebp - 0x2c], eax
            //   8945f0               | mov                 dword ptr [ebp - 0x10], eax

        $sequence_4 = { 50 6aff 53 56 ff15???????? 85c0 }
            // n = 6, score = 700
            //   50                   | push                eax
            //   6aff                 | push                -1
            //   53                   | push                ebx
            //   56                   | push                esi
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax

        $sequence_5 = { ba???????? f3a5 8bf2 668b02 }
            // n = 4, score = 700
            //   ba????????           |                     
            //   f3a5                 | rep movsd           dword ptr es:[edi], dword ptr [esi]
            //   8bf2                 | mov                 esi, edx
            //   668b02               | mov                 ax, word ptr [edx]

        $sequence_6 = { 8818 40 83e901 75f8 395dd0 7463 }
            // n = 6, score = 700
            //   8818                 | mov                 byte ptr [eax], bl
            //   40                   | inc                 eax
            //   83e901               | sub                 ecx, 1
            //   75f8                 | jne                 0xfffffffa
            //   395dd0               | cmp                 dword ptr [ebp - 0x30], ebx
            //   7463                 | je                  0x65

        $sequence_7 = { c745f800100000 85c0 750b 56 }
            // n = 4, score = 700
            //   c745f800100000       | mov                 dword ptr [ebp - 8], 0x1000
            //   85c0                 | test                eax, eax
            //   750b                 | jne                 0xd
            //   56                   | push                esi

        $sequence_8 = { 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_9 = { 5f c3 8b4c2414 85c9 }
            // n = 4, score = 300
            //   5f                   | pop                 edi
            //   c3                   | ret                 
            //   8b4c2414             | mov                 ecx, dword ptr [esp + 0x14]
            //   85c9                 | test                ecx, ecx

        $sequence_10 = { 5f c3 56 6a08 ff15???????? 83c404 85c0 }
            // n = 7, score = 300
            //   5f                   | pop                 edi
            //   c3                   | ret                 
            //   56                   | push                esi
            //   6a08                 | push                8
            //   ff15????????         |                     
            //   83c404               | add                 esp, 4
            //   85c0                 | test                eax, eax

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

        $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 = { 5f c70001000000 33c0 5d 8b4c2450 }
            // n = 5, score = 300
            //   5f                   | pop                 edi
            //   c70001000000         | mov                 dword ptr [eax], 1
            //   33c0                 | xor                 eax, eax
            //   5d                   | pop                 ebp
            //   8b4c2450             | mov                 ecx, dword ptr [esp + 0x50]

        $sequence_14 = { 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_15 = { 7418 8bd3 52 c786c800000001000000 }
            // n = 4, score = 300
            //   7418                 | je                  0x1a
            //   8bd3                 | mov                 edx, ebx
            //   52                   | push                edx
            //   c786c800000001000000     | mov    dword ptr [esi + 0xc8], 1

    condition:
        7 of them and filesize < 999424
}