3 Replies - 4273 Views - Last Post: 15 October 2011 - 07:51 PM Rate Topic: -----

#1 GuillaumeDrolet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-October 11

Find a log file encoding and understand it's structure

Posted 14 October 2011 - 09:18 PM

My questions isn't really about a programming language but, since I did not find a general programming forum, I chose this one as I know VB.Net.

There's this game, that you might already know, which is called Star Wars Galaxies (And is ending soon actually .. :/ ). For each account and character, the game automatically saves chat logs in a .cht file. A player can have multiple chat channels that have different chat filters (group chat, public chat, etc) and they are all saved in this file. I'm thinking they are probably separated by some kind of a "flag" for the game to be able to detect them.

So, basically, I would like to have some advices on what would be a good method for finding out the structure and enconding of the file so that I can then parse it and make something that I could read afterward and even have filters to only keep a particular chat channel, or some types of messages. Anyway, you probably get the idea.

I'm thinking the file might be a binary file but honestly I don't know.. I got a binary file reader and it didn't seem to make much more sense than in the other formats.

I haven't had much time to work on this because I'm working 7/7 and I got other programming stuff I have to work on so I would really appreciate some help from someone who has more experience than I do.

I added in attachment one log file generated by the game.

I'm not sure if I forgot to give any important info but I think that might be a good start. I changed the extension from cht to txt so that I could upload it..

Thanks!

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: Find a log file encoding and understand it's structure

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9392
  • View blog
  • Posts: 35,271
  • Joined: 12-June 08

Re: Find a log file encoding and understand it's structure

Posted 15 October 2011 - 10:54 AM

It opens up as plain text to me in wordpad. Sure there's some oddities like extra spaces between characters and a hex color tag at the head of each line, but there's not much to it.

Example - if I pull out the spaces with a simple replace it get these two lines at the top.

Quote

\#FF0000Welcome to Star Wars Galaxies!\#FFFFFF
\#11ff44aRebel Sniper says, \#."\#ffffffYou looking for something?\#."

Was This Post Helpful? 0
  • +
  • -

#3 GuillaumeDrolet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-October 11

Re: Find a log file encoding and understand it's structure

Posted 15 October 2011 - 02:23 PM

Thanks for your reply!

... I doubt those are really spaces between the letters. The reasons why I'm saying this is: I really don't see why they would do such a thing as adding a space between each characters of their log file and when I open the file in Notepad++ it shows the characters as a black square written either "NUL", "ETX", "STX", or other characters.

Quote

FORM ª*UISTFORM ª0003RESO    FORM ªOWNENAME SwgCuiChatWindowMediator FORM ©½STRSDATA 8‹text_0 @œ


And that is definitely not just plain text. It must mean something to the program...

...Do you think that it could be a serialized object?

I already began making a program that simply removes those characters as you did but I would rather (find a way to) figure out how it is "encrypted", if I can say so.
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1057
  • View blog
  • Posts: 4,099
  • Joined: 02-July 08

Re: Find a log file encoding and understand it's structure

Posted 15 October 2011 - 07:51 PM

If it's a serialized object you would have to be able to rebuild the structure correctly to deserialize it. You can try to find a way to read one line or all lines and replace the strange characters with something you can use to delimit the lines into an array. Then make your own class with fields that fit the contents and add the info to your class object and if there are many lines you may use a List(Of <your custom class>) to hold several objects.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1