views:

816

answers:

3

I have been given a .Hive file from a registry which i have to parse and use the contents as part of a html report(from this i assume i have to convert to text somehow). The whole thing must be done within the program so i cant just convert the hive file and then run it through my program. I currently have no idea how to even start this so any help on this would be great.

Any ideas would be fantastic!

A: 

Without seeing the input, it is hard to tell what the best approach is. You are probably going to need to use the RegExp class to parse out your keys and values. If you can get clean enough paths to the values, you might be able to get away with string.Split() to split the path into arrays of keys and walk the registry using those values.

Does the input set include the type of values, or can you assume that the values already exist in the registry?

A little more information on the input set would be useful. An example, possibly?

Brian Genisio
A: 

Thanks for your answer, ive managed to figure it out now. It wasnt the parsing it was importing the data i was having problems with. I created a hive.out file and then imported it in the normal text way.

A: 

A quick Google of ".HIVE file format" points to the format being binary. I would start by seeing if you can find a specification for the file format you are parsing. If the file format you need to parse is the one linked to above, then you'll need to use a System.IO.BinaryReader to go through the file. It might also be helpful to set up some classes or structures in C# that represent the file format structures and populate those as you parse the file. You can then do your HTML reporting off of these objects you've populated.

Jeremy Wiebe