Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazarus IDE v2.2.6 Debian 12.5 OnGuard\onguard\examples\regdemo\ Result false when Compare the two release codes #11

Open
vk-git-hub opened this issue Sep 26, 2024 · 0 comments

Comments

@vk-git-hub
Copy link

OnGuard\onguard\examples\regdemo
uni_regcommon.pas

Why result false when compare the two release codes?
// Compare the two release codes
result := AnsiUpperCase(ReleaseCodeString) = AnsiUpperCase(BufferToHex(CalculatedReleaseCode, sizeof(CalculatedReleaseCode)));

function IsReleaseCodeValid (ReleaseCodeString: string; const SerialNumber : longint) : boolean;
var
CalculatedReleaseCode : TCode;
begin
// Remove spaces from the Release code
while pos(' ', ReleaseCodeString) > 0 do
System.Delete(ReleaseCodeString, pos(' ', ReleaseCodeString), 1);

// Calculate the release code based on the serial number and the calculated machine modifier
InitSerialNumberCode(MachineKey, SerialNumber, Expires, CalculatedReleaseCode);

// Compare the two release codes
result := AnsiUpperCase(ReleaseCodeString) = AnsiUpperCase(BufferToHex(CalculatedReleaseCode, sizeof(CalculatedReleaseCode)));
end;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant