rule win_unidentified_031_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.unidentified_031."
        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.unidentified_031"
        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 = { ff750c 8d8d08ffffff ff7508 e8???????? 85c0 754c 8d4de0 }
            // n = 7, score = 100
            //   ff750c               | push                dword ptr [ebp + 0xc]
            //   8d8d08ffffff         | lea                 ecx, [ebp - 0xf8]
            //   ff7508               | push                dword ptr [ebp + 8]
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   754c                 | jne                 0x4e
            //   8d4de0               | lea                 ecx, [ebp - 0x20]

        $sequence_1 = { 8902 8b8554ffffff 898d58ffffff 83ec10 894204 8b8558ffffff 8b3d???????? }
            // n = 7, score = 100
            //   8902                 | mov                 dword ptr [edx], eax
            //   8b8554ffffff         | mov                 eax, dword ptr [ebp - 0xac]
            //   898d58ffffff         | mov                 dword ptr [ebp - 0xa8], ecx
            //   83ec10               | sub                 esp, 0x10
            //   894204               | mov                 dword ptr [edx + 4], eax
            //   8b8558ffffff         | mov                 eax, dword ptr [ebp - 0xa8]
            //   8b3d????????         |                     

        $sequence_2 = { 8bcb e8???????? 8bf0 85f6 0f8c46010000 85ff 7439 }
            // n = 7, score = 100
            //   8bcb                 | mov                 ecx, ebx
            //   e8????????           |                     
            //   8bf0                 | mov                 esi, eax
            //   85f6                 | test                esi, esi
            //   0f8c46010000         | jl                  0x14c
            //   85ff                 | test                edi, edi
            //   7439                 | je                  0x3b

        $sequence_3 = { ff75ec 50 e8???????? 85c0 740f 83667800 }
            // n = 6, score = 100
            //   ff75ec               | push                dword ptr [ebp - 0x14]
            //   50                   | push                eax
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   740f                 | je                  0x11
            //   83667800             | and                 dword ptr [esi + 0x78], 0

        $sequence_4 = { 898500020000 53 8d8508020000 50 c7850402000010d01800 ffd6 6a70 }
            // n = 7, score = 100
            //   898500020000         | mov                 dword ptr [ebp + 0x200], eax
            //   53                   | push                ebx
            //   8d8508020000         | lea                 eax, [ebp + 0x208]
            //   50                   | push                eax
            //   c7850402000010d01800     | mov    dword ptr [ebp + 0x204], 0x18d010
            //   ffd6                 | call                esi
            //   6a70                 | push                0x70

        $sequence_5 = { 8b7de4 8b5114 8b4110 83c706 0f802f090000 2bfa 3bf8 }
            // n = 7, score = 100
            //   8b7de4               | mov                 edi, dword ptr [ebp - 0x1c]
            //   8b5114               | mov                 edx, dword ptr [ecx + 0x14]
            //   8b4110               | mov                 eax, dword ptr [ecx + 0x10]
            //   83c706               | add                 edi, 6
            //   0f802f090000         | jo                  0x935
            //   2bfa                 | sub                 edi, edx
            //   3bf8                 | cmp                 edi, eax

        $sequence_6 = { c21000 ff742410 ff742410 ff742410 6800000200 ff742414 e8???????? }
            // n = 7, score = 100
            //   c21000               | ret                 0x10
            //   ff742410             | push                dword ptr [esp + 0x10]
            //   ff742410             | push                dword ptr [esp + 0x10]
            //   ff742410             | push                dword ptr [esp + 0x10]
            //   6800000200           | push                0x20000
            //   ff742414             | push                dword ptr [esp + 0x14]
            //   e8????????           |                     

        $sequence_7 = { 689c030000 68???????? 51 50 ff15???????? 8d4de8 ff15???????? }
            // n = 7, score = 100
            //   689c030000           | push                0x39c
            //   68????????           |                     
            //   51                   | push                ecx
            //   50                   | push                eax
            //   ff15????????         |                     
            //   8d4de8               | lea                 ecx, [ebp - 0x18]
            //   ff15????????         |                     

        $sequence_8 = { 8bf8 33db e9???????? 8b5508 8d8d30ffffff 51 8d8d20ffffff }
            // n = 7, score = 100
            //   8bf8                 | mov                 edi, eax
            //   33db                 | xor                 ebx, ebx
            //   e9????????           |                     
            //   8b5508               | mov                 edx, dword ptr [ebp + 8]
            //   8d8d30ffffff         | lea                 ecx, [ebp - 0xd0]
            //   51                   | push                ecx
            //   8d8d20ffffff         | lea                 ecx, [ebp - 0xe0]

        $sequence_9 = { 50 8d8dd0feffff 51 8d95f0feffff 52 8d8500ffffff 50 }
            // n = 7, score = 100
            //   50                   | push                eax
            //   8d8dd0feffff         | lea                 ecx, [ebp - 0x130]
            //   51                   | push                ecx
            //   8d95f0feffff         | lea                 edx, [ebp - 0x110]
            //   52                   | push                edx
            //   8d8500ffffff         | lea                 eax, [ebp - 0x100]
            //   50                   | push                eax

    condition:
        7 of them and filesize < 1998848
}