Jump to content
Sign in to follow this  
ParodiusX

Partial Serial Number Verification System in Firemonkey

Recommended Posts

For licensing my software, I use the PKVS described here:

https://www.brandonstaggs.com/2007/07/26/implementing-a-partial-serial-number-verification-system-in-delphi/

In VCL works fine but I have problems with it in Firemonkey.

 

When I call PKV_GetKeyByte I get error message 'Range check error'.

 

function PKV_GetKeyByte(const Seed : Int64; a, b, c : Byte) : Byte;

begin

  a := a mod 25;

  b := b mod 3;

  if a mod 2 = 0 then

    result := ((Seed shr a) and $000000FF) xor ((Seed shr b) or c)

  else

    result := ((Seed shr a) and $000000FF) xor ((Seed shr b) and c);

end;

 

Any help? 

Thank you very much.

Share this post


Link to post

Well, what are your problems? Any error message would be appreciated. Apart from that, have you tried your FMX build on the same Windows machine? Was it built with the same "bitness" (32-Bit or 64-Bit)?

Share this post


Link to post
3 hours ago, ParodiusX said:

that’s not the problem

Adding this to the unit worked for me:

{$RANGECHECKS OFF}

 

Share this post


Link to post

My bad. I put the {$RANGECHECKS OFF} directive into wrong unit. I’m really sorry.

 

Thank you very much for your help.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×