loading library file in protel 99

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Ok, I just spent a long day debugging Protel 99 SE (Service Pack 6) in OllyDbg to solve the problem of not being able to load the library files in Windows 7 ("File not recognized").

The library dialog tries to concatenate the filename and path of the selected library file to obtain a full path to the library file that you want to add. But, a call to the windows function SHGetPathFromIDListA corrupts the memory where the filename is stored (it puts a zero where the string starts, which, in the null-terminated string world, means that the string is now suddenly empty). The dialog gets confused and doesn't succeed in opening the file.

The call to SHGetPathFromIDListA does not do anything noteworthy, so I replaced all instructions related to that call with NOP instructions. This solved the problem.

So: get yourself a hex editor (I use "HxD", it's free) and edit the "Client99SE.exe" file. Change all bytes from offset 2690E to 26917 (= a total of 10 bytes that need to be changed) to 90.

A NOP instruction is 90 in hexadecimal, hence the change.

Save the changes, run Protel 99 SE, try loading a library, should work. I will do some more testing and - if necessary - tinkering if there are still more problems.

Enjoy!
 
Thanks, that worked well, but only fixes the library dialog for the PCB editor.

So I followed your same approach and found where to patch for the schematic library dialog as well (I don't understand why the code is duplicated, as the dialogs are pretty much identical, but anyway...)

Patch offset 0x25f78 to 0x25f81 inclusive with 0x90 (original bytes were: 50 8b 45 ec 50 e8 7e c1 fd ff ) in Client99SE.exe

With both these patches applied, you can add libraries to both the pcb and schematic under windows 7.

Is there a list of what else is broken in Protel 99SE under Windows 7?

Thanks again,
Tony.
 
A simple program to patch Client99SE.exe.
Build it, then pipe the original Client99SE.exe in and redirect out into the patched.exe
ie: patch.exe < Client99SE.exe >Client99SE_patched.exe

All responsibility disclaimed. This may eat your dog....( It did however work for me)
Code:
#include <stdio.h>
int c;

int match( int *bytes, int size ){
    int i = 0;
    while( i < size){
        if( c != bytes[i]){
            fprintf(stderr,"\nMismatch at %lx, expected 0x%02x, found 0x%02x", 
                    ftell(stdin)-1, bytes[i], c);
            return 0;
        }
        i++;
        c=getchar();
    }
    return 1;
}

void patch( int *patch, int size){
    int i;
    for( i = 0; i < size; i++){
        putchar(patch[i]);
    }
}

int main(int argc , char *argv[]){
    int p1loc = 0x25f78;
    int p1match[10]={0x50, 0x8b, 0x45, 0xec, 0x50, 0xe8, 0x7e, 0xc1, 0xfd, 0xff};
    int p1patch[10]={0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90};
    int p2loc = 0x2690e;
    int p2match[10]={0x50, 0x8b, 0x45, 0xe8, 0x50, 0xe8, 0xe8, 0xb7, 0xfd, 0xff};
    int p2patch[10]={0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90};
    
    int pos = 0;
    c=getchar();
    while( c != EOF){
        pos = ftell(stdin) - 1;
        if( pos == p1loc && match(p1match, 10)) patch(p1patch,10);
        else if( pos == p2loc && match(p2match, 10)) patch(p2patch,10);                
        putchar(c);
        c=getchar();
    }
    return 0;
}
 
I ... just... had to upgrade the layout machine to Win7, and ran bang into this problem.

Found this threat, breathed a sigh of relief, and got out the hex editor.

... only to find that those offsets don't contain the data you mentioned, either place. :eek:

I did some scoping out of stuff, trying to match strings and such, but never found the right hex strings.

I suspect this is from some variation in the fix level or some such making the call to the windows api come out to a different binary value.

Is there any simple way to locate these dialogs in the hex without resorting to the debugger?
 
GuntherVB and bonybrown,

Thank you very much!!!

I performed the modifications to Client99SE.exe with a hex editor, and now the libraries are working correctly under Windows 7!

This is very convenient, as now I don't require a legacy XP machine around to do my hobby work. Thanks again!
 
GuntherVB and bonybrown,
I performed the modifications to Client99SE.exe with a hex editor, and now the libraries are working correctly under Windows 7!
It's clear that there are at least two variations of the .exe file. I have the service pack 6 version, and the patches suggested here do NOT work in the version I have - and apparently the one Gustavo has, either.

Not only that, I spent some time with a hex editor searching for that sequence of bytes in the exe file I have, on the theory that they're at some other offset. No joy - they were not found anywhere in the file.
 
I "fixed" this problem in XP with a batch file - I have clean versions of Client99SE.INI and ADVPCB99SE.INI, and my batch file deletes the originals (corrupted by protel) then renames the clean ones, then opens Client99SE.exe.

It occassionally crashes when switching between editing libraries and working on projects, but thats not too annoying.

Kudos for the real fix though - well done.

my batch file:
del c:\windows\Client99SE.INI
copy c:\windows\Clean_Client99SE.INI c:\windows\Client99SE.INI

del c:\windows\ADVPCB99SE.INI
copy c:\windows\Clean_ADVPCB99SE.INI c:\windows\ADVPCB99SE.INI

"c:\program files\design explorer 99 se\client99se.exe"
 
NOP Patch Worked for Me

I am running Win7 Professional 64 bit with Protel 99 SP6. I found the bytes given in the two posts by Gunther VB and BonyBrown and made the changes to 0x90 (NOP).

Previously I had moved copies of the actual libraries to the root directory instead of the "Documents" folder, but only in the PCB library. When I loaded the PCB library, everything worked perfectly. But when loaded the Schematic library, I got a message that said no libraries were present.

So I moved copies of the Schematic libraries into the root directory of the DDB. Now it loaded, but it loaded *both* copies and I had two of each Schematic library. I went back and left the ones in the root directory alone but changed the files extension in the "Documents" folder to .LI$. Now when I loaded the Schematic library, everything worked perfectly.

Bottom line:

1) The byte changes to NOP's worked perfectly for me with Protel 99 SP6.

2) The libraries need to be in the root directory of the library DDB and not in the documents folder.

