Pergunta

We have a DFM file which began as text file.

After some years, in one of our newer versions, the Borland Developer Studio changed it into binary format.

In addition, the file became infected.

Can someone explain me what should I do now? Where can I find how binary file structure is read?

Foi útil?

Solução

Well, I found what happens to the DFM file, but I don't know why.

The occurence of changing from text file to binary one is known, and could be found in stack overflow in another question. I'll describe only the infection of the file.

In Pascal, the original language of DFM files, a string defines so: first byte is the length of the string (0-255) and the other characters are the string. (Unlike C, which its strings length are recognized by a null character).

Someone (maybe BDS?) while changing the file from text file to binary one, also changed all string of length 13 (0D) to be length 10 (0A). This way, the string finished after 10 chars, and the next char was a value of the property.

I downloaded binary editor, fixed all occurences of length 10, and the file was displayed and compiled well.

(Not only properties' length infected, but also one byte on Icon.Data property was replaced from 0D to 0A)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top