Re: How do I - Compile a number into the program
From: Larry Serflaten (serflaten_at_usinternet.com)
Date: 05/17/04
- Next message: Jeff Johnson [MVP: VB]: "Handling Exceptions"
- Previous message: Bob Butler: "Re: regex tutorial?"
- In reply to: Guy Cohen: "Re: How do I - Compile a number into the program"
- Next in thread: Guy Cohen: "Re: How do I - Compile a number into the program"
- Reply: Guy Cohen: "Re: How do I - Compile a number into the program"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 May 2004 08:21:03 -0500
"Guy Cohen" <support@mcam2u.com> wrote
> The product is software+hardware.
> Lets say I want to provide a software on a CD that will work only with a
> unique device (modem for example).
I would suggest you use a second program to modify the bits in a
copy of the exe.
It seems you'll have a device with a unique number, and you want to
test for that number in your program. So, leave space in your program
for the number, and use a second program to insert that number into the
program after it is compiled.
You would then only need to run that second program, and enter the
unique number which will cause it to make a copy of the exe with that
number added. You then copy that exe to the CD, and send it off.
There would be no need to recompile the program for different numbers.
How do you leave space in your program? That depends on how
secure you need to be. Plus the code to check the number has to
be well hid, also (possibly in several paces) But for a simple method,
add a long string of Chr(127) in a module somewhere. When the
program is compiled, look through the file to find that string of
characters. When you find it, replace the first character with your
first digit, and take the difference of that digit and 127, and add that
to the last character. Take the second digit and put it in the second
position and take the difference of that digit and 127 and add that
to the second to last character.
You basically alter the first part of the string to the required digits
and alter the last part of the string to keep the two 127's balanced
so that the checksum for that section remains the same as it started.
If you know you need ten digits then make it a 25 character string,
or so, and when you go to test, only grab the first ten digits of
the string....
LFS
- Next message: Jeff Johnson [MVP: VB]: "Handling Exceptions"
- Previous message: Bob Butler: "Re: regex tutorial?"
- In reply to: Guy Cohen: "Re: How do I - Compile a number into the program"
- Next in thread: Guy Cohen: "Re: How do I - Compile a number into the program"
- Reply: Guy Cohen: "Re: How do I - Compile a number into the program"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|