Архивы автора: Evgeny Stefanenko


Формат COM файлов

Intel byte order
DISCLAIMER:  THIS MATERIAL IS PROVIDED «AS IS».  I verify the information contained in this list to the best of my ability, but I cannot be held responsible for any problems caused by use or misuse of the information, especially for those file formats foreign to the PC, like AMIGA or SUN file formats. If an information it is marked «guesswork» or undocumented, you should check it carefully to make sure your program will not break with an unexpected value (and please let me know whether or not it works the same way). Information marked with «???» is known to be incomplete or guesswork.
Some file formats were not released by their creators, others are regarded as proprietary, which means that if your programs deal with them, you might be looking for trouble. I don’t care about this.
The COM files are raw binary executables and are a leftover from the old CP/M machines with 64K RAM.  A COM program can only have a size of less than one segment (64K), including code and static data since no fixups for segment relocation or anything else is included. One method to check for a COM file is to check if the first byte in the file could be a valid jump or call opcode, but this is a very weak test since a COM file is not required to start with a jump or a call. In principle, a COM file is just loaded at offset 100h in the segment and then executed. Читать далее

TopSpeed TPS файл

                       О С Н О В Н О Й   T P S - Ф А Й Л

                             ФИЗИЧЕСКАЯ ОРГАНИЗАЦИЯ

                                    Заголовок

      (+0)       (+4)          (+6)           (+0Ah)          (+0Eh)
  00 00 00 00    00 00      00 05 00 00     00 05 00 00     74 4F 70 53
 UNSIGNED LONG   USHORT    UNSIGNED LONG   UNSIGNED LONG   UNSIGNED LONG
   Смещение      Размер     Длина файла     Длина файла     Метка файла
  заголовка    заголовка                                      TOPSPEED

  (+12h)      (+14h)          (+18h)                (+1Ch)
  00 00     00 00 00 06     07 00 00 00           00 00 00 00
  SHORT    UNSIGNED LONG   UNSIGNED LONG         UNSIGNED LONG
   Нули      Последний   Счетчик изменений     Верхняя управляющая
   (?)         номер           файла        страница (адрес минус 200h,
                                                деленный на 100h)

  Далее следуют 2 массива длиной (длина_заголовка-20h)/2 четырехбайтовых
чисел (ниже порядок байт перевернут):

Читать далее

Структура индексных файлов Clarion

Overview
This bulletin explains the layout of Clarion index and key files. Clarion Index and Key Files While Technical Bulletin #117, «Clarion Data File,» covered the layout of Clarion Professional Developer’s data files, it only touched on the subject of the index and key files that Professional Developer uses to access your data in a specific order.  The purpose of this technical bulletin is to explain how Clarion’s key and index files are laid out.
This technical bulletin assumes a knowledge of basic data structures and the C programming language.  While you don’t have to be a C guru to understand the material presented here, a passing knowledge helps, as C makes it easy to create many types of data structures.
As far as this discussion is concerned, there are NO internal differences between index and key files.  Index files are simply key files that are not updated automatically by adding, deleting, of changing records in your data base. Also, this bulletin will not explain how you create key files, only how to read them.  Our method of managing B+ Trees is proprietary and quite complicated.  In all fairness, we can only support products that create key files using our own code.  When you see a non-Clarion product that creates and/or maintains Clarion key files, it means they have licensed our code for use in their product. Читать далее

Clarion DAT файл

Overview
This bulletin explains the format of Clarion data files.

Clarion Data Files
This technical bulletin explains the format of data files created by the
Clarion Professional Developer and the Clarion Personal Developer (Version 2 and
above).  It will only cover data files; key and index files are covered in
Clarion Technical Bulletin #118.  Use this information carefully because an
erroneous change to a data file will make your file unreadable.  Due to the
risks of data integrity, encryption is not covered in this bulletin.
A file defined with Clarion contains a lot of information on data such as
fields, keys, indexes, pictures, arrays, etc.  When the file is first
created, you will have a .DAT file and optionally one or more .K??, .I??, and .MEM
files (where ?? is a two digit number).  The .DAT file also contains
information on keys, fields and their layouts, and many fields that allow
Professional Developer to efficiently use the space on your disk.
First, let us discuss the .DAT file.  This file consists of several
sections (some sections are optional): Читать далее

