Forum Moderators: phranque

Message Too Old, No Replies

looking for software help

         

Blelisa

7:37 pm on Nov 5, 2004 (gmt 0)

10+ Year Member



I have a very serious problem that I have been trying to solve for three months now. I need some help please.
I have a program that is a license key generation program. It is written in C++ and we have a command line version as well as a windows version. I want my resellers who are located internationally to be able to go to my website, run the license key program, input the information it needs, and get the key code back. However, I DO NOT want them to have the ability to download the program to their lap tops for obvious reasons.
Now I am willing to purchase software if there is a program out there that can allow us to do this. I have downloaded ASPexec but all that does is start the program on my server and does not give me access to it on the client side.
Please help, my time is running out quickly and It is a dire need for this site.
Thank you in advance!

kaled

7:54 pm on Nov 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The obvious solution is to rewrite the keygen in Perl, however, I'm sure there is an easier solution.

This is outside my real understanding, but the program must be treated as a cgi program ie it must run on the server and read/write STDIN and STDOUT and output HTTP headers as well as the keycode, etc.

If you ensure it outputs a minimal HTTP header and install it in the cgi bin, it should work, I think. (I am, of course, assuming that you are using a Windows server since a C++ program compiled for Windows won't run on any other platform.)

Kaled.

Blelisa

8:03 pm on Nov 5, 2004 (gmt 0)

10+ Year Member



Hi Kaled,

Thanks for your reply. This is why I was wondering if there is a program out there to purchase that would help me do this. You lost me after the first paragraph.

jdMorgan

8:41 pm on Nov 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You don't need a program, but rather a person who is experienced in configuring scripts to run on your server. You might consider searching for contractors using "<server_type> C++ application consultant" or something like that. For someone who is 'expert' in this, it should only take a couple of hours.

Basically, hide the program behind a Web page, have the Web page call the program to produce the required (key) output, and lock down the program so that it only accepts requests from that page on your server. Kaled's reply says essentially the same thing in different words.

Jim

kaled

12:18 am on Nov 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you can confirm that you are using a Windows server, I can probably explain the essentials of cgi. Adapting the existing console version of your keygen should be straightforward. However, I am not certain that a Windows Server can run a console program (such as your keygen) as a cgi program but it seems likely that it could.

Kaled.

Blelisa

12:38 pm on Nov 8, 2004 (gmt 0)

10+ Year Member



Hi Kaled,

The server at my hosting company is a Windows 2000 server

kaled

4:59 pm on Nov 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



CGI in a nutshell

Essentially, a cgi program works just like a console program except that no interaction with the user is possible. In other words, you must supply all the required data when the program starts. In addition, you must begin the output with an HTTP header. This consists of simple text and is terminated by a blank line.

The query part of an url (the text following a '?') is supplied to the program as an environment variable QUERY_STRING. This is how form data sent by the GET method is delivered.

Data sent by the form POST method is made available through the STDIN file (i.e. it is read as though it were entered by keyboard).

The HTTP header must, as a minimum contain a MIME type. I often use a cache instruction too.

Content-type: text/html
Cache-Control: no-cache

Remember it must be terminated by a blank line.
I am not certain, but line-termination may require simply an LF char rather than the CRLF used by Windows. (ie It may require ascii #10 only rather than ascii #13 #10.)

If you set the content-type to text/html, you should output a valid html page i.e. <HEAD><BODY> etc.

When testing & developing, you will need to create a batch file. It should look something like this:-


set SERVER_NAME=www.yourdomain.com
set HTTP_REFERER=http://www.yourdomain.com/form-page.html
set QUERY_STRING=param1=value1^&param2=value2^&param3=value3
cgiprog.exe <testin.txt >testout.html

i.e. you must set up the required environment vars (note the use of the ^ char). You must also arrange to pipe input and output to files.
For initial testing, ignore the output pipe and simply view the output.
For final testing, pipe the output to a file, view it with a browser and then validate it. (You may need to edit out the HTTP headers before viewing with a browser).

So, in theory, it's straightforward. However, I suggest that you confirm with your host that you can install a cgi program written in C++ before you proceed.

Kaled.