Legal crackme I authored. UPX -d gets the inner blob. The stub walks the IAT and XOR-decodes .text with a 4-byte key derived from the PE timestamp.
In Ghidra I bookmark the decoder loop and apply the key with a short Python script, then re-analyze. If you have a cleaner way to force the decompiler to pick up the decrypted bytes without a full reload, I want it.
- bookmark decoder
- apply key
- re-analyze
key = pe.FILE_HEADER.TimeDateStamp.to_bytes(4,'little')
for i,b in enumerate(blob):
blob[i] = b ^ key[i % 4]Refs: Ghidra
Lab / educational. Public binaries and patched classes only. Isolated VM.