rule win_bohmini_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.bohmini."
        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.bohmini"
        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 = { 6890130000 eb41 56 53 55 }
            // n = 5, score = 100
            //   6890130000           | push                0x1390
            //   eb41                 | jmp                 0x43
            //   56                   | push                esi
            //   53                   | push                ebx
            //   55                   | push                ebp

        $sequence_1 = { 84c9 75f4 5f 5e 5d 33c0 5b }
            // n = 7, score = 100
            //   84c9                 | test                cl, cl
            //   75f4                 | jne                 0xfffffff6
            //   5f                   | pop                 edi
            //   5e                   | pop                 esi
            //   5d                   | pop                 ebp
            //   33c0                 | xor                 eax, eax
            //   5b                   | pop                 ebx

        $sequence_2 = { a803 57 7417 8a08 3acb }
            // n = 5, score = 100
            //   a803                 | test                al, 3
            //   57                   | push                edi
            //   7417                 | je                  0x19
            //   8a08                 | mov                 cl, byte ptr [eax]
            //   3acb                 | cmp                 cl, bl

        $sequence_3 = { 8b742450 8b5114 8bc6 f7d8 57 8b3d???????? }
            // n = 6, score = 100
            //   8b742450             | mov                 esi, dword ptr [esp + 0x50]
            //   8b5114               | mov                 edx, dword ptr [ecx + 0x14]
            //   8bc6                 | mov                 eax, esi
            //   f7d8                 | neg                 eax
            //   57                   | push                edi
            //   8b3d????????         |                     

        $sequence_4 = { 895328 8b542418 03c8 8b442420 898a80000000 }
            // n = 5, score = 100
            //   895328               | mov                 dword ptr [ebx + 0x28], edx
            //   8b542418             | mov                 edx, dword ptr [esp + 0x18]
            //   03c8                 | add                 ecx, eax
            //   8b442420             | mov                 eax, dword ptr [esp + 0x20]
            //   898a80000000         | mov                 dword ptr [edx + 0x80], ecx

        $sequence_5 = { 0bd7 40 f6c180 75eb 8b4c240c 5f }
            // n = 6, score = 100
            //   0bd7                 | or                  edx, edi
            //   40                   | inc                 eax
            //   f6c180               | test                cl, 0x80
            //   75eb                 | jne                 0xffffffed
            //   8b4c240c             | mov                 ecx, dword ptr [esp + 0xc]
            //   5f                   | pop                 edi

        $sequence_6 = { ffd7 85c0 0f84b6000000 53 8d54242c 56 52 }
            // n = 7, score = 100
            //   ffd7                 | call                edi
            //   85c0                 | test                eax, eax
            //   0f84b6000000         | je                  0xbc
            //   53                   | push                ebx
            //   8d54242c             | lea                 edx, [esp + 0x2c]
            //   56                   | push                esi
            //   52                   | push                edx

        $sequence_7 = { 83c40c eb36 50 8d442440 50 }
            // n = 5, score = 100
            //   83c40c               | add                 esp, 0xc
            //   eb36                 | jmp                 0x38
            //   50                   | push                eax
            //   8d442440             | lea                 eax, [esp + 0x40]
            //   50                   | push                eax

        $sequence_8 = { 8b542418 03c8 8b442420 898a80000000 8b4c240c 8bd9 }
            // n = 6, score = 100
            //   8b542418             | mov                 edx, dword ptr [esp + 0x18]
            //   03c8                 | add                 ecx, eax
            //   8b442420             | mov                 eax, dword ptr [esp + 0x20]
            //   898a80000000         | mov                 dword ptr [edx + 0x80], ecx
            //   8b4c240c             | mov                 ecx, dword ptr [esp + 0xc]
            //   8bd9                 | mov                 ebx, ecx

        $sequence_9 = { 85c0 7507 6890130000 eb41 56 53 55 }
            // n = 7, score = 100
            //   85c0                 | test                eax, eax
            //   7507                 | jne                 9
            //   6890130000           | push                0x1390
            //   eb41                 | jmp                 0x43
            //   56                   | push                esi
            //   53                   | push                ebx
            //   55                   | push                ebp

    condition:
        7 of them and filesize < 139264
}