rule win_lockergoga_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.lockergoga."
        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.lockergoga"
        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 = { 8b4da4 83c40c 8b559c 2bca c1f905 51 52 }
            // n = 7, score = 400
            //   8b4da4               | mov                 ecx, dword ptr [ebp - 0x5c]
            //   83c40c               | add                 esp, 0xc
            //   8b559c               | mov                 edx, dword ptr [ebp - 0x64]
            //   2bca                 | sub                 ecx, edx
            //   c1f905               | sar                 ecx, 5
            //   51                   | push                ecx
            //   52                   | push                edx

        $sequence_1 = { f644080c06 7546 6690 8b4604 8d4dd8 51 394608 }
            // n = 7, score = 400
            //   f644080c06           | test                byte ptr [eax + ecx + 0xc], 6
            //   7546                 | jne                 0x48
            //   6690                 | nop                 
            //   8b4604               | mov                 eax, dword ptr [esi + 4]
            //   8d4dd8               | lea                 ecx, [ebp - 0x28]
            //   51                   | push                ecx
            //   394608               | cmp                 dword ptr [esi + 8], eax

        $sequence_2 = { 8d0476 8b7de8 8d04c1 894508 8bf0 3bc7 7415 }
            // n = 7, score = 400
            //   8d0476               | lea                 eax, [esi + esi*2]
            //   8b7de8               | mov                 edi, dword ptr [ebp - 0x18]
            //   8d04c1               | lea                 eax, [ecx + eax*8]
            //   894508               | mov                 dword ptr [ebp + 8], eax
            //   8bf0                 | mov                 esi, eax
            //   3bc7                 | cmp                 eax, edi
            //   7415                 | je                  0x17

        $sequence_3 = { 33d0 8bc1 c1c802 33d0 8b45fc 8bc8 03d6 }
            // n = 7, score = 400
            //   33d0                 | xor                 edx, eax
            //   8bc1                 | mov                 eax, ecx
            //   c1c802               | ror                 eax, 2
            //   33d0                 | xor                 edx, eax
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   8bc8                 | mov                 ecx, eax
            //   03d6                 | add                 edx, esi

        $sequence_4 = { 83c302 8d0c5b 8bc2 03c9 99 bf01000000 d3e7 }
            // n = 7, score = 400
            //   83c302               | add                 ebx, 2
            //   8d0c5b               | lea                 ecx, [ebx + ebx*2]
            //   8bc2                 | mov                 eax, edx
            //   03c9                 | add                 ecx, ecx
            //   99                   | cdq                 
            //   bf01000000           | mov                 edi, 1
            //   d3e7                 | shl                 edi, cl

        $sequence_5 = { 50 8d45f4 64a300000000 8bf1 ff7508 8d4de4 e8???????? }
            // n = 7, score = 400
            //   50                   | push                eax
            //   8d45f4               | lea                 eax, [ebp - 0xc]
            //   64a300000000         | mov                 dword ptr fs:[0], eax
            //   8bf1                 | mov                 esi, ecx
            //   ff7508               | push                dword ptr [ebp + 8]
            //   8d4de4               | lea                 ecx, [ebp - 0x1c]
            //   e8????????           |                     

        $sequence_6 = { e8???????? 8b855cffffff a810 7408 8d4dd8 e8???????? 8d45a8 }
            // n = 7, score = 400
            //   e8????????           |                     
            //   8b855cffffff         | mov                 eax, dword ptr [ebp - 0xa4]
            //   a810                 | test                al, 0x10
            //   7408                 | je                  0xa
            //   8d4dd8               | lea                 ecx, [ebp - 0x28]
            //   e8????????           |                     
            //   8d45a8               | lea                 eax, [ebp - 0x58]

        $sequence_7 = { ff7508 8b4d0c 0b5510 57 56 8b01 52 }
            // n = 7, score = 400
            //   ff7508               | push                dword ptr [ebp + 8]
            //   8b4d0c               | mov                 ecx, dword ptr [ebp + 0xc]
            //   0b5510               | or                  edx, dword ptr [ebp + 0x10]
            //   57                   | push                edi
            //   56                   | push                esi
            //   8b01                 | mov                 eax, dword ptr [ecx]
            //   52                   | push                edx

        $sequence_8 = { e8???????? 8d4dd8 c645fc03 e8???????? 8b4d80 8d45a8 50 }
            // n = 7, score = 400
            //   e8????????           |                     
            //   8d4dd8               | lea                 ecx, [ebp - 0x28]
            //   c645fc03             | mov                 byte ptr [ebp - 4], 3
            //   e8????????           |                     
            //   8b4d80               | mov                 ecx, dword ptr [ebp - 0x80]
            //   8d45a8               | lea                 eax, [ebp - 0x58]
            //   50                   | push                eax

        $sequence_9 = { e8???????? 6a08 68???????? 8d4da8 c645fc0c c745b800000000 c745bc0f000000 }
            // n = 7, score = 400
            //   e8????????           |                     
            //   6a08                 | push                8
            //   68????????           |                     
            //   8d4da8               | lea                 ecx, [ebp - 0x58]
            //   c645fc0c             | mov                 byte ptr [ebp - 4], 0xc
            //   c745b800000000       | mov                 dword ptr [ebp - 0x48], 0
            //   c745bc0f000000       | mov                 dword ptr [ebp - 0x44], 0xf

    condition:
        7 of them and filesize < 2588672
}