_______ /| _______/\_______________ _____ /~ ____// | __\___ ~__~/ _____/~ ~\ /~ ¡ ~\. // __)_// |/ ~\ / :| // __) // .__)// | \\\ \\ ~\\ ~ \\/ || \\ ~\\ : \\\\ / \ \ ____/\______/\____| \ ____/\____ // \. |__/ / \/ .____/\______/\_____|\/ .TeTSUo__\/ / \/ ____/ \/ \/ \/ \/ The Hunk Extractor ================== Instructions ------------ This program was developed originally to allow me to understand how AMIGA DOS stored it's exedcutable files. The program may not know all the AMIGA DOS hunk codes that are available but it does know the standard ones. The usage of the program is simplicity in it's self, all you need to do is type : HunkExtract File_Name Where File_Name is the name of the file you wish to extract the hunks from. Once the program is started it will quickly scan through the file and split it up in to it's relevant parts saving each part to the ram disk. There are Four types of file that will be saved to ram : Out.Code Out.Data Out.Relo Out.Bss Each of these files is slightly different here is their explanation. Out.Code -------- This file name's format is : Out.Code_MemType-Hunk Number where MemType is either : A - Anymem (Public Memory) C - Chip memory only F - Fast memory only Hunk number will not be a number it is instead a letter. A is the first hunk, B is the second hunk etc. The Hunk Number is the position of the code hunk in the main program and not the position in the code hunks. The contents of this file is simply the contents of the code hunk. Out.Data -------- This file name's format is : Out.Data_MemType-Hunk Number where MemType is either : A - Anymem (Public Memory) C - Chip memory only F - Fast memory only Hunk number will not be a number it is instead a letter. A is the first hunk, B is the second hunk etc. The Hunk Number is the position of the code hunk in the main program and not the position in the code hunks. The contents of this file is simply the contents of the data hunk. Out.Relo -------- This file name's format is : Out.Data_MemType-Hunk Number-Hunk Number where MemType is either : A - Anymem (Public Memory) C - Chip memory only F - Fast memory only Hunk number will not be a number it is instead a letter. A is the first hunk, B is the second hunk etc. The first Hunk Number is the code hunk that the relocation information belongs to and the second number is the hunk that is being referenced. For example if the following code was placed into Devpac : section Program,code Main move.l SomeData,d0 rts section Data,data_c SomeData dc.l 1543 Then if HunkExtract was used to split the program up, the following would be found in RAM. Out.Code_A-A Out.Data_C-B Out.Relo_A-A-B Out.Relo_A-A-B will now contain a single long word, this longword is the number 2. This number then tells you that at the offset of 2 from hunk A add the starting location of hunk B. The contents of this type of file is just a number of longwords. Out.Bss -------- This file name's format is : Out.Bss__MemType-Hunk Number where MemType is either : A - Anymem (Public Memory) C - Chip memory only F - Fast memory only Hunk number will not be a number it is instead a letter. A is the first hunk, B is the second hunk etc. The contents of this type of file is a single longword this longword is the length of the bss hunk / 4. Credits etc. ------------ Coded by LeeCH / ELTECH. This program is freeware but is still ©1995 ELTECH. Hello's go to Jester,Mic Flair,Realitor of ELTECH and to any one else who knows me.