Pretty much from the readme, and cross-posted from UnitedTI:

Code:
ROM Parser
beta revision 23 October 2010


Summary

The ROM Parser is a program that reads in a ROM file and extracts the data in
it.  It can be run from the command line or as a GUI application.


GUI Operation

To run the ROM Parser as a GUI application, run it with no command line
arguments, pass the name of a ROM to open as the only command line argument,
or pass it the --gui command line option.

From within the GUI, you can use File > Open to open a new ROM.  Once a ROM is
open, you browse subitems in the ROM on the left, and see information about an
item on the right.  For the Archive item, you can use the Export All button to
export all variables to a folder.  For a Variable in the archive, you can use
the Export button to export that variable.  Items in the archive are now
automatically sorted by type and name by default.


Command Line Operation

To extract all items from a ROM, do

romparse --file somefile [--out somedirectory]

This will extract everything in the archive except complex numbers and complex
lists.


Remarks

The correctness of the export for all file types has not been verified.

This program exports groups in the 8xgrp format used by TiLP.  This is because
the 8xgrp format contains a group file as it appears in the archive.  TI
Connect's 8xg format does not mimic the internal structure of a group.


Change Log:
23 October 2010
 - Placed file load operations in try ... catch blocks.
 - Raw Data viewer now supports different widths and can display ASCII
 - Various new functionality and GUI tweaks, such as Export now being a menu
   option.
 - Can read OS and boot code version
 - Can sort items in the archive by type/name, or location

13 October 22010
 - Added GUI
   - Supports exporting any single item
   - Supports exporting all items
 - --help implemented.  This overrides --gui.
 - Application Target changed to .NET 3.0 instead of 4.0.  This should make the
   program able to run on some older machines without .NET being updated.

12 October 2010
 - Initial Release
 - Command-line application


Download it. The beta build can be found in .\romparse\publish\Application Files\romparse_0_1_0_1

I think I'll start work on a GUI now, and move into support for editing ROMs.
This seems like a great idea for a program; thanks for thinking of it and implementing, DrDnar! I presume that you're using C++ to write this? Having experienced the flaws of higher-level scripting languages like Python when trying to deal with byte-level file manipulation, I strongly recommend sticking with a lower-level language if you aren't already. If you decide you want help packing into .8xg format, I'd be happy to give you a hand with that, having experience from SourceCoder.
It's coded in C#. My only gripe with C# so far has been that working with the byte type requires lots of explicit typecasting from int to byte. For example, the expression (someByteVariable & 0x1F) still requires you to typecast it back to byte. This is a working beta; I've tested it and it correctly exports lists and programs.
Meh, that's significantly awkward. Sad In C there are modifiers you can add to cast constants as types, like explicitly call 0x1F a character (8 bits) as opposed to its default as an integer. Does C# not offer a similar facility? I'm also looking forward to seeing what kind of OS information you can extract.
C# aims to be idiot-proof (hence the lack of implicit narrowing conversions, for example) and a project setting that affects the way numeric literals are interpreted could quite easily lead to confusion. That's why VB.NET does that sort of thing (such as global settings for unchecked/checked expressions) whereas C# requires that you are explicit.

In any case, the real issue is that there is no & operator for System.Byte. The operands are implicitly converted to System.Int32, which does have an & operator, hence the result is an int. It's a little cumbersome, I'll admit, but light years ahead of the pain of trying to do binary file manipulation in PHP. Smile
benryves wrote:
C# aims to be idiot-proof (hence the lack of implicit narrowing conversions, for example) and a project setting that affects the way numeric literals are interpreted could quite easily lead to confusion. That's why VB.NET does that sort of thing (such as global settings for unchecked/checked expressions) whereas C# requires that you are explicit.