I hope this helps.
 
Protel 99SE Vs. Windows 7 Ultimate, Just for sharing,
The problem = Dead audio (Sound Card drivers Stopped Working).
The solution = Please Re-Install again your Protel 99SE in the Save Mode of Windows 7
----> Restart = Ok,
Thanks to God
( From Kediri - Indonesia with Love)
Good luck
 
I had the same problem as some of the other guys in that I didn't find the correct data at the address offset specified for the patch. I found that if I downloaded and installed the latest (as at 29 Nov 2012) Protel Service Pack 6 from the Altium website (Legacy Downloads), the problem was solved.

I applied the patch as described and it appears to work OK for me.
 
Changing to 90, not working for me, WHY?

Hi. I had to download service pack 6 ( I was still running 5), installed it and then looked for the values to change to 90. The second set corresponded to the old values, so I was certain that the version is the same as yours. I then tried loading libraries, but it is still not recognized. What am I doing wrong?
Please help!
 
Hi. I had to download service pack 6 ( I was still running 5), installed it and then looked for the values to change to 90. The second set corresponded to the old values, so I was certain that the version is the same as yours. I then tried loading libraries, but it is still not recognized. What am I doing wrong?
Please help!

Hi, except applying the patch with values 90 in 2 places as mentioned earlier, there is another step which also must be done in order to be able to load libraries. This is related to default mechanism used in Vista and Win7 that "well known" extensions of files are not shown in the folder. Please note that in Protel you see only the name of library when trying to add it and not full file name with extension, for example it is shown Liteon but must be shown Liteon.ddb in order to correctly load it.

OK, how to solve it........

