Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP HELP!!On pascal program of 1996!!! 1

Status
Not open for further replies.

athanasios13

Technical User
Oct 22, 2007
13
GR
Hello!
I am facing a very difficult problem and i'd like your help..:)
You see my mother had a computer since 1990 in which she had a program (in dos platform) which she used to create records for patients..The program was written in 1996 and the programmer since then has dissapeared..It might sound funny but my mother was using this program till now..

The problem is that we want to upgrade to a "serious" system(pentium etc) and the program is locked to the first computer...
I tried to copy the files into a new pc but i got a screen saying that the programm is locked to the first computer..When i started searching the files of the programm i found one file called "UNLOCK.cpp"
My mother remembered that the program was written in pascal..but she is not sure
I thought that if i could compile the "UNLOCK.cpp" into a UNLOCK.exe i could probabbly unlock the program and copy it to my new pc..
But i'm not sure if this file is written in pascal. Normaly i thought that it was written in c++ because of its .cpp extension..
I tried to compile with dev pascal but i got 2 errors..:
1 / 1 unlock.cpp
Error: Illegal char constant
1 / 1 unlock.cpp
Fatal: Syntax error, BEGIN expected but const char found


Any help?


thanx in advance :)
 
What does the file content actually look like?, can you open it in an editor such as Notepad and see code?, or do you just see a file full of characters.
 
yes i can see the code..but when i try to compile it i get errors..
 
i m afraid i can not publish it..but if i could send you a private message? :)
 
Hi

That is why I asked only the first dozen of lines.

There is nothing I can do better than all the 1071 members of this forum together. Is in your interest to give us a clue in public.

Feherke.
 
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#include <txtutils.h>

int unlock=TRUE;

void Wrong()
{
View v(40,4,4);

v.BothCenter();
v.FillBox();
v.Print(1,2,"locked");
delay(5000);

unlock=FALSE;
}

int System(FILE *fp)
{
int j1,j2;

asm int 0x11
asm mov j2,ax
fread(&j1,2,1,fp);

return (j1==j2);
}

int OverMem(FILE *fp)
{
int j1,j2;
asm mov ah,0x88
asm int 0x15
asm mov j2,ax
fread(&j1,2,1,fp);

return (j1==j2);
}
 
ok these are the first lines..is there any possibility that it is written in C++?
Thanx again..
 
Hi

Well, that has certainly nothing to do with any Pascal variant.

C++ is an extended C. From what you posted, it is plain old C, and I do not think it could have anything to deserve the ++.

Look in that file. if you find a function declaration for [tt]main()[/tt], then it was designed as entrypoint, if not, then it is just a "unit" of a biger program.

But this becomes off-topic here. Move with this question to forum205.

Feherke.
 
Thank you very much...your answer was very helpful..I will make a new thread in the forum of c..

I will ask you something last: i can not see a main() function..Does this mean that i cant build an exe of the program?
Thanx again
 
Hi

The declaration of the [tt]main()[/tt] function may vary. It can be like any of below or combination/variation of them :
Code:
main()
void main(void)
int main(int argc,char *argv[])
Without such entrypoint the csources can be compiled into object files but those can not be linked into an executable. Depending on the organization of the source, sometimes may be possible to guess what you need in the [tt]main()[/tt] and reconstruct it.

But the guys in the C forum knows such things much better.

Feherke.
 
As part of an upgrade to a "serious" system, you will get either XP or Vista. For what you posted, I see embedded Assembly language as well, which will pose a problem on NT based systems.

It might just pay to try to find something else (either off the shelf or rewritten) which performs the same function, especially since this program was "locked" to the computer (evidently some scheme the programmer cooked up as a "lock-in" to get more business), and it'll likely not work as well as desired anyway. The alternative is DOSBox or a VM.
 
VM stands for virtual machine?
IS there any way to simulate in a new xp machine the program?

I took the hard disk put it on another computer and started with a boot disk to get dos..After that, i tried to execute the program and i got again the same screen..
My first guess was that the program might be locked only to the serial number of the specified HD. But if that was true the program should have worked even if i took the HD and put in another pc..
So i guess that the program is locked using also other characterists of the ancient pc..e.g. mobos manufactor etc..
I am afraid that my solutions are reducing... :(
 
Ha! I just had this crazy idea inspired from the words of glen9999!
If there was a prog like cpu-z for dos that could save the ancients computer's specification and then using this specification i could simulate it on a xp mahine?!Wouldn t that be great?!I guess it is science fiction... :(
 
I'm not sure there's anything like that. And from the other thread, it appears that I would be right.

If you have all the source files (which I doubt now), you could remove the protectionist code and recompile.

Or find another way to handle what the program does? What does it do precisely? - "create records for patients" - does that translate to "data record storage and retrieval"? If so, that should be somewhat easy with today's programming stuff if you have all the underlying business rules documented somewhere. In fact, something like Access should be a handy replacement. Of course, there's always the concern of converting hte old data.

Or to follow your idea (and it'd be much harder, though), you could get a copy of the DOSBox source and modify it so it returns the specs of the old machine. Then try it to see if the copy protection of this program buys it.

(of course, this is a great highlight of the result of all these copy protection schemes these companies are doing now, especially Microsoft and Vista. Play nice and accept the vendor lock-in, or face the consequences...)
 
VMWare make a converter program that will convert any physical harddrive into a virtual machine. I haven't used it, but I presume it takes creates a virtual machine with different virtual hardware with all the programs, settings, etc from the physical machine.

It's an ISO image that you make into a CD, boot from it and let it send the virtual machine image over the network to another computer's harddrive.

It's a free download - grab it here:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top