Magic Field

Anything QL Software or Programming Related.
Post Reply
User avatar
Popopo
Gold Card
Posts: 381
Joined: Wed Apr 07, 2021 10:37 am

Magic Field

Post by Popopo »

Good Afternoon folks!

After talking and getting information about the matter of MDVs images issue, Johan Engdhal has shared its tools for the Magic Field.
So I think it is a very useful tool and easy to use. So everyone can use what likes the most.
This one is for Windows. (Perhaps soon there will be a conversion to Java => multi-platform).
Johan Engdhal wrote: A while ago I shared the a Linux binary that I created to create or reinstate the MagicHeader of a QL binary (it will create the correct header for a QL binary compiled with C68 or XTC68. It will set the magic file header in such way that header is inserted and can thus be run directly on a QL without the SEXEC process).
Upon request I have now compiled it for Win x64 architecture as well. Please note that this is a command line tool.
Thanks Johan!

Here is the tool. Enjoy it.
QDOSMagicHeaderFixer.zip
(5 MiB) Downloaded 104 times


User avatar
Popopo
Gold Card
Posts: 381
Joined: Wed Apr 07, 2021 10:37 am

Re: Magic Field

Post by Popopo »

I forgot...
A nice link where there is a nice explanation well documented about it: https://dilwyn2.wordpress.com/2017/02/2 ... e-headers/

An also a resume from dilwyn about it (thank you)
dilwyn wrote: Tue Aug 13, 2024 3:24 pm There's an article on my blog about the "magic headers" (XTcc fields) and how it works, and how to check it. Also some suggestions on restoring lost executable file headers by guesswork where no XTcc field exists.

Some people use the term "magic field" to refer to the original executable file header, while others use it to refer to the "XTcc" fields within a program if it exists, so the term can be ambiguous.

An XTcc field is essentially a little bit of flagged data (a long word) inserted into an executable program file by compilers to indicate what dataspace the executable should have when put into a QL filing system. It's usually used by cross-compilers (programs which compile QL programs in non-QL environments such as Windows or DOS, e.g. XTC68). You can locate it within a program (if it exists) just by searching for the letters "XTcc" which precedes the long word.

Once upon a time, it was little known or understood. Nowadays, more software understands the XTcc field.

Really useful to know about if you are transferring between filing systems and accidentally lose the executable file header.


Post Reply