rule win_htran_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.htran."
        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.htran"
        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 = { 68???????? e8???????? 83c404 eb8d b900140000 }
            // n = 5, score = 200
            //   68????????           |                     
            //   e8????????           |                     
            //   83c404               | add                 esp, 4
            //   eb8d                 | jmp                 0xffffff8f
            //   b900140000           | mov                 ecx, 0x1400

        $sequence_1 = { 8d4c243c 50 51 52 ffd5 }
            // n = 5, score = 200
            //   8d4c243c             | lea                 ecx, [esp + 0x3c]
            //   50                   | push                eax
            //   51                   | push                ecx
            //   52                   | push                edx
            //   ffd5                 | call                ebp

        $sequence_2 = { 50 57 68???????? e8???????? 53 68???????? }
            // n = 6, score = 200
            //   50                   | push                eax
            //   57                   | push                edi
            //   68????????           |                     
            //   e8????????           |                     
            //   53                   | push                ebx
            //   68????????           |                     

        $sequence_3 = { f3ab b90a000000 8d7c2414 f3ab 8bbc24fc010000 }
            // n = 5, score = 200
            //   f3ab                 | rep stosd           dword ptr es:[edi], eax
            //   b90a000000           | mov                 ecx, 0xa
            //   8d7c2414             | lea                 edi, [esp + 0x14]
            //   f3ab                 | rep stosd           dword ptr es:[edi], eax
            //   8bbc24fc010000       | mov                 edi, dword ptr [esp + 0x1fc]

        $sequence_4 = { 8b4010 c3 55 8bec 51 833d????????00 53 }
            // n = 7, score = 200
            //   8b4010               | mov                 eax, dword ptr [eax + 0x10]
            //   c3                   | ret                 
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   51                   | push                ecx
            //   833d????????00       |                     
            //   53                   | push                ebx

        $sequence_5 = { 83ffff 897c2408 0f84a3010000 56 57 e8???????? 83c408 }
            // n = 7, score = 200
            //   83ffff               | cmp                 edi, -1
            //   897c2408             | mov                 dword ptr [esp + 8], edi
            //   0f84a3010000         | je                  0x1a9
            //   56                   | push                esi
            //   57                   | push                edi
            //   e8????????           |                     
            //   83c408               | add                 esp, 8

        $sequence_6 = { 8816 46 eb0f 0fb6d2 f682c1c3400004 }
            // n = 5, score = 200
            //   8816                 | mov                 byte ptr [esi], dl
            //   46                   | inc                 esi
            //   eb0f                 | jmp                 0x11
            //   0fb6d2               | movzx               edx, dl
            //   f682c1c3400004       | test                byte ptr [edx + 0x40c3c1], 4

        $sequence_7 = { e8???????? 83c42c 5f eb26 8d4508 8db65c9d4000 }
            // n = 6, score = 200
            //   e8????????           |                     
            //   83c42c               | add                 esp, 0x2c
            //   5f                   | pop                 edi
            //   eb26                 | jmp                 0x28
            //   8d4508               | lea                 eax, [ebp + 8]
            //   8db65c9d4000         | lea                 esi, [esi + 0x409d5c]

        $sequence_8 = { c20400 8b542404 8b0d???????? 3915???????? 56 b8???????? }
            // n = 6, score = 200
            //   c20400               | ret                 4
            //   8b542404             | mov                 edx, dword ptr [esp + 4]
            //   8b0d????????         |                     
            //   3915????????         |                     
            //   56                   | push                esi
            //   b8????????           |                     

        $sequence_9 = { 50 ff15???????? 50 68???????? e8???????? 83c40c e8???????? }
            // n = 7, score = 200
            //   50                   | push                eax
            //   ff15????????         |                     
            //   50                   | push                eax
            //   68????????           |                     
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   e8????????           |                     

    condition:
        7 of them and filesize < 114688
}