@database "XPKPatch.guide" @author "Grzegorz Królik" @$VER: XPKPatch.guide 1.6 (18.11.99) @(c) "Copyright © 1999 Grzegorz Królik" @wordwrap @node main "XPKPatch 1.6" Welcome to documentation of my new program @{b}XPKPatch@{ub} - 1.6. Click one of the following gadgets: @{fg highlight}Introductory information@{fg text} @{"Program version " link version} @{"Copyright and spreading " link copyright} @{"What it does " link whatdoes} @{"Program requirements " link requirements} @{fg highlight}Detailed description@{fg text} @{"Starting the program " link starting} @{"Stopping the program " link stopping} @{"Virus detecion " link viruses} @{"'Everyday' use of the program" link using} @{fg highlight}Additional information@{fg text} @{"How it works " link details} @{fg highlight}Final information@{fg text} @{"Program history " link history} @{"Getting upgrades " link upgrades} @{"A few final words " link final} @endnode @node version "Program version" @{b}XPKPatch@{ub} A small patch that makes XPK or PowerPacker datafiles and executable files crunched with XPK act completely as if they were normal files. @{b}Version 1.6@{ub} Copyright (C) 1999 Grzegorz Królik Compilation date: 18 November 1999 @endnode @node copyright "Copyright and spreading" This program is spread as SHAREWARE. If you desire to use it regularly, please register. You can do it by sending me a small sum of money. This sum is fixed and it amounts 5 USD. But if you do not live in Poland and want me to send you the registered program, please send 2 USD more (postage), that is 7 USD altogether. The money you can send in any way. But I think that the safest way to do it is money order. Note that I SHOULD GET 5 USD, but not you are to pay as much, in other words - I do not care about expenses you have to bear sending me the money. You should send it directly to me. My address is in chapter @{"A few final words" link final 9}. The above-mentioned sum DOES NOT include the price of a disk. You should send me the disk on which I will save you the program, or send a litte more money in order that I could buy a disk. Also please drop me a line on your machine configuration (its type, memory @{b}@{fg highlight}(VERY IMPORTANT!)@{ub}@{fg text}, operation system, hard disk, external devices, etc.), and let me know where you got this program from. If you have obtained a licensed version of this program from somewhere else, I give you the right to test it for two weeks. After that you have to make up your mind and: pay the shareware or give up the program. DEMO version has all options that the licensed one, but it stays in the computer's memory only for 15 minutes and then it terminates itself without any warning. The DEMO version gives you full chance to test it in practice, and also discourages to use it often. This version is spread as FREEWARE. What can you gain by registration? - You will get the full, licensed to your name version of XPKPatch. - You have the right to expert advice from the author in case of any troubles with using the program. - You have the right to get gratuitous upgrades. You will be informed if any upgrades are made (see @{"Getting upgrades" link upgrades}). - You will support the author. Spreading the licensed version on PD disks is forbidden - only the DEMO version can be spread on PD disks. This program may be spread only with the following files: XPKPatch.info XPKPatch (dir) XPKPatch - file present only in licensed version XPKPatch.info XPKPatchDEMO XPKPatchDEMO.info XPKPatch.guide XPKParch.guide.info XPKPatch_pl.guide XPKPatch_pl.guide.info This program may be also spread as an archive, for example LhA. Changing the program and (or) its documentation is forbidden! The source code is not spread with the program, but (in EXCEPTIONAL cases) you can get it from me. IMPORTANT NOTE: The author of XPKPatch is not responsible for any data loss, caused because of faulty work of his program. Using XPKPatch is user's own risk! @endnode @node whatdoes "What it does" This program makes work with XPK or PowerPacker datafiles and executable files crunched with XPK much easier. This is the successor to PowerPacker Patcher by Michael Berg. After installing the program, system will see the XPK or PowerPacker datafiles and executable files crunched with XPK as if they were normal files. So from now, loading XPK or PowerPacker datafiles into your favourite program (text editor, graphic program, etc.) which does not recognize these files itself, does not make troubles. @endnode @node requirements "Program requirements" This program does not have too excessive requirements! It works correctly under any OS version, beginning from 1.3! Yes, of course it works under OS 1.3!!! Besides, it works with any processor of Motorola 680xx and it also works with 0.5 Mb RAM (but I recommend at least 1 Mb). This program also requires the xpkmaster.library in version 2 or later. And of course, in spite of this, it also requires the suitable sub-libraries that must be placed in the LIBS:Compressors. @endnode @node starting "Starting the program" This program may be run in the same way as almost every program on Amiga, that is: from Shell or from Workbench. In both cases you can supply XPKPatch with some arguments (in argument line when starting from Shell and in ToolTypes when from Workbench). Syntax: XPKPatch [-c] [-n] [-u] [-p] [] Because XPKPatch (like PowerPacker Patcher) has a simple virus-detection mechanism (see @{"Virus detection" link viruses}), I think it was good to add the possibility to turn it on or off. Using the parameters '-c' or '-n' you can turn this function on or off. These parameters are case insensitive. Supplying XPKPatch with '-c' (CHECK) you can turn this option on, and supplying it with '-n' (NOCHECK) you can turn it off. XPKPatch also decrunches executable files. This function is sometimes unnecessary. So I have added the possibility to turn it on or off. Using the parameters '-u' or '-p' you can turn this function on or off. These parameters are also case insensitive. Supplying XPKPatch with '-u' (UNPACKEXE) you can turn this option on, and supplying it with '-p' (PASSEXE) you can turn it off. These parameters should be supplied separately. They should not be linked (eg. '-cp'), whereas the sequence and amount are optional, eg: XPKPatch -n -u ..., XPKPatch -c... The second/third argument is the name of the path where you would like XPKPatch to save temporary files (see @{"How it works" link details 12}). If the user runs XPKPatch with no arguments it will use the default ones, i.e. '-c' (virus detection), '-p' (executable files will not be decrunched), and as the temporary path it will use RAM:. In case of starting this program from Workbench, the parameters you should supply as follows: In ToolTypes item of its icon you must type: VIRCHECK = (YES|NO) (depends if you want to turn it on or off) UNPACKEXE = (YES|NO) (as above) If you want to choose directory where the temporary files will be saved, follow these steps: Select the XPKPatch icon. Then holding down the Shift key, double-click on the drawer of the directory, where you want temporary files to be saved. If you do not supply any arguments, the default ones will be used. After the correct start of the program, it will display information that it has correctly been installed. If it was started from Shell it detaches itself. From that moment the program stays quietly in memory. If any errors occur during its installation, it will inform you about it by displaying suitable information which describes the reason of its fault. @endnode @node stopping "Stopping the program" To leave the program simply run it again. It is possible to happen that the program will not be removed from memory when you start it again. The reason of such behaviour may be the situation when some other program tries to load a packed file, that is in the progress of depacking by XPKPatch. For more information see chapter @{"How it works" link details 48}. @endnode @node viruses "Virus detection" XPKPatch has built-in a very simple virus-detection mechanism. Despite this, it may be recognized as a virus! It happens so because it patches the following vectors in the dos.library: Open(), Close(), Write(), Examine(), LoadSeg(), NewLoadSeg() (OS V36+) Anty-virus programs usually check addresses of the vectors of all libraries, and if any address is suspicious (usually < $f80000) then it is possible that system is infected by a virus. So if your anty-virus program has found something in memory, and you have XPKPatch installed, it is probably not a virus. But you should always check it (e.g. by using other anty-virus program). XPKPatch works similarly - when any program changes the address of at least one of the above functions, you will be warned. A change of the vectors does not mean a virus!!! Surely, the reason is a program similar to XPKPatch that is also trying to install itself. @endnode @node using "'Everyday' use of this program" If you intend to use this program 'everyday', it is recommended to make it start automatically. The best way to do it is to place a command which starts XPKPatch in the file S:User-Startup. After the program's name you may enter its arguments. @endnode @node details "How it works" An average user need not read this chapter - information that is covered in it, is not indispensable to use this program in the correct way, but you have to know a lot about programming the Amiga in order to understand it. This program during its installation patches the following vectors in the dos.library: Open(), Close(), Write(), Examine(), LoadSeg(), NewLoadSeg() (OS V36+) @{b}@{fg highlight}Function Open()@{ub}@{fg text} If a program (let's name it caller) opens a file (in MODE_OLDFILE) XPKPatch checks if the caller is not opening a device (CON: or NIL:), if it is a device then it jumps into the orginal Open() ROM function. Otherwise, if the file is crunched, it is decrunched and then saved as a temporary file into RAM:, or in whatever directory you supplied at start of the program. And if everything went right a FileHandle of the temporary (already decrunched) file is returned. If the file cannot be decrunched for any reason, Open() will return a FileHandle to the original file. @{b}@{fg highlight}Function Close()@{ub}@{fg text} When the caller closes the file (which it thinks is the original file), it will really be closing the temporary file. It is a good chance to delete it, so that the temporary directory will not get crowded with temporary files. If the caller has written a new data to the (temporary) file, we have to rewrite the temporary file over the original file. @{b}@{fg highlight}Function Write()@{ub}@{fg text} When the caller writes something to the temporary file, opened to read (MODE_OLDFILE), XPKPatch will remember to save the changes to the original file. @{b}@{fg highlight}Function Examine()@{ub}@{fg text} If the caller needs the correct file size for packed file, XPKPatch will change the file size in FileInfoBlock, so that the caller will see the correct size of the file, as if it was unpacked. @{b}@{fg highlight}Functions LoadSeg() and NewLoadSeg()@{ub}@{fg text} Now XPKPatch decrunches also executable files (programs, libraries, devices, fonts, etc.). Every executable file that is loaded by one of the above functions will be decrunched to the temporary file, loaded from it, and then the temporary file will be deleted. You need no longer use xLoadSeg because XPKPatch can replace it. Unfortunately it cannot replace the program PPLoadSeg (see @{"Program history" link history 25}). XPKPatch counts every opened file and it will not be possible to leave the program before all of the files are closed. @endnode @node history "Program history" 1.0 - 27-Aug-96 First release. 1.1 - 5-Jul-97 Second release. I have removed one, small bug: - XPKPatch after removing did not free the previously allocated memory. But this occured only when the program was started from Workbench. 1.2 - 28-Jul-97 Third release. I have removed another, small bug: - XPKPatch after removing and restoring vectors did not compute the correct checksum of the dos.library. 1.3 - 22-Aug-97 Fourth release. I have removed another bug: - The program creates a temporary file during decrunching files, which is removed after the operation finishes. Buf if the crunched file could not be decrunched XPKPatch created an empty file which was not removed. Actually it was not caused by the program itself, because a temporary file is created by xpkmaster.library and if an error occurs the library should remove the file by itself. 1.4 - 11-Feb-98 Fifth release. I have added the possibility to decrunch executable files: - At present the program can also decrunch executable files (programs, libraries, devices, fonts, etc.). It gives you the possibility to crunch these files and save disk space. It can entirely replace the program xLoadSeg, but it cannot replace PPLoadSeg because structure of the file crunched with PowerPacker is complicated. 1.5 - 28-May-98 Sixth release. I have added the option to turn on or off the mechanism for decrunching executable files: - Now you can decide whether you want executable files to be decrunched or not (see @{"Starting the program" link starting 19}). 1.6 - 18-Nov-99 I have removed one, small bug: - If XPKPatch could not install itself for some reason, then it quited without freeing the previously allocated memory. But this occured only when the program was started from Workbench. @endnode @node upgrades "Getting upgrades" If you live in Poland and want to get an upgrade, send me: 1. A disk. 2. A selfaddressed envelope with a stamp. If you do not live in Poland, send me: 1. A disk. 2. 2 USD for postage. Easy, isn't it? Please keep this rule - it will make my life easier, and you can count on fast reply. A not-registered user has the right to get one gratuitous upgrade that contains demostration version. A registered user has the right to get unlimited number of gratuitous upgrades that contain licensed version. @endnode @node final "A few final words" Special thanks go to three persons: - Michael Berg for his great PowerPacker Patcher. - Klaudiusz Wojtkowiak for testing the program. - Mr. J.M.Boucher for suggestions and bug reports concerning using XPKPatch and xLoadSeg. If you have found any bug in this program, or you have any questions or suggestions about this program then write on the following address: Grzegorz Królik ul. Wyszyďskiego 8/19 42-400 Zawiercie Poland tel. +48 (32) 672-32-53 @endnode