/usr/share/doc/unmass/mea.txt is in unmass 0.9-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | == MEA Exe Archive ==
If you are creating your own programs you can use this thingie to add some files
to EXE file to avoid too-many-files mess.
Adding and removing can be done easy by Unmass, using files by your program is easy too,
you need only some basic file-reading skills in your programming language.
To add files to exe file you have just to open exe file in Unmass and add files, thats all.
Exe archive consists of these parts:
-- start of file --
| |
original exe
| |
- end of orig exe -
| |
1st added file
| |
-------------------
| |
2nd added file
| |
-------------------
| |
.....
| |
-------------------
| |
last file
| |
----- ====== ------
| |
archive library
| |
----- ====== ------
| |
archive info
| |
--- end of file ---
Info header stored at the end of file is 20 bytes long and consists
of these parts:
item name offset length type
------------------------------------------
orig exe file size eof-20 4 long
library offset eof-16 4 long
files count eof-12 4 long
file size eof-8 4 long
ident eof-4 4 "MEAF"
Files library precedes end-of-file ident header, there are records about
stored files. Original exe is stored in lib too, as 1st rec.
One library record is 72 bytes long. Nuber of records can be found
in the ident-header. Offset of the library is also stored in the
header as variable [library offset]
One library record:
item name offset length type
------------------------------------------
name 0 64 ASCIZ
offset 64 4 long
size 68 4 long
That was the info, look for the source code at the end of document.
If you want to say me something, or you (dont)like something, mail me,
i'll be glad to see some responses.
My mail is mirex@centrum.sk
-------- c source code for reading contents of archive ----------
struct s_MeaHeader {
unsigned long orig_file_size;
unsigned long lib_offset;
unsigned long files_count;
unsigned long file_size;
char ident[4];
} MeaHeader;
#define MeaNameLen 64
#define SizeOfMeaRec 72
struct s_MeaRec {
char name[ MeaNameLen ];
unsigned long offset;
unsigned long size;
} MeaRec; //len:72
// parameter is opened binary archive file
// returns 1 if file looks to be MEA archive, 0 if not
int ReadHeader( FILE *f )
{
fseek( f, -20, SEEK_END );
if ( fread( &MeaHeader, 1, 20, f ) != 20 )
return 0;
return ( memcmp( MeaHeader.ident, "MEAF", 4 ) == 0 );
}
// parameter is opened binary archive file
// num should be number of file, it should not be greater than number of enteries
// (which can be found in MeaHeader)
// returns 1 if read succesfully
// MeaRec is then filled with file's name, offset and size
int ReadRecord( FILE *f, int num )
{
if (( num < 0 ) || ( num >= MeaHeader.files_count ))
return 0;
fseek( f, MeaHeader.lib_offset + num * SizeOfMeaRec, SEEK_SET );
fread( &MeaRec, 1, SizeOfMeaRec, f );
return 1;
}
|