You are not allowed to change the length of the p3d file, if the original texture has the following entry in the p3d
data\texture1.pac
then you have to modify the name of your texture to match this length. It is a matter of what your pbo file is called, for instance
myaddon.pbo
then you have to change the name of the texture to
text1.pac
because the complete path would look like this
myaddon\text1.pac
the name can be whatever you want, important is the length. Backup of the p3d file highly recommended before you start
Best is you make a list where you write all the original pathnames and the new pathnames.
Open the p3d in a hexeditor, call up the replace function, switch it to ascii mode and put the first original path in the search field and the new path in the 'replace with' field. Hit replace all.
Do that with all the pathnames.
Save the p3d and check if it has still the same filesize as the backup u made. If yes, chances are you were succesful
Good luck!
If you have questions, ask