DBF (Структура базы данных)

Файл базы данных состоит из записи заголовка и записей с данными. В записи заголовка определяется структура базы данных и содержится вся другая информация, относящаяся к базе данных.
В файле она начинается с нулевой позиции.
Записи с данными следуют за заголовком (байты располагаются последовательно) и включают в себя фактическое содержимое полей. Длина записи (в байтах) определяется суммированием указанных длин всех полей.
Числа в данном файле размещаются в обратном порядке. Читать далее

DBF (dBASE) (на английском)

Sometimes it is necessary to delve into a dBASE table outside the control of the Borland Database Engine (BDE). For instance, if the .DBT file (that contains memo data) for a given table is irretrievably lost, the file will not be usable because the byte in the file header indicates that there should be a corresponding memo file. This necessitates toggling this byte to indicate no such accompanying memo file. Or, you may just want to write your own data access routine.

Below are the file structures for dBASE table files. Represented are the file structures as used for various versions of dBASE: dBASE III PLUS 1.1, dBASE IV 2.0, dBASE 5.0 for DOS, and dBASE 5.0 for Windows. Читать далее

Блеск и нищета клиент-серверных технологий (Андрей Акопянц)

Андрей Акопянц
В некотором смысле эта статья продолжает линию,
начатую в «КТ» #275 («Автоматизация хаоса»). Но не по тематике
(корпоративная информатизация), а как попытка рефлексии некоторого
пласта знаний, лежащего между философией и методологией разработки
систем, с одной стороны, и технической документацией на конкретные
продукты, с другой. Читать далее

Концепции построения и реализации информационных систем, ориентированных на анализ данных

А. Сахаров, Oracle

Сегодня, практически в любой организации сложилась хорошо всем знакомая
ситуация: — информация вроде бы, где-то и есть, её даже слишком много, но она
неструктурированна, несогласованна, разрознена, не всегда достоверна, её практически
невозможно найти и получить.

Именно на разрешение этого противоречия — отсутствие информации
при наличии и даже избытке и нацелена концепция Хранилищ Данных (Data Warehouse).
В основе концепции Хранилищ Данных лежат две основополагающие идеи Читать далее

Отладка программ

Не так давно кидал в рассылку информацию с буржуйского форума о вызове отладчика в процессе работы программы. Дошли руки проверить. Классная вещь! Можно фактически отказаться от использования STOP.

Делается так.

1. Регистрируем клашин отлдчик как системный (в нем есть такой пункт меню).
2. В точке вставке Global Map пишем

    MODUL('WinApi')
       DebugBreak(),PASCALE,RAW,NAME('DebugBreak')
    END

Проще всего это «прибить намертво» в шаблонах.

3. В том месте, где нужно отлаживаться пишем (с первой колонки)

   ? DebugBreak  

Проще всего навесить на макрос, например AltD, последовательность «EndKey+EnterKey+? DebugBreak».

4. Компилим и запускаем программу на исполнение. Доходим до нужного места и получаем виндовый GPF. Жмем в нем кнопку «Отладчик». Открывается клашин отладчик и активизируется окно локальных переменных. В нем видим неопознанную переменную. Жмем на ней правую мышу и выбираем «открыть в исходниках опосля». Пару раз жмем AltE и (о чудо!) перескакиваем в нужный нам отлаживаемый исходный текст.
Особенно понравилось, что данную схему удобно использовать в multi-dll приложениях. Ставим точку останов в dll-модуле, компилим, копируем dll в каталог сборки и запускаем приложение. В нужном месте автоматом переходим в отладчик. Т.е. не нужно переводить модуль в exe, придумывать тестовый вызов и т.п.

Проверял на C55H, WinXP SP1.

С уважением,
Вячеслав Черников support@finsoft.ryazan.ru