@RCHER FOR MENUET v1.0 July 14, 2005 Written in pure assembler by Ivushkin Andrey aka Willow Deflate unpacker Vivat assembler et MENUETOS! I tender thanks to everyone who spends his time in feasible effortsfor that little OS evolution. Now in my own rating the Mario79's distro named Kolibri4 takes 1th place. It is always pleasant to use modern software. Go on! @RCHER is intended to view & unpack data compressed by Deflate method (including both static and dynamic Huffman). This method (although it isn't the best already) is used by such file formats as ZIP (modern versions: PKZIP for MS-DOS can create archives using other, less effective compression methods, which @RCHER doesn't support), GZIP, JAR, OpenOffice files, SFX ZIP executables and some others. I couldn't prevent myself to include support of PNG images (they use the similar compression) and TAR and TAR+GZIP archives. When the program is started, a little button carrying a @ symbol appears in the left top corner of screen. Clicking this button opens a SYSXTREE dialog to select a file being unpacked. Doubleclick closes the application. @RCHER outputs its information messages to Debug Board. If an archive contains more than one file, the 1st is by default unpacked into /HD/1/OUT.TXT (you may change the DUMPFILE constant in @RCHER.ASM) and is opened through TINYPAD or - if it's a PNG image - in the built-in viewer. These are unpacking flags that may exist in a commandline before an archive filename: s - do not close the program after unpacking; n - decompress the K-th archive file, where K is the following dword in commandline; N - decompress the K-th archive file, where K is ASCII number from the following 6 bytes of commandline; R - "raw" Deflate data, without descriptors and headers; q - begin file parsing from offset of K, where K is following dword in commandline; Q - begin file parsing from offset of K, where K is ASCII number from the following 6 bytes of commandline. Commandline example: cmd_string: db 'sN000037q' dd 1465 db '/hd/1/png.zip',0 It means to open the 34th (counting from 0) file of archive /hd/1/png.zip and do not terminate. Archive will be parsed starting at offset 1465. To-Do list: 1. Support for interlaced PNG, alpha-channels, gamma-correction, background, Significant bits and a lot of cool parts of that format. 2. Output of archive content through IPC or into a built-in window like SYSTREE (as we are going to decide with the respected colleagues). 3. Searching of archive files by name and wildcards! 4. Unpacking into a file specified. 5. Means on saving memory space (now @RCHER gorges 8 Mb!): moving RAM areas, blocked file output. To do the last thing it is necessary to test carefully the reliability of harddisk I/O, directory creation and file deletion. These kernel capabilities aren't still documented. 6. Archive contents integration into SYSXTREE & MFAR filemanagers. We have to unify the calling format (like a structure in the sysfunc 58). 7. Add comments to source. 8. Correct bugs to be found Special thanks to: Explanation of algorythm of Deflate format decoder with decoding samples (evm.narod.ru) RFC 1951 DEFLATE Compressed Data Format Specification version 1.3 ZIP File Format Specification version 4.5 by PKWARE Inc. "An Explanation of the Deflate Algorithm" by Antaeus Feldspar RFC 1952 GZIP file format specification version 4.3 TAR Format. Information from File Format List 2.0 by Max Maischein. RFC 1950 ZLIB Compressed Data Format Specification version 3.3 PNG (Portable Network Graphics) Specification version 1.0 Michael Dipperstein's Huffman Code Page I expect your remarks and suggestions on the @RCHER's topic, "Coding" section at meos.sysbin.com forum. See you later! **************************************** **************************************** @RCHER ДЛЯ MENUET v1.0 14 июля 2005 г. Написана на чистом ассемблере Ивушкиным Андреем (Willow) Deflate распаковщик Vivat assembler et MenuetOS! Выражаю искреннюю благодарность всем тем, кто не жалея своего времени, делает посильный вклад в развитие этой маленькой ОС. Сейчас в моем собственном рейтинге 1-е место занимает дистрибутив Mario79 Kolibri4. Всегда приятно пользоваться современным ПО. Так держать! @RCHER предназначен для просмотра и распаковки данных, сжатых с помощью метода Deflate (включая статический и динамический Хаффман). Данным методом (хотя он уже не претендует на звание наилучшего) пользуются форматы файлов ZIP (современные версии: PKZIP для MS-DOS может создавать архивы с другими, менее эффективными методами сжатия, которые @RCHER не поддерживает), GZIP, JAR, файлы OpenOffice, SFX-ZIP приложения и ряд других. Я не мог удержаться и не сделать поддержку изображений в формате PNG (использующих родственный метод сжатия) и архивов TAR и TAR+GZIP. При запуске программы в левом верхнем углу экрана появляется маленькая кнопка со значком @. При нажатии на нее открывается окно выбора файла (SYSXTREE) для распаковки. Двойной щелчок закрывает приложение. Информационные сообщения @RCHER выводит на доску отладки. Если архив содержит несколько файлов, по умолчанию первый из них распаковывается на /HD/1/OUT.TXT (поменяйте при необходимости константу DUMPFILE в @RCHER.ASM) и открывается через TINYPAD или - в случае картинки PNG - в окне встроенного просмотрщика. В командной строке перед именем архива могут в произвольном порядке указываться флаги распаковки: s - не закрывать программу после распаковки; n - распаковать K-й файл архива, где K - следующий dword в командной строке; N - распаковать K-й файл архива, где K - ASCII число из следующих 6 байт командной строки; R - "сырые" Deflate-данные, без описателей и заголовков; q - просмотр файла начать со смещения K, где K - следующий dword в командной строке; Q - просмотр файла начать со смещения K, где K - ASCII число из следующих 6 байт командной строки. Пример командной строки: cmd_string: db 'sN000037q' dd 1465 db '/hd/1/png.zip',0 Это означает, что следует открыть 34-й (считая от 0) файл архива /hd/1/png.zip и не завершать работу. Просмотр архива начнется со смещения 1465. Что еще нужно сделать: 1. Поддержка чересстрочных (interlaced) PNG, а также альфа-каналов, гаммы, фона, Significant bits и кучи других примочек этого формата. 2. Вывод содержимого архивов через IPC или во встроенном окне наподобие SYSTREE (это как решим с уважаемыми коллегами). 3. Поиск файлов в архиве по имени и даже маске! 4. Распаковка в указанный файл. 5. Мероприятия по экономии памяти (сейчас @RCHER жрет 8 Мб!): перемещение участков памяти, блочный вывод в файл. Для последнего необходимо тщательно протестировать надежность воода-вывода на ЖД, создания каталогов и удаления файлов. Пока эти возможности ядра не документированы. 6. Интеграция архивных каталогов в файловые менеджеры SYSXTREE, MFAR. Потребуется унифицировать формат вызова (наподобие структуры в 58 функции). 7. Откомментировать код. 8. Исправить баги, которые, несомненно, найдутся ;-) Особые благодарности: Описание алгоритма декодера формата Deflate на примерах декодирования (evm.narod.ru) RFC 1951 DEFLATE Compressed Data Format Specification version 1.3 ZIP File Format Specification version 4.5 by PKWARE Inc. "An Explanation of the Deflate Algorithm" by Antaeus Feldspar RFC 1952 GZIP file format specification version 4.3 TAR Format. Information from File Format List 2.0 by Max Maischein. RFC 1950 ZLIB Compressed Data Format Specification version 3.3 PNG (Portable Network Graphics) Specification version 1.0 Michael Dipperstein's Huffman Code Page Жду ваших замечаний и предложений на одноименной ветке раздела "Кодинг" форума meos.sysbin.com До новых встреч!