In any case, the real issue is that there is no & operator for System.Byte. The operands are implicitly converted to System.Int32, which does have an & operator, hence the result is an int. It's a little cumbersome, I'll admit, but light years ahead of the pain of trying to do binary file manipulation in PHP. Smile
In my work with PHP for the sake of SourceCoder I'd tend to opine differently. I found binary file manipulation in PHP to be much easier than in, for example, Python, where 2.x and 3.x each handle binary file manipulation in their own special and very very broken way.
benryves wrote:
In any case, the real issue is that there is no & operator for System.Byte. The operands are implicitly converted to System.Int32, which does have an & operator, hence the result is an int.
Is it possible to write an extension function that'll allow for this? Can you write extension methods for operators? (You could write an And method, of course).
merthsoft wrote:
Is it possible to write an extension function that'll allow for this? Can you write extension methods for operators? (You could write an And method, of course).
Extension methods only work with methods (and this excludes things that work like methods but aren't, such as operators or properties). The answer is, unfortunately, no.

I haven't been able to download the file; it gets to about half way (at around 2kB/s) before grinding to a complete halt. Sad
benryves wrote:
merthsoft wrote:
Is it possible to write an extension function that'll allow for this? Can you write extension methods for operators? (You could write an And method, of course).
Extension methods only work with methods (and this excludes things that work like methods but aren't, such as operators or properties). The answer is, unfortunately, no.

I haven't been able to download the file; it gets to about half way (at around 2kB/s) before grinding to a complete halt. Sad
I can grab the whole thing in an instant. Perhaps the packets are too lazy to wander across the Atlantic? Wink
benryves wrote:
merthsoft wrote:
Is it possible to write an extension function that'll allow for this? Can you write extension methods for operators? (You could write an And method, of course).
Extension methods only work with methods (and this excludes things that work like methods but aren't, such as operators or properties). The answer is, unfortunately, no.
That is unfortunate. Do you think they will allow for that?

Quote:
I haven't been able to download the file; it gets to about half way (at around 2kB/s) before grinding to a complete halt.
For me it gets to about the 450 mark, then looks like it's stopped, and then opens the .zip anyway. It's strange.
merthsoft wrote:
benryves wrote:
merthsoft wrote:
Is it possible to write an extension function that'll allow for this? Can you write extension methods for operators? (You could write an And method, of course).
Extension methods only work with methods (and this excludes things that work like methods but aren't, such as operators or properties). The answer is, unfortunately, no.
That is unfortunate. Do you think they will allow for that?
There were mutterings after they were first introduced that they were keeping it simple for the first release and may extend them later but I never heard any more about it. It's probably a bit like operator generic constraints; something that would be very nice to have, but can be worked around relatively easily if not.

Quote:
Quote:
I haven't been able to download the file; it gets to about half way (at around 2kB/s) before grinding to a complete halt.
For me it gets to about the 450 mark, then looks like it's stopped, and then opens the .zip anyway. It's strange.
Even though it had stopped at ~44% the whole file had downloaded. Smile It's an interesting project, certainly!
cool Very Happy
So some people cannot download the file? It seems to work for me. At any rate, there isn't much I can do. The webspace provided by my ISP is very limited, and I get the feeling that they have few customers who actually use it.
I think we can all download it, it just shows it downloading very strangely.
DrDnar wrote:
So some people cannot download the file? It seems to work for me. At any rate, there isn't much I can do. The webspace provided by my ISP is very limited, and I get the feeling that they have few customers who actually use it.
What Merth said. I don't think anyone has actually failed to download it. You're welcome to upload it to the Cemetech archives if you'd like, as well.
I've updated the editor. It now includes a GUI.
DrDnar wrote:
I've updated the editor. It now includes a GUI.
So you have, and you also downgraded the minimum .NET version for users of older versions of .NET or of Windows. Did that last part require significant work on your part?
Not really. The program doesn't use the features of .NET that have been added between 3.0 and 4.0. I just had to deleted the unused references to the new .NET features. The really hard part is figuring out how to get Visual Studio to support compiling to the older versions. You have to get a package from Microsoft that installs the support for the older version, but I don't remember where.
DrDnar wrote:
The really hard part is figuring out how to get Visual Studio to support compiling to the older versions. You have to get a package from Microsoft that installs the support for the older version, but I don't remember where.
Project menu, Properties, Application tab, Target Framework dropdown. I don't think there's any need to install anything, unless you're referring to something else.
When I installed Visual Studio 2010, the only target framework available was 4.0. I had to install some MS package to get the older frameworks to appear as targets.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement