rule win_torrentlocker_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.torrentlocker."
        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.torrentlocker"
        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 = { 750b 68???????? ff15???????? 8bc3 }
            // n = 4, score = 400
            //   750b                 | jne                 0xd
            //   68????????           |                     
            //   ff15????????         |                     
            //   8bc3                 | mov                 eax, ebx

        $sequence_1 = { 0102 0102 0201 0202 0202 0202 }
            // n = 6, score = 400
            //   0102                 | add                 dword ptr [edx], eax
            //   0102                 | add                 dword ptr [edx], eax
            //   0201                 | add                 al, byte ptr [ecx]
            //   0202                 | add                 al, byte ptr [edx]
            //   0202                 | add                 al, byte ptr [edx]
            //   0202                 | add                 al, byte ptr [edx]

        $sequence_2 = { 75ef 03fb b8???????? 8d143f 2bd0 }
            // n = 5, score = 400
            //   75ef                 | jne                 0xfffffff1
            //   03fb                 | add                 edi, ebx
            //   b8????????           |                     
            //   8d143f               | lea                 edx, [edi + edi]
            //   2bd0                 | sub                 edx, eax

        $sequence_3 = { 5f c3 be04000000 8bc6 5e }
            // n = 5, score = 400
            //   5f                   | pop                 edi
            //   c3                   | ret                 
            //   be04000000           | mov                 esi, 4
            //   8bc6                 | mov                 eax, esi
            //   5e                   | pop                 esi

        $sequence_4 = { 740a 48 85c0 7ff4 5f }
            // n = 5, score = 400
            //   740a                 | je                  0xc
            //   48                   | dec                 eax
            //   85c0                 | test                eax, eax
            //   7ff4                 | jg                  0xfffffff6
            //   5f                   | pop                 edi

        $sequence_5 = { 56 ff15???????? 83f802 740f 83f803 740a }
            // n = 6, score = 400
            //   56                   | push                esi
            //   ff15????????         |                     
            //   83f802               | cmp                 eax, 2
            //   740f                 | je                  0x11
            //   83f803               | cmp                 eax, 3
            //   740a                 | je                  0xc

        $sequence_6 = { 8b0d???????? 6a00 6a00 57 51 }
            // n = 5, score = 400
            //   8b0d????????         |                     
            //   6a00                 | push                0
            //   6a00                 | push                0
            //   57                   | push                edi
            //   51                   | push                ecx

        $sequence_7 = { 6a01 6a00 0d00800000 50 }
            // n = 4, score = 400
            //   6a01                 | push                1
            //   6a00                 | push                0
            //   0d00800000           | or                  eax, 0x8000
            //   50                   | push                eax

        $sequence_8 = { 68???????? ff15???????? 85c0 7522 68???????? }
            // n = 5, score = 400
            //   68????????           |                     
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7522                 | jne                 0x24
            //   68????????           |                     

        $sequence_9 = { 7ff4 5f 33c0 5e }
            // n = 4, score = 400
            //   7ff4                 | jg                  0xfffffff6
            //   5f                   | pop                 edi
            //   33c0                 | xor                 eax, eax
            //   5e                   | pop                 esi

        $sequence_10 = { 7514 e8???????? 3d00000600 1bc0 40 a3???????? eb05 }
            // n = 7, score = 400
            //   7514                 | jne                 0x16
            //   e8????????           |                     
            //   3d00000600           | cmp                 eax, 0x60000
            //   1bc0                 | sbb                 eax, eax
            //   40                   | inc                 eax
            //   a3????????           |                     
            //   eb05                 | jmp                 7

        $sequence_11 = { 83c404 85c0 740a c705????????ffffffff 8b15???????? 6a00 6a01 }
            // n = 7, score = 400
            //   83c404               | add                 esp, 4
            //   85c0                 | test                eax, eax
            //   740a                 | je                  0xc
            //   c705????????ffffffff     |     
            //   8b15????????         |                     
            //   6a00                 | push                0
            //   6a01                 | push                1

        $sequence_12 = { ffd6 a3???????? 85c0 741e 8b0d???????? 5f c7000c000000 }
            // n = 7, score = 400
            //   ffd6                 | call                esi
            //   a3????????           |                     
            //   85c0                 | test                eax, eax
            //   741e                 | je                  0x20
            //   8b0d????????         |                     
            //   5f                   | pop                 edi
            //   c7000c000000         | mov                 dword ptr [eax], 0xc

        $sequence_13 = { 8b35???????? 57 6a14 6a08 50 }
            // n = 5, score = 400
            //   8b35????????         |                     
            //   57                   | push                edi
            //   6a14                 | push                0x14
            //   6a08                 | push                8
            //   50                   | push                eax

        $sequence_14 = { 7525 68???????? b8???????? bb???????? e8???????? 83c404 }
            // n = 6, score = 400
            //   7525                 | jne                 0x27
            //   68????????           |                     
            //   b8????????           |                     
            //   bb????????           |                     
            //   e8????????           |                     
            //   83c404               | add                 esp, 4

        $sequence_15 = { 8b15???????? 6a0c 6a00 52 }
            // n = 4, score = 400
            //   8b15????????         |                     
            //   6a0c                 | push                0xc
            //   6a00                 | push                0
            //   52                   | push                edx

    condition:
        7 of them and filesize < 933888
}