rule win_andromut_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.andromut."
        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.andromut"
        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 = { 8d8538ffffff b993ceb15e 56 50 e8???????? ffd0 }
            // n = 6, score = 200
            //   8d8538ffffff         | lea                 eax, [ebp - 0xc8]
            //   b993ceb15e           | mov                 ecx, 0x5eb1ce93
            //   56                   | push                esi
            //   50                   | push                eax
            //   e8????????           |                     
            //   ffd0                 | call                eax

        $sequence_1 = { 66a5 e9???????? 83f801 7519 83ef02 33c9 668b4702 }
            // n = 7, score = 200
            //   66a5                 | movsw               word ptr es:[edi], word ptr [esi]
            //   e9????????           |                     
            //   83f801               | cmp                 eax, 1
            //   7519                 | jne                 0x1b
            //   83ef02               | sub                 edi, 2
            //   33c9                 | xor                 ecx, ecx
            //   668b4702             | mov                 ax, word ptr [edi + 2]

        $sequence_2 = { b979ccef86 e8???????? 8d8d5cf0ffff 51 8d8d50ffffff 51 33c9 }
            // n = 7, score = 200
            //   b979ccef86           | mov                 ecx, 0x86efcc79
            //   e8????????           |                     
            //   8d8d5cf0ffff         | lea                 ecx, [ebp - 0xfa4]
            //   51                   | push                ecx
            //   8d8d50ffffff         | lea                 ecx, [ebp - 0xb0]
            //   51                   | push                ecx
            //   33c9                 | xor                 ecx, ecx

        $sequence_3 = { 5d c3 56 ffb578f9ffff }
            // n = 4, score = 200
            //   5d                   | pop                 ebp
            //   c3                   | ret                 
            //   56                   | push                esi
            //   ffb578f9ffff         | push                dword ptr [ebp - 0x688]

        $sequence_4 = { 57 50 e8???????? 8bf0 8d8dc8f3ffff 56 57 }
            // n = 7, score = 200
            //   57                   | push                edi
            //   50                   | push                eax
            //   e8????????           |                     
            //   8bf0                 | mov                 esi, eax
            //   8d8dc8f3ffff         | lea                 ecx, [ebp - 0xc38]
            //   56                   | push                esi
            //   57                   | push                edi

        $sequence_5 = { c645ff80 b30d f6c301 740f 8d55ff }
            // n = 5, score = 200
            //   c645ff80             | mov                 byte ptr [ebp - 1], 0x80
            //   b30d                 | mov                 bl, 0xd
            //   f6c301               | test                bl, 1
            //   740f                 | je                  0x11
            //   8d55ff               | lea                 edx, [ebp - 1]

        $sequence_6 = { 0f4345e4 50 ff15???????? 56 6a01 8d4de4 e8???????? }
            // n = 7, score = 200
            //   0f4345e4             | cmovae              eax, dword ptr [ebp - 0x1c]
            //   50                   | push                eax
            //   ff15????????         |                     
            //   56                   | push                esi
            //   6a01                 | push                1
            //   8d4de4               | lea                 ecx, [ebp - 0x1c]
            //   e8????????           |                     

        $sequence_7 = { 2bca d1f9 51 56 ff750c e8???????? }
            // n = 6, score = 200
            //   2bca                 | sub                 ecx, edx
            //   d1f9                 | sar                 ecx, 1
            //   51                   | push                ecx
            //   56                   | push                esi
            //   ff750c               | push                dword ptr [ebp + 0xc]
            //   e8????????           |                     

        $sequence_8 = { ffd0 8b15???????? 8d44246c 8b0d???????? 53 50 57 }
            // n = 7, score = 200
            //   ffd0                 | call                eax
            //   8b15????????         |                     
            //   8d44246c             | lea                 eax, [esp + 0x6c]
            //   8b0d????????         |                     
            //   53                   | push                ebx
            //   50                   | push                eax
            //   57                   | push                edi

        $sequence_9 = { 0bd0 81e2ff000000 f7d2 8bca c1e907 }
            // n = 5, score = 200
            //   0bd0                 | or                  edx, eax
            //   81e2ff000000         | and                 edx, 0xff
            //   f7d2                 | not                 edx
            //   8bca                 | mov                 ecx, edx
            //   c1e907               | shr                 ecx, 7

    condition:
        7 of them and filesize < 368640
}