ninsei Posted October 30, 2018 Share Posted October 30, 2018 Hi. If a rom is encrypted with one of the original loading methods, is there a tool to turn that rom into an uncrypted rom? Quote Link to comment Share on other sites More sharing options...
sage Posted October 30, 2018 Share Posted October 30, 2018 (edited) no. not useful. why would you like to do that? Better check what "encrypted ROM" means for the lynx. But its easy toremove any checksumming if thats what you are asking for. Edited October 30, 2018 by sage Quote Link to comment Share on other sites More sharing options...
ninsei Posted October 31, 2018 Author Share Posted October 31, 2018 Yes, I meant checksumming. Quote Link to comment Share on other sites More sharing options...
+karri Posted October 31, 2018 Share Posted October 31, 2018 The encryption and obfuscation phases are documented now. You can use the OpenSSL library for the encryption and decryption and some own C code for dealing with obfuscation. But you need to invest some time in this. Usually the Lynx loader comes in 2 parts. The 1st chunk is 3 times 51 bytes and the 2nd 5 times 51 bytes. Quote Link to comment Share on other sites More sharing options...
sage Posted October 31, 2018 Share Posted October 31, 2018 easiest way: overwrite the first 420 bytes with a encrypted loader without checksumming if you have older games, there is no checksumming at all. Quote Link to comment Share on other sites More sharing options...
sage Posted October 31, 2018 Share Posted October 31, 2018 but hey, you could buy a tools. how much are you willing to pay? Quote Link to comment Share on other sites More sharing options...
ninsei Posted October 31, 2018 Author Share Posted October 31, 2018 Still in the learning phase. 3 times 51 bytes plus 5 times 51 bytes is 408. Where did the 420 come from? Quote Link to comment Share on other sites More sharing options...
+karri Posted October 31, 2018 Share Posted October 31, 2018 (edited) There is one extra byte in front of every chunk. So by adding 2 bytes you end up to 410 bytes. The missing 10 bytes were lost in sage's memory The typical loader is really 410 bytes. In front of the loader there is 64 bytes called a lnx header. It is to tell emulaters of what is in the ROM. This header is not in the real Lynx ROM at all. The first byte tells you how many chunks to decrypt FF = 1FE = 2FD = 3FC = 4FB = 5 So the binary starts with:FD + 3 times 51 bytesFB + 5 times 51 bytesdirectory, 8 bytes per entryfiles, rest of the cart The number of encrypted chunks can be anything. The last byte of the last 51 byte chunk needs to be 0 to stop the decryption process. Edited October 31, 2018 by karri Quote Link to comment Share on other sites More sharing options...
ninsei Posted October 31, 2018 Author Share Posted October 31, 2018 Thanks for the explanation. "The last byte of the last 51 byte chunk needs to be 0" Is that always true? Quote Link to comment Share on other sites More sharing options...
sage Posted October 31, 2018 Share Posted October 31, 2018 Thanks for the explanation. "The last byte of the last 51 byte chunk needs to be 0" Is that always true? You might want to check the disassembled bootrom to convince yourself. Quote Link to comment Share on other sites More sharing options...
ninsei Posted November 2, 2018 Author Share Posted November 2, 2018 Is there a way to tell if a ROM is using Epyx or BLL loader? If a ROM starts with the layout that Karri posted in post number 8 of this thread: Is that the Epyx layout? Assuming it is, I was unable to find an equivalent explanation of the BLL layout, other than a couple of fields of the dir entry section are XORed in BLL. But what about the layout of the loader section of BLL? Quote Link to comment Share on other sites More sharing options...
sage Posted November 2, 2018 Share Posted November 2, 2018 yes. the easiest way is to check the default location for useful directory data. these are 512 and 410, depending on which type of epyx loader is used (there are several). in case of bll, the main directory contains only one entry, and a second directory with a slighly different format. any homebrew can use any directory format it wants. The bootrom only makes it necessary that the first 52 bytes of rom are correctly decryptable. what happens afterwards, depends what code you put inside there... Quote Link to comment Share on other sites More sharing options...
sage Posted November 2, 2018 Share Posted November 2, 2018 http://lynxdev.atari.org/enlighten_rom.pdf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.