Go Back   Home > Forums > Design & Build > Parts

Parts Where to get, and how to make the best bits. PCB's, caps, transformers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 5th July 2012, 09:28 PM   #21
diyAudio Member
 
Join Date: Jul 2012
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!
  Reply With Quote
Old 13th July 2012, 11:41 PM   #22
diyAudio Member
 
Join Date: Jul 2012
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.
  Reply With Quote
Old 14th July 2012, 04:19 AM   #23
diyAudio Member
 
Join Date: Jul 2012
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;
}
  Reply With Quote
Old 5th August 2012, 06:07 PM   #24
R.G. is offline R.G.  United States
diyAudio Member
 
Join Date: Feb 2005
Location: Lone Start State
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.

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?
__________________
R.G.
  Reply With Quote
Old 11th September 2012, 06:54 PM   #25
diyAudio Member
 
Join Date: Sep 2012
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!
  Reply With Quote
Old 14th September 2012, 04:56 PM   #26
diyAudio Member
 
Join Date: Sep 2012
Hello,

did you find a newer solution.
I have modify the exe, but it didnt work for me.

regards,

Gustavo.
  Reply With Quote
Old 18th September 2012, 05:17 PM   #27
R.G. is offline R.G.  United States
diyAudio Member
 
Join Date: Feb 2005
Location: Lone Start State
Quote:
Originally Posted by gameofyou View Post
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.
__________________
R.G.
  Reply With Quote
Old 18th September 2012, 05:43 PM   #28
diyAudio Member
 
Join Date: Sep 2012
Yes. I have the same problem. I search for that bytes all over de exe with out results....
  Reply With Quote
Old 19th September 2012, 03:56 AM   #29
diyAudio Member
 
Join Date: Mar 2008
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"
  Reply With Quote
Old 20th September 2012, 04:51 AM   #30
diyAudio Member
 
Join Date: May 2003
Location: Colorado
Default 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.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.slb file (translated library file)...! spice freak Solid State 0 28th October 2008 03:20 PM
File Uploader - php script with file validation lineup The Lounge 5 11th February 2007 09:09 AM
TDA1541A protel library? deskmate88 Digital Source 1 10th September 2004 06:51 AM
Convert Protel file... Danyele82 Parts 0 13th May 2004 03:52 PM
TO-247AC Protel library.... sianturi Pass Labs 3 5th March 2003 10:02 AM


New To Site? Need Help?

All times are GMT. The time now is 04:22 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2