Yes, you can 'edit' the APT files to a degree with a hex editor, but in the case of the BFMEI spellbook this was my last resort. Hex edits are also very limited in their scope and can only accomplish a little as you are digging in the dark.
Explanation - I decompiled the APT file so it was in a more readable and understandable form, this way I knew what I had to edit inside it to switch the campaign spellbook with the multiplayer one. Only by decompiling it did I figure this out. My frustration was that I could never get the damn things to recompile into a form that the game would read or use, so given that I knew what needed changing I resorted to a hex edit to do it. The key thing was decompiling the APT so I could figure out what was required to be edited. Editing by hex alone is almost pointless, as you have no idea what you are looking at.
Using the same method, a lot more could be done with them, although you have to have an understanding of how they work. You see the APT files all interact with eachother. Some contain IMPORTS, these work a bit like INC files for INIs, in that they call resources or code from other APT files - for example, common buttons/images, sounds etc. Others contain EXPORTS that make their internal resources available to other APT files. The trickiest bit is that the APT files all interact with the core game code, and the restriction here is due to the naming convention of the elements inside the APT file. For example, a button called 'GoodCanpaignButton' may be named so in the game exe, which means that particular button in an APT file will only trigger a specific function in the exe. Also, that button will only work when inside a particular tree in the APT file, for example MainMenu > SinglePlayerMenu > GoodCampaignButton will be the only one able to trigger the good campaign to start.
Back when I did my BFMEI mod I was lucky enough to have a proprietary app that could decompile but it's compiler sucked and made APT files of a lower version than BFMEI supported. However, you can still decompile them into XML which makes them very readable (thus editable). I wish you could recompile into APT again but the tools cannot do this, so what you have is the ability to decompile, read and thus analyse what you can edit, where and how. Armed with this knowledge, you can apply hex edits (albeit in a limited capacity) although you would not be digging in the dark as much because you know what and where to change. This is how I accomplished the BFMEI spell book thing, I dont see how it could have been done without reading and understanding the APT first.
So, if anyone wants to follow in my footsteps and try to get more out of the APT files, you can use a newer tool from this very network at this page on C&C Guild to decompile APTs into XML.
I've recently used the same method to make a perfect port of the BFMEII spell store into RoTWK complete with more spells in multiplayer, perfect color/sounds scheme etc. I actually picked on SpellStore.APT because it is the easiest one to edit by far, on account of the fact that it has no IMPORTS or EXPORTS (it acts independently). There you have it - good luck.
Edited by Bart, 19 December 2009 - 09:22 PM.
Changed CNC3.Net link to guild