rule win_daxin_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.daxin."
        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.daxin"
        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 = { 2bc2 d1f8 99 f7f9 }
            // n = 4, score = 400
            //   2bc2                 | sub                 eax, edx
            //   d1f8                 | sar                 eax, 1
            //   99                   | cdq                 
            //   f7f9                 | idiv                ecx

        $sequence_1 = { 4c8bdc 49895b08 49897318 57 4881ecc0010000 }
            // n = 5, score = 300
            //   4c8bdc               | dec                 esp
            //   49895b08             | sub                 edx, ebx
            //   49897318             | dec                 eax
            //   57                   | lea                 edx, [edi + 0x48]
            //   4881ecc0010000       | dec                 esp

        $sequence_2 = { 4c8bdc 49895b18 49897320 57 4881eca0010000 }
            // n = 5, score = 300
            //   4c8bdc               | dec                 esp
            //   49895b18             | lea                 eax, [ebx + 0x20]
            //   49897320             | inc                 ecx
            //   57                   | lea                 ecx, [ecx + 5]
            //   4881eca0010000       | dec                 esp

        $sequence_3 = { 7507 c7400803000000 488d4828 4c8bc6 }
            // n = 4, score = 300
            //   7507                 | jne                 9
            //   c7400803000000       | mov                 dword ptr [eax + 8], 3
            //   488d4828             | dec                 eax
            //   4c8bc6               | lea                 ecx, [eax + 0x28]

        $sequence_4 = { 4c8bdc 53 4883ec70 488b05???????? 488b0d???????? }
            // n = 5, score = 300
            //   4c8bdc               | dec                 ecx
            //   53                   | mov                 dword ptr [ebx + 8], ebx
            //   4883ec70             | dec                 ecx
            //   488b05????????       |                     
            //   488b0d????????       |                     

        $sequence_5 = { 4c8bdb 4c2bd3 488d5748 4c8d4320 }
            // n = 4, score = 300
            //   4c8bdb               | dec                 esp
            //   4c2bd3               | mov                 eax, esi
            //   488d5748             | dec                 esp
            //   4c8d4320             | mov                 ebx, ebx

        $sequence_6 = { 4c8be1 44887008 44887009 4488700a }
            // n = 4, score = 300
            //   4c8be1               | dec                 eax
            //   44887008             | sub                 esp, 0x1a0
            //   44887009             | xor                 eax, eax
            //   4488700a             | dec                 esp

        $sequence_7 = { 4c8be0 488bc5 492bc4 483bc2 }
            // n = 4, score = 300
            //   4c8be0               | mov                 dword ptr [ebx + 0x18], esi
            //   488bc5               | push                edi
            //   492bc4               | dec                 eax
            //   483bc2               | sub                 esp, 0x1c0

        $sequence_8 = { 885801 8d4802 8b1a 8919 }
            // n = 4, score = 100
            //   885801               | mov                 ecx, eax
            //   8d4802               | inc                 ecx
            //   8b1a                 | call                eax
            //   8919                 | dec                 eax

        $sequence_9 = { 88570d 668b8688000000 50 e8???????? }
            // n = 4, score = 100
            //   88570d               | mov                 esp, ecx
            //   668b8688000000       | inc                 esp
            //   50                   | mov                 byte ptr [eax + 8], dh
            //   e8????????           |                     

        $sequence_10 = { 885609 8b4728 894610 8b4f2c 894e0c 8bc6 }
            // n = 6, score = 100
            //   885609               | mov                 esp, eax
            //   8b4728               | dec                 eax
            //   894610               | mov                 eax, ebp
            //   8b4f2c               | dec                 ecx
            //   894e0c               | sub                 eax, esp
            //   8bc6                 | dec                 eax

        $sequence_11 = { 88570d 668b9688000000 52 e8???????? }
            // n = 4, score = 100
            //   88570d               | mov                 esp, ecx
            //   668b9688000000       | inc                 esp
            //   52                   | mov                 byte ptr [eax + 8], dh
            //   e8????????           |                     

        $sequence_12 = { 88570d 8a00 8b542414 83e00f }
            // n = 4, score = 100
            //   88570d               | mov                 byte ptr [eax + 0xa], dh
            //   8a00                 | inc                 esp
            //   8b542414             | mov                 byte ptr [eax + 0xb], dh
            //   83e00f               | inc                 esp

        $sequence_13 = { 885a14 8a19 41 885c2444 }
            // n = 4, score = 100
            //   885a14               | inc                 ecx
            //   8a19                 | and                 dword ptr [esp], 0
            //   41                   | sub                 eax, edx
            //   885c2444             | sar                 eax, 1

        $sequence_14 = { 885a15 eb07 a840 7403 }
            // n = 4, score = 100
            //   885a15               | mov                 eax, esi
            //   eb07                 | pop                 esi
            //   a840                 | mov                 byte ptr [edi + 0xd], dl
            //   7403                 | mov                 ax, word ptr [esi + 0x88]

    condition:
        7 of them and filesize < 3475456
}