Option 1:
Update registry for 2 types of extensions *.lib and *.ddb by adding the string AlwaysShowExt for 2 Keys coresponding to them. Save text below to protel.reg file and load it to registry by double click on it.

Code:
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\.ddb]
@="ProtelDesignFile"
 
[HKEY_CLASSES_ROOT\.lib]
@="ProtelLibraryFile"
 
[HKEY_CLASSES_ROOT\ProtelDesignFile]
"AlwaysShowExt"=""
 
[HKEY_CLASSES_ROOT\ProtelLibraryFile]
"AlwaysShowExt"=""

Option 2:
Switch on the showing of known extensions by changing the folder options as follows:
1. Open Windows Explorer and then any folder
2. Click "Organize", scroll down and click "Folder and search options".
3. Click the "View" tab. Scroll down until you see "Hide extensions for
known file types", un-check this line here by clicking on the check box.
4. Click "OK" and now your file extensions (all) will now longer be hidden.

Cheers
/Zibi
 
Windows update breaks the fixed Protel file

When I patched the protel file to make libraries accessible, I saved off a copy of the freshly installed and patched file, just in case.

Recently after a windows update, the old 'can't get to libraries' issue reasserted itself.

I swapped in a copy of the freshly patched protel file to make sure the working copy was not corrupted. It was not.

It appears that the recent windows update did something that caused the problem to reappear.
 
I know this thread is a bit old but I think I have just found a workaround the problem!
Morning cofee makes wonders sometimes :)

I have been using Protel since the version 1 (in DOS!) and I always bought the upgrades up to protel 99SE service pack3
On my new laptop (WIN 8) I have the problem exposed in this thread.
I tried many of the suggestions here but nothing worked.
Then I tried the following and it seems to work! (for schematic)
- go to TOOLS---- Find components
- in the panel that will appear, check ''By library reference''
- in the ''search'' section set the path to where your libraries are
- in the same section check both the 'subdirectories' and 'all instances'
- now go back to the search section and enter a part number that you know within asteriscs ( * ) ex: *NE5534*
- the system will do a search and find a few libraries
- select one of the libraries and click on the 'Add to library list' button and Bingo, its there now!

Also I found another trick. (works in WIN 8, I don't know for the others)
Exit and close protel completely
In windows explorer go into your directory where you have all your *.ddb ( I tried a few in schematic)
double click on the one you want to see and protel will open automatically and you will have available all the *.lib of that database.
I did not find what to do with that as of yet but with those two tricks, now I can work properly.

This may seems inconvenient at first, but it works very well

On the other hand, you will find that the latest components are not in those libs and you will have to make them yourself. The latest op amps, microcontrollers etc are not there, but it is quite simple to make your own lib as we tend to work with pretty much all the same stuff.
For the PCB libraries, I have always made my own, I don't like the ones made by Protel anyway.

So try it and lets see if it works for you
Luc
 
Alternate Offsets

For those who could not locate (or match) the code & offset to modify their exe file, I have done some research on my exe file and provide the following alternate information...

When studying patterns of the code, including the distance (2454 in decimal) between the 2 posted hex offsets (2690E and 25f78) I was able to find something interesting somewhere else in my Client99SE.exe file.

Check your file for the following code in these 2 hex offset locations:

27D90
50 8b 45 ec 50 e8 46 a2 fd ff

-and-

28726
50 8b 45 e8 50 e8 b0 98 fd ff


Then replace the 10 bytes in each location with NOPs (hex 90).

The distance between these 2 alternate offsets is also 2454 (in decimal).
This suggested to me that the file was some differing minor version that others are using and this is why the file locations are different.
I had to work it on a hunch since proper version reporting for each of the posted hacks were not provided, but I can't convince folks to hand in their homework in a completed fashion. :)

Worked as it should and fixed the library loads for me.

My Client99SE.exe version is 6.6.7 (SP6), size = 1,022,464 bytes.

Hope this helps someone.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.