***************************************************************************** * * * PROGRAM: StripHunk * * VERSION: 1.3 * * SOURCE-CODE: 28 (7.11.2000) * * DATE: 23.09.1997 - 15.11.1997 * * LANGUAGE: Assembler * * SYSTEM: A1200 KS 40.68 WB 40.42 2MB chip 64MB fast 68030/50mhz * * * * AUTHOR: Joerg Riemer 14167 Berlin/SchottmuellerStr.107/Germany * * EMAIL: mission@cs.tu-berlin.de * * * ***************************************************************************** StripHunk v1.3 (CLI) TEMPLATE FILE/M,TO=AS,REPLACE/S,DREL32/S,SPLIT/S,RELOC32/S,SORT/S REVERSE/S,SYMBOL/S,DEBUG/S,NAME/S,ZEROS/S,ASLREQ/S,QUIET/S FILE/M one or more input files from where you want to strip some hunks. ex: StripHunk df0:fileA dh1:C/FileB work:misc/FileC DREL32 DEBUG TO=AS by using one input file, TO=AS lets you to define an explicit output file. multiple input files in conjunktion with TO or AS will force a wrong_number_of_arguments error. ex: StripHunk workbench:libs/asl.library as df0:libs/asl.library DREL32 StripHunk always checks the destination area before saving the output file. is there a file called like the output file, it will be renamed by adding an extender (.bak). REPLACE/S setting the REPLACE/Switch, signals StripHunk to delete the backup file immediatly after the stripped file was successfully saved. in case of some exeptions(*) REPLACE/S may be ignored. DREL32/S this switch is for optimizing reloc_hunks. with DREL32/S set, StripHunk searches for any HUNK_RELOC32 may be available in the input file and tries to convert it into the bit shorter HUNK_DREL32. *** ATTENTION *** FILES CHANGED BY USING THE DREL32-OPTION WONT BE ABLE TO RUN WITH WORKBENCH 1.3 OR LOWER, CAUSE DREL32_HUNKS ARE NEW FOR THE WORKBENCH 2.0+ SPLIT/S sometimes a reloc32_hunk contains both short and long reloc_entrys. for that reason, the DREL32/S option only will have no effect on a hunk like this. the SPLIT/S option forces StripHunk to extract all short reloc_entrys and to generate a seperate drel32_hunk. in other words, the hunk will be splitted into one hunk which holds the optimized short_relocs and a second piece filled up with all entrys which doesn't fit into a word the maximum size may used by a drel32_entry. both hunks are joined together from low to high. this means, at first always comes the drel32_hunk trailed then by the reloc32_hunk. RELOC32/S lets StripHunk do the same like the DREL32/Switch, but in the backward direction. this will convert any HUNK_DREL32 back into a standard HUNK_RELOC32. one of the reasons why i integrated this option, is my reassembler which doesn't understand HUNK_DREL32. :-( may be there are some other tools with the same problem. here is the solution :-) another reason is, the OS V37 uses HUNK_DREL32 by mistake. This will continue to be supported in future versions, since HUNK_DREL32 is illegal in load files anyways. Future versions of the OS will support both HUNK_DREL32 and HUNK_RELOC32SHORT, though anything that should be usable under OS V37 should use HUNK_DREL32. SORT/S the SORT/S option is quite useful when the user wants to remove all drel32-optimisations without to get a different between the reverted and the original file. all reloc_entrys want be sorted in the regular way from low to high. a file with unsorted reloc_hunks is mostly not completely revertable even when the SPLIT/S option was used. REVERSE/S in conjunction with SORT/S this option lets you sort relocs in reverse order from high to low. SYMBOL/S, DEBUG/S, NAME/S (*) sometimes, files be involved by hunks like HUNK_SYMBOL; HUNK_DEBUG and/or HUNK_NAME. mostly they are used for debugging purpose. setting one of these switches removes them from the input file. *** BE WARNED *** in some cases these hunks are also used as a self-protection against viruses and/or as an installation-identifier. for example, look at DPaintV. this one requires a debug_hunk including some information about the registered user. this means, DPaintV must be fully reinstalled for proper work when this hunk was removed by using the DEBUG/Switch. ZEROS/S (*) generates code/data_hunks known as code-bss/data-bss sections. this option requires code/data-hunks joined with a part of zeros at the end. if so, StripHunk deletes all possible zeros and creates a new hunk by recalculating a reduced hunk_length. in majority, this is a nice option for our moderate assembler programmers which wont to declare a seperate bss_section. in this case, it's easyer for them to generate pc-relative code including the advantage like having a true bss_section. ASLREQ/S the lazy user may use an asl-requester to choose a file. here again, it's also possible to choose more then one file. ex: StripHunk ASLREQ DREL32 for that example, all taken files are stripped/converted by using the DREL32/S option. QUIET/S just what it means. :-) no information is printed to the standard-output. except an error occures while converting a one or more files. if so, StripHunk prints some closer information about the error returned by DOS. after StripHunk finished, the rc variable holds the number of files which couldn't converted for some reason and the pr_result2 variable contains the io_error returned by the last failed file. ---------------------------------------------------------------------- you may stop StripHunk anytime by pressing StripHunk is also able to convert overlay-files as long as they are in a standard format. joerg...