rule win_fakerean_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.fakerean."
        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.fakerean"
        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 = { 53 68???????? 57 ff15???????? a3???????? }
            // n = 5, score = 300
            //   53                   | push                ebx
            //   68????????           |                     
            //   57                   | push                edi
            //   ff15????????         |                     
            //   a3????????           |                     

        $sequence_1 = { ff15???????? eb69 837d0c02 7514 ff7508 8d85d4fdffff 50 }
            // n = 7, score = 300
            //   ff15????????         |                     
            //   eb69                 | jmp                 0x6b
            //   837d0c02             | cmp                 dword ptr [ebp + 0xc], 2
            //   7514                 | jne                 0x16
            //   ff7508               | push                dword ptr [ebp + 8]
            //   8d85d4fdffff         | lea                 eax, [ebp - 0x22c]
            //   50                   | push                eax

        $sequence_2 = { b948f4ffff 663bd1 7f34 0fb64605 50 0fb64604 }
            // n = 6, score = 300
            //   b948f4ffff           | mov                 ecx, 0xfffff448
            //   663bd1               | cmp                 dx, cx
            //   7f34                 | jg                  0x36
            //   0fb64605             | movzx               eax, byte ptr [esi + 5]
            //   50                   | push                eax
            //   0fb64604             | movzx               eax, byte ptr [esi + 4]

        $sequence_3 = { e8???????? 83c40c ff75f4 ff15???????? 8d45f0 50 33ff }
            // n = 7, score = 300
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   ff75f4               | push                dword ptr [ebp - 0xc]
            //   ff15????????         |                     
            //   8d45f0               | lea                 eax, [ebp - 0x10]
            //   50                   | push                eax
            //   33ff                 | xor                 edi, edi

        $sequence_4 = { 50 6a0e 8d4dfc e8???????? 59 }
            // n = 5, score = 300
            //   50                   | push                eax
            //   6a0e                 | push                0xe
            //   8d4dfc               | lea                 ecx, [ebp - 4]
            //   e8????????           |                     
            //   59                   | pop                 ecx

        $sequence_5 = { 0fb688f24b0000 69c960ea0000 8bd3 2b55e8 }
            // n = 4, score = 300
            //   0fb688f24b0000       | movzx               ecx, byte ptr [eax + 0x4bf2]
            //   69c960ea0000         | imul                ecx, ecx, 0xea60
            //   8bd3                 | mov                 edx, ebx
            //   2b55e8               | sub                 edx, dword ptr [ebp - 0x18]

        $sequence_6 = { c9 c3 53 57 8d8608290100 50 }
            // n = 6, score = 300
            //   c9                   | leave               
            //   c3                   | ret                 
            //   53                   | push                ebx
            //   57                   | push                edi
            //   8d8608290100         | lea                 eax, [esi + 0x12908]
            //   50                   | push                eax

        $sequence_7 = { 750a 33c0 3981f0030000 eb3b 81fa3affffff 7511 8b81f8030000 }
            // n = 7, score = 300
            //   750a                 | jne                 0xc
            //   33c0                 | xor                 eax, eax
            //   3981f0030000         | cmp                 dword ptr [ecx + 0x3f0], eax
            //   eb3b                 | jmp                 0x3d
            //   81fa3affffff         | cmp                 edx, 0xffffff3a
            //   7511                 | jne                 0x13
            //   8b81f8030000         | mov                 eax, dword ptr [ecx + 0x3f8]

        $sequence_8 = { ff15???????? 68???????? 6a01 c705????????03000000 c705????????12000000 ff15???????? 895df8 }
            // n = 7, score = 300
            //   ff15????????         |                     
            //   68????????           |                     
            //   6a01                 | push                1
            //   c705????????03000000     |     
            //   c705????????12000000     |     
            //   ff15????????         |                     
            //   895df8               | mov                 dword ptr [ebp - 8], ebx

        $sequence_9 = { 83fb0e 0f857c020000 83a68c04000000 6a3f 8bc7 }
            // n = 5, score = 300
            //   83fb0e               | cmp                 ebx, 0xe
            //   0f857c020000         | jne                 0x282
            //   83a68c04000000       | and                 dword ptr [esi + 0x48c], 0
            //   6a3f                 | push                0x3f
            //   8bc7                 | mov                 eax, edi

    condition:
        7 of them and filesize < 4071424
}