I am just starting to dig into the DCS SDK and these two pages caught my eye.
http://dcs.cemetech.net/index.php/BasicLibs:BinRead
http://dcs.cemetech.net/index.php/BasicLibs:BinDelete
BinRead takes data from a "FILENAME", I assume that only means .8xp filenames since it didn't work with an appvar name. I am wondering why it allows negative values for the start byte and allows the arguments to go past the end of the file. It's not too important since security isn't a concern on a calculator, but there all kinds of weird things that this entails, which I'll describe in a second. BinDelete is worse, again it allows negative arguments and it can will accept arguments that make go past the end of the file, which is an actual problem since this means you can crash the calculator very easily, as I did.
The weird things I mentioned earlier:
1. Since you can give BinRead nonsensical arguments, I tried 10^96, 10^97 etc, with various arguments for the length. They all returned the same predefined section of a string only varying based on the length argument.
2. They accept non-integer arguments for the starting byte and the length of the returned string. For BinRead with 0 as the start byte, and .999 for the length, I got a memory error. For .599 as the length I got a long stream of flowing tokens and ASCII before it crashed.
3. For a nonexistent program file, BinRead writes ".7" to ANS and ".6" for a blank string as the filename, which isn't on the SDK page.
4. From BinRead I have gotten ".L" when I gave the imaginary unit as the argument for the start byte, and 1, for the length.
5. For BinRead and BinDelete, I gave i, the imaginary unit as the arguments for the start byte and the number of bytes and it archived the program I gave as the filename.
I could go on, but I think this is enough.
http://dcs.cemetech.net is formatted like a wiki, but I can't seem to find anyway to edit. What I would like to do is dive into the DCS source code help document it, since all of the pages seem pretty sparce.
If anyone can explain why these "functions" act so weirdly instead of just giving error messages, I would love to hear it. Otherwise I'd like to ask if there is a way to edit pages on http://dcs.cemetech.net
http://dcs.cemetech.net/index.php/BasicLibs:BinRead
http://dcs.cemetech.net/index.php/BasicLibs:BinDelete
BinRead takes data from a "FILENAME", I assume that only means .8xp filenames since it didn't work with an appvar name. I am wondering why it allows negative values for the start byte and allows the arguments to go past the end of the file. It's not too important since security isn't a concern on a calculator, but there all kinds of weird things that this entails, which I'll describe in a second. BinDelete is worse, again it allows negative arguments and it can will accept arguments that make go past the end of the file, which is an actual problem since this means you can crash the calculator very easily, as I did.
The weird things I mentioned earlier:
1. Since you can give BinRead nonsensical arguments, I tried 10^96, 10^97 etc, with various arguments for the length. They all returned the same predefined section of a string only varying based on the length argument.
2. They accept non-integer arguments for the starting byte and the length of the returned string. For BinRead with 0 as the start byte, and .999 for the length, I got a memory error. For .599 as the length I got a long stream of flowing tokens and ASCII before it crashed.
3. For a nonexistent program file, BinRead writes ".7" to ANS and ".6" for a blank string as the filename, which isn't on the SDK page.
4. From BinRead I have gotten ".L" when I gave the imaginary unit as the argument for the start byte, and 1, for the length.
5. For BinRead and BinDelete, I gave i, the imaginary unit as the arguments for the start byte and the number of bytes and it archived the program I gave as the filename.
I could go on, but I think this is enough.
http://dcs.cemetech.net is formatted like a wiki, but I can't seem to find anyway to edit. What I would like to do is dive into the DCS source code help document it, since all of the pages seem pretty sparce.
If anyone can explain why these "functions" act so weirdly instead of just giving error messages, I would love to hear it. Otherwise I'd like to ask if there is a way to edit pages on http://dcs.cemetech.net