Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
31 halyavin 1
@RCHER FOR MENUET v1.0        July 14, 2005
2
 Written in pure assembler by Ivushkin Andrey aka Willow
3
 
4
Deflate unpacker
5
 
6
Vivat assembler et MENUETOS!
7
I tender thanks to everyone who spends his time in feasible effortsfor that
8
little OS evolution. Now in my own rating the Mario79's distro named Kolibri4
9
takes 1th place. It is always pleasant to use modern software. Go on!
10
 
11
@RCHER is intended to view & unpack data compressed by Deflate method
12
(including both static and dynamic Huffman). This method (although it isn't the
13
best already) is used by such file formats as ZIP (modern versions: PKZIP for
14
MS-DOS can create archives using other, less effective compression methods,
15
which @RCHER doesn't support), GZIP, JAR, OpenOffice files, SFX ZIP executables
16
and some others. I couldn't prevent myself to include support of PNG images
17
(they use the similar compression) and TAR and TAR+GZIP archives.
18
 
19
When the program is started, a little button carrying a @ symbol appears in the
20
left top corner of screen. Clicking this button opens a SYSXTREE dialog to
21
select a file being unpacked. Doubleclick closes the application. @RCHER
22
outputs its information messages to Debug Board. If an archive contains more
23
than  one file, the 1st is by default unpacked into /HD/1/OUT.TXT (you may
24
change the DUMPFILE constant in @RCHER.ASM) and is opened  through TINYPAD
25
or - if it's a PNG image - in the built-in viewer.
26
 
27
These are unpacking flags that may exist in a commandline before an archive
28
filename:
29
 
30
  s - do not close the program after unpacking;
31
  n - decompress the K-th archive file, where K is the following dword in
32
      commandline;
33
  N - decompress the K-th archive file, where K is ASCII number from the
34
      following 6 bytes of commandline;
35
  R - "raw" Deflate data, without descriptors and headers;
36
  q - begin file parsing from offset of K, where K is following dword in
37
      commandline;
38
  Q - begin file parsing from offset of K, where K is ASCII number from the
39
      following 6 bytes of commandline.
40
 
41
Commandline example:
42
 
43
cmd_string:
44
   db  'sN000037q'
45
   dd  1465
46
   db  '/hd/1/png.zip',0
47
 
48
It means to open the 34th (counting from 0) file of archive /hd/1/png.zip
49
and do not terminate. Archive will be parsed starting at offset 1465.
50
 
51
 
52
To-Do list:
53
 
54
1. Support for interlaced PNG, alpha-channels, gamma-correction, background,
55
   Significant bits and a lot of cool parts of that format.
56
2. Output of archive content through IPC or into a built-in window like SYSTREE
57
   (as we are going to decide with the respected colleagues).
58
3. Searching of archive files by name and wildcards!
59
4. Unpacking into a file specified.
60
5. Means on saving memory space (now @RCHER gorges 8 Mb!): moving RAM areas,
61
   blocked file output. To do the last thing it is necessary to test carefully
62
   the reliability of harddisk I/O, directory creation and file deletion. These
63
   kernel capabilities aren't still documented.
64
6. Archive contents integration into SYSXTREE & MFAR filemanagers. We have to
65
   unify the calling format (like a structure in the sysfunc 58).
66
7. Add comments to source.
67
8. Correct bugs to be found
68
 
69
Special thanks to:
70
 
71
  Explanation of algorythm of Deflate format decoder with decoding samples
72
     (evm.narod.ru)
73
  RFC 1951 DEFLATE Compressed Data Format Specification version 1.3
74
  ZIP File Format Specification version 4.5 by PKWARE Inc.
75
  "An Explanation of the Deflate Algorithm" by Antaeus Feldspar
76
  RFC 1952 GZIP file format specification version 4.3
77
  TAR Format. Information from File Format List 2.0 by Max Maischein.
78
  RFC 1950 ZLIB Compressed Data Format Specification version 3.3
79
  PNG (Portable Network Graphics) Specification version 1.0
80
  Michael Dipperstein's Huffman Code Page
81
 
82
I expect your remarks and suggestions on the @RCHER's topic, "Coding" section
83
at meos.sysbin.com forum.
84
 
85
See you later!
86
 
87
 
88
****************************************
89
****************************************
90
 
91
@RCHER ДЛЯ MENUET v1.0       14 июля 2005 г.
92
 Написана на чистом ассемблере Ивушкиным Андреем (Willow)
93
 
94
Deflate распаковщик
95
 
96
Vivat assembler et MenuetOS!
97
Выражаю искреннюю благодарность всем тем, кто не жалея своего времени,
98
делает посильный вклад в развитие этой маленькой ОС. Сейчас в моем собственном
99
рейтинге 1-е место занимает дистрибутив Mario79 Kolibri4. Всегда приятно
100
пользоваться современным ПО. Так держать!
101
 
102
@RCHER предназначен для просмотра и распаковки данных, сжатых с помощью метода
103
Deflate (включая статический и динамический Хаффман). Данным методом (хотя он
104
уже не претендует на звание наилучшего) пользуются форматы файлов ZIP
105
(современные версии: PKZIP для MS-DOS может создавать архивы с другими, менее
106
эффективными методами сжатия, которые @RCHER не поддерживает), GZIP, JAR,
107
файлы OpenOffice, SFX-ZIP приложения и ряд других. Я не мог удержаться и не
108
сделать поддержку изображений в формате PNG (использующих родственный метод
109
сжатия) и архивов TAR и TAR+GZIP.
110
 
111
При запуске программы в левом верхнем углу экрана появляется маленькая кнопка
112
со значком @. При нажатии на нее открывается окно выбора файла (SYSXTREE) для
113
распаковки. Двойной щелчок закрывает приложение. Информационные сообщения
114
@RCHER выводит на доску отладки. Если архив содержит несколько файлов, по
115
умолчанию первый из них распаковывается на /HD/1/OUT.TXT (поменяйте при
116
необходимости константу DUMPFILE в @RCHER.ASM) и открывается  через TINYPAD
117
или - в случае картинки PNG - в окне встроенного просмотрщика.
118
 
119
В командной строке перед именем архива могут в произвольном порядке указываться
120
флаги распаковки:
121
 
122
  s - не закрывать программу после распаковки;
123
  n - распаковать K-й файл архива, где K - следующий dword в командной строке;
124
  N - распаковать K-й файл архива, где K - ASCII число из следующих 6 байт
125
      командной строки;
126
  R - "сырые" Deflate-данные, без описателей и заголовков;
127
  q - просмотр файла начать со смещения K, где K - следующий dword в командной
128
      строке;
129
  Q - просмотр файла начать со смещения K, где K - ASCII число из следующих 6
130
      байт командной строки.
131
 
132
Пример командной строки:
133
 
134
cmd_string:
135
   db  'sN000037q'
136
   dd  1465
137
   db  '/hd/1/png.zip',0
138
 
139
Это означает, что следует открыть 34-й (считая от 0) файл архива /hd/1/png.zip
140
и не завершать работу. Просмотр архива начнется со смещения 1465.
141
 
142
 
143
Что еще нужно сделать:
144
 
145
1. Поддержка чересстрочных (interlaced) PNG, а также альфа-каналов, гаммы,
146
   фона, Significant bits и кучи других примочек этого формата.
147
2. Вывод содержимого архивов через IPC или во встроенном окне наподобие SYSTREE
148
   (это как решим с уважаемыми коллегами).
149
3. Поиск файлов в архиве по имени и даже маске!
150
4. Распаковка в указанный файл.
151
5. Мероприятия по экономии памяти (сейчас @RCHER жрет 8 Мб!): перемещение
152
   участков памяти, блочный вывод в файл. Для последнего необходимо тщательно
153
   протестировать надежность воода-вывода на ЖД, создания каталогов и удаления
154
   файлов. Пока эти возможности ядра не документированы.
155
6. Интеграция архивных каталогов в файловые менеджеры SYSXTREE, MFAR.
156
   Потребуется унифицировать формат вызова (наподобие структуры в 58 функции).
157
7. Откомментировать код.
158
8. Исправить баги, которые, несомненно, найдутся ;-)
159
 
160
Особые благодарности:
161
 
162
  Описание алгоритма декодера формата Deflate на примерах декодирования
163
     (evm.narod.ru)
164
  RFC 1951 DEFLATE Compressed Data Format Specification version 1.3
165
  ZIP File Format Specification version 4.5 by PKWARE Inc.
166
  "An Explanation of the Deflate Algorithm" by Antaeus Feldspar
167
  RFC 1952 GZIP file format specification version 4.3
168
  TAR Format. Information from File Format List 2.0 by Max Maischein.
169
  RFC 1950 ZLIB Compressed Data Format Specification version 3.3
170
  PNG (Portable Network Graphics) Specification version 1.0
171
  Michael Dipperstein's Huffman Code Page
172
 
173
Жду ваших замечаний и предложений на одноименной ветке раздела "Кодинг" форума
174
meos.sysbin.com
175
 
176
До новых встреч!