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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!In Ancient Program! 1

Status
Not open for further replies.

athanasios13

Technical User
Oct 22, 2007
13
GR
Hello!
After posting to another thread (for pascal) as i was "mis-informed" about the language of the program i finally write to the right topic..
I had this program in a computer since 1996 which run in dos platform.

The problem is that i want to upgrade to another pc 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"

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..

the first lines of this cpp file are:
#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);
}

The file has not a main() function in it..
Can anyone tell what this
asm mov ah,0x88
asm int 0x15
asm mov j2,ax
mean?I guess that you type in dos "unlock.exe myprogram.exe"
and it writes somes values in it. Am i right?

Any help?


thanx in advance :)

 
Hi

athanasios13 said:
Can anyone tell what this
[tt] asm mov ah,0x88
asm int 0x15
asm mov j2,ax[/tt]
mean?
It is the call for interrupt 0x15's function AH 0x88 to find out the size of extended memory. Given that there is also a call for interrupt 0x11, to get ot list of hardware equipment, it may be the dirtiest protection method ever.

Feherke.
 
That means that we cannot do anything i suppose... :(
Bad news.. :(
Is there any chance that i could simulate my ancient pc on my new?!!That means that i get the list of hardware equipment of my ancient pc and make (not me...a suitable program..)a virtual platform in which the program will run?
 
DOSBOX is one example of such a virtual machine.
It's primarily aimed at running old games, but it might be enough for your purposes.

Here is a comparison chart of several.


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
ok this is what i found and might help...

int Unlock()
{

FILE *fp=fopen("td.exe","rb");
fseek(fp,0L,SEEK_END);
fseek(fp,-11L,SEEK_CUR);

if (!System(fp))
Wrong();
else
if (!OverMem(fp))
Wrong();
else
if (!VideoMem(fp))
Wrong();
fclose(fp);

return unlock;
}

As i can imagine this function goes to the end of the td file,counts eleven backwards and checks if e.g. the values from call for interrupt 0x15's function AH 0x88 are the same with the values in the specific place in the file..
Is there any way to find these values and change them according to my new system?
I thought that WinHex could help for this..
 
I'm not sure why the function UnLock return value and the variable unlock aren't boolean rather than int.

Here's a quick and dirty way that should do what you want:
Code:
int Unlock()
{
return TRUE;
}

Lee
 
In the main program folder i can see:
programNameRUN.exe
LOCKER.exe
TD.exe (the one that is appeared in the unlock function as you u can see above.)

i tried to delete the locker.exe and i got a message that it is being used from another prog or person and it couldnot be deleted..
"
Here's a quick and dirty way that should do what you want:
CODE
int Unlock()
{
return TRUE;
}"
the problem is that i cannot compile the cpp becuase i get errors. And i have not all the other cpp's to modify and compile the total program..
Can i make a guess?!
I think that the programNameRUN.exe calls LOCKER.exe and it checks for the hardware and gives true if its ok (ancient pc) and false if its it not.
Can anyone tell me how to make a new exe that will return true or false or 0 or 1? So i will try to rewrite the LOCKER.exe and see what i get..
 
If you have a hex editor, you could change

Code:
mov j2,ax

to

Code:
mov 1,ax

since that appears to be what the code is doing.

Lee
 
I have winhex..Do you mean change these values on the:
programnameRUN.exe, the LOCKER.EXE or the td.exe?
Have any idea how to find this "mov j2,ax" in winhex?

Thanx in advance
 
seriously, seriously, replace the whole thing with an access database. It will probably take less time to do, and it will certainly be more future-proof.

Even if you manage to circumvent the check on upper & extended memory and devices, you can't be sure this won't have knock-on effects elsewhere.

Perhaps the program even uses extended memory somewhere; being a dos program it may use it in a very non-standard way.

To be honest, this doesn't look like copy-protection to me, since if I were doing copy-protection I wouldn't give you the source-code! If there's another reason behind it, it would be worth knowing the reason before bypassing it.

But good luck, whatever route you choose.
 
trollacious:
If you have a hex editor, you could change
Code:
mov j2,ax
to
Code:
mov 1,ax

You cann't move something to a constant (1).
Better change
Code:
return (j1==j2);
to
Code:
return (j1==j1);
In asm it will look something like this:
Code:
mov ax, [bp-6]
cmp [bp-8], ax
could be changed to:
Code:
mov ax, [bp-6]
cmp [bp-6], ax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top