procedure LockToKey(DWord srcbuf; DWord destbuf) {
esi = srcbuf;
edi = destbuf;
eax = 'yeK$';
stosd
al = 32;
stosb
esi = @[esi+6];
ecx = nil;
while (byte ptr[esi+ecx] <> '|') {
if (dword ptr[esi+ecx] == '=kP ') {
break;
}
ecx++;
}
if (ecx < 3) {
exit;
}
al = [esi];
xor al, 5
ah = al;
shr ax, 4
and ax, 0ff0h
or al, ah
[edi] = al;
edx = nil;
edx++;
while (edx < ecx) {
al = [esi+edx];
xor al, [esi+edx-1]
ah = al;
shr ax, 4
and ax, 0ff0h
or al, ah
[edi+edx] = al;
edx++;
}
al = [edi];
xor al, [edi+ecx-1]
[edi] = al;
edx = nil;
while (edx < ecx) {
al = [edi+edx];
[esi+edx] = al;
edx++;
}
edx = nil;
while (edx < ecx) {
lodsb
if (al == 0) {
eax = 'CD%/';
stosd
eax = '000N';
stosd
ax = '/%';
stosw
} elseif (al == 5) {
eax = 'CD%/';
stosd
eax = '500N';
stosd
ax = '/%';
stosw
} elseif (al == 36) {
eax = 'CD%/';
stosd
eax = '630N';
stosd
ax = '/%';
stosw
} elseif (al == 96) {
eax = 'CD%/';
stosd
eax = '690N';
stosd
ax = '/%';
stosw
} elseif (al == 124) {
eax = 'CD%/';
stosd
eax = '421N';
stosd
ax = '/%';
stosw
} elseif (al == 126) {
eax = 'CD%/';
stosd
eax = '621N';
stosd
ax = '/%';
stosw
} else {
stosb
}
edx++;
}
exit;
}