REDIVIVUS

Proposals / #743

Name the key and length parameters of CACHE_EncryptBlock from their register roles

applied · by jaenster · submitted 2026-11-01, applied 2026-11-02

Ghidra v1806 · 5501650

Both parameters carry generic placeholders. The asm fixes each role: at 00518ec4 SHR EDX,0x2 turns EDX into the dword count driving SUB EDX,1/JZ, so EDX is a byte length; ECX is masked by AND EBX,0xff to index the crypt table at 00518eeb and is added to the seed by LEA EBX,[EAX+ECX] at 00518ef7, so ECX is the key. Its sibling CACHE_DecryptBlock at 00518e60 is the same algorithm (same 0xEEEEEEEE seed init, same +0x1000 crypt table row, same key*0x21+3+plain recurrence) and already names these roles dwKey and nByteLen; only the register assignment differs between the two statics, so using the sibling's names keeps the pair consistent. The third parameter (EAX, the buffer) is left alone: pnParam is a chosen name.

Changes 2, applied together

  1. Rename variable win 0x00518ec0 ECX

    namenParam1→dwKey
  2. Rename variable win 0x00518ec0 EDX

    namenParam2→nByteLen