The online racing simulator
.NET - LFSReplayParser - Library to parse LFS replay headers
LFSReplayParser is a .NET library which parses the headers from Live for Speed multiplayer and singleplayer replay files. It is based on my experience designing the league admin tool LFSPoints.

The library is provided as a Microsoft Visual C# 2008 Express Edition solution, with a short example program, LFSReplayViewer.zip, as a secondary option. You may download the source for both programs below.

It is released under the LGPL open-source license.
Attached files
LFSReplayParser_source.zip - 43.5 KB - 425 views
LFSReplayViewer_src.zip - 58.6 KB - 404 views
Nice, though you shall receive five trout slaps for using goto
Quote from AndroidXP :Nice, though you shall receive five trout slaps for using goto

LOL Where?

Nice work DarkTimes, Certainly something i shall play with!
Well, at least I think he does. Maybe it's a compiler optimization, who knows
Quote from AndroidXP :Well, at least I think he does. Maybe it's a compiler optimization, who knows

Been disassembling code now have we?
Hmm, weird. Must be an optimisation by the C# compiler, as I really don't use any goto in it. Funnily enough I was thinking about using a goto for something else the other day, but I couldn't actually remember the syntax for delaring one, as I've genuinely used it that little.
I've rechecked and yes, it seems to be a compiler optimization. I guess you have a bit of "duplicate code" in many of the switch cases in LfsFileReader.ReadEncodedString(), the compiler seems to put a bunch of labels after the switch to optimize code usage for cases that would use the same or similar parts of code.

E: So only one trout slap for allowing the compiler to use goto in your precious code
Well, I need to get over my weird paranoid complex about posting source-code, so I've uploaded the Visual C# 2008 Express Edition project files. Be gentle, this is a new experience for me.

Edit: Also remember it's code mostly hacked from a different program and put together after a few whisky's on a Saturday night.
If you wanted to protect your sources, .NET is in my experience unfortunately a rather bad place to be in general. By using .NET Reflector you can pretty much look at any MSIL based code (.NET dlls and exe files) and get a 99% working copy & pasteable code (in the language you specify; C#, VB.NET... whatever you want). It's so simple any doofus can use it, and it's actually a quite nice tool if you want to learn how MSIL code works. Using the Reflexil addon you can even do simple code manipulations, though they mostly have to be done in IL directly.

Afaik your best bet is trying to use some obfuscators, but they only do what their name suggests, obfuscate the code to make it harder to read, not impossible.

You could argue that reverse engineering has always been possible, but it's actually a bit scary once it gets so easy and produces such nice readable code.
-
(DarkTimes) DELETED by DarkTimes
-
(mcgas001) DELETED by mcgas001 : Request by OP, Going too far Off topic :)
Holy shit, just one day after I finished my own replay parser I find this thread :banghead:
Good job there though, some interesting solutions for problems I also bumped into!
edit: irrelevant.
:wow: This is great. why i haven't seen this thread before
Excellent Work and Thank you very much
edit: irrelevant.
is it possible to extract setup from .spr files in hotlap mode ? Hex editor wasnt found equal places in two .spr with one setup used in it.
No it isn't - apart from the info already available - as setup information is encrypted.

FGED GREDG RDFGDR GSFDG