Important information: this site is currently scheduled to go offline indefinitely by end of the year.

[Request] Guild Wars 2 DAT

The Original Forum. Game archives, full of resources. How to open them? Get help here.
xtridence
n00b
Posts: 11
Joined: Tue May 08, 2012 8:58 am
Has thanked: 9 times
Been thanked: 23 times

Re: [Request] Guild Wars 2 DAT

Post by xtridence »

Rhoot wrote:You now have another bug on your hands instead. You cannot do 'delete[]' on a variable that was allocated with 'malloc'. Malloc'ed chunks of memory need to be freed using free(). I'm looking at the 'delete[] img' you added.
Fixed. :)
Used new instead of malloc.
Nimba
beginner
Posts: 38
Joined: Wed Mar 07, 2012 8:32 pm
Been thanked: 14 times

Re: [Request] Guild Wars 2 DAT

Post by Nimba »

xtridence: Is it ok with you if I commit your atexreader sources to the Bitbucket repo? I'll keep it up-to-date for you if you want whenever you release a new version.
jeckerson
n00b
Posts: 10
Joined: Fri May 18, 2012 5:00 pm
Has thanked: 4 times

Re: [Request] Guild Wars 2 DAT

Post by jeckerson »

Any one know in what format .strs files are: xml, txt or some DB type? And if there are some strs parser that convert to another viewable formats?
stalja
beginner
Posts: 32
Joined: Sat Sep 12, 2009 11:33 am
Has thanked: 10 times
Been thanked: 5 times

Re: [Request] Guild Wars 2 DAT

Post by stalja »

Everyone is asking about strs files. I did some research of my own on the subject. The format seems to very similar, if not the same, to Guild Wars 1 strs files format. For now I have determined that plain text strings have a 6 byte header that tell the length and the type of the string. But there are some strange parts of the strs files that I was not able to decipher. In an old thread here on xentax it is suggested that these strings are encoded/compressed, but I cano not determine the compression method used. It does not look like zlib but I might be wrong because my RE skills are very novice. I did try poking around the exe to find the function that opens strs files and manipulates them and from what I was able to gather that there is one point in the exe file where this is done (00A767E5) but this is as far as my RE skills go right now.

Still, even if we decipher all of this (which I am sure is a piece of cake for some experienced RE) it remains to be determined how are these strings connected to items, icons, rewards and all that other good stuff that makes up a MMO game.
jeckerson
n00b
Posts: 10
Joined: Fri May 18, 2012 5:00 pm
Has thanked: 4 times

Re: [Request] Guild Wars 2 DAT

Post by jeckerson »

It seems that in strs only INT data is encoded, or maybe some link variables to another files, because I can easily read names and descriptions of items/skills.
It does not look like zlib but I might be wrong because my RE skills are very novice.
And how about Huffman coding?
kthackeray
n00b
Posts: 15
Joined: Tue Mar 27, 2012 7:36 pm

Re: [Request] Guild Wars 2 DAT

Post by kthackeray »

They use the same format as GW1 with the addition of the header. Strings are referenced in structs and packet via an ID number. Each string has a 6 byte header including the size and enc info. Non UTF strings in GW1 are RC4 encrypted (with every string having a unique key) so I assume they are using the same here.
lordsavyj
ultra-n00b
Posts: 3
Joined: Wed May 16, 2012 5:25 am

Re: [Request] Guild Wars 2 DAT

Post by lordsavyj »

Yeah, what they said...it's almost identical to gw.dat format (http://www.guildwiki.org/User:Dr_ishmael/Gw.dat).

I built a proof of concept in PHP (http://dev.kantanker.us/lab/) and you can see my code at (http://dev.kantanker.us/lab/code.php).

Update: Code updated to better display strings
xtridence
n00b
Posts: 11
Joined: Tue May 08, 2012 8:58 am
Has thanked: 9 times
Been thanked: 23 times

Re: [Request] Guild Wars 2 DAT

Post by xtridence »

Here's a STRS reader (I did not release it earlier as the format is not fully understood yet). The format for encrypted strings is unknown.

The dump button is to combine all STRS files (in a directory) and output into a single file so that strings can be searched easily.

@Nimba: You can commit the stuff to a repository if you want. Please include the compiled files in the repository.
You do not have the required permissions to view the files attached to this post.
Cruelbob
ultra-n00b
Posts: 4
Joined: Wed May 16, 2012 3:27 am

Re: [Request] Guild Wars 2 DAT

Post by Cruelbob »

I have scanned Gw2.exe for cryptographic primitives.
You do not have the required permissions to view the files attached to this post.
jeckerson
n00b
Posts: 10
Joined: Fri May 18, 2012 5:00 pm
Has thanked: 4 times

Re: [Request] Guild Wars 2 DAT

Post by jeckerson »

xtridence wrote:Here's a STRS reader (I did not release it earlier as the format is not fully understood yet). The format for encrypted strings is unknown.

The dump button is to combine all STRS files (in a directory) and output into a single file so that strings can be searched easily.

@Nimba: You can commit the stuff to a repository if you want. Please include the compiled files in the repository.
Could you explain me please meaning of Ichar and type fields?
ral
beginner
Posts: 24
Joined: Mon Apr 23, 2012 5:26 pm
Has thanked: 9 times
Been thanked: 5 times

Re: [Request] Guild Wars 2 DAT

Post by ral »

Thank you guys.

I don't know if anyone looked closer at the files in PF/ABNKBKCK already (which currently are .mp3 files). I just started looking at them.
They always start with 496 bytes (PF ABNKBKCK).
After that there are more Headers in the file. So far i only saw PF ASNDASND (mp3 files with Xing header) and PF MODLMODL (If there are more i'll edit it in later once my unpacker is done with everything).
If you want all files just cut the .mp3 files at every new PF Header (start with 50 46 01 00 00 00 0C 00).

The ASNDASND Header is 92 bytes.
After that one there is a MPEG Audio Header + XING Header.
I don't know much about audio files but I think there's nothing more than the audio after the headers.

Last but not least the update for those who want to update their unpacker to seperate the .strs files into german, english, french and korean Directories: (If 2nd last byte really == the language. There seem to be a lot of stuff that isn't translated if it's true)

Code: Select all

case 'srts': //GW2
	textcount++;
	CreateDirectory("GWDat/strs",NULL);
	// looking for the language
	switch (Output[OutSize-2])
	{
	case 0:
		printf("english strs");
		CreateDirectory("GWDat/strs/english",NULL);
		sprintf(newname,"GWDat/strs/english/%s.strs\0",Name);
		break;
	case 1:
		printf("korean strs");
		CreateDirectory("GWDat/strs/korean",NULL);
		sprintf(newname,"GWDat/strs/korean/%s.strs\0",Name);
		break;
	case 2:
		printf("french strs");
		CreateDirectory("GWDat/strs/french",NULL);
		sprintf(newname,"GWDat/strs/french/%s.strs\0",Name);
		break;
	case 3:
		printf("german strs");
		CreateDirectory("GWDat/strs/german",NULL);
		sprintf(newname,"GWDat/strs/german/%s.strs\0",Name);
		break;
	default:
		// other language
		printf("strs");
		sprintf(newname,"GWDat/strs/%s.strs\0",Name);
	}
Last edited by ral on Sat May 19, 2012 3:47 pm, edited 1 time in total.
xtridence
n00b
Posts: 11
Joined: Tue May 08, 2012 8:58 am
Has thanked: 9 times
Been thanked: 23 times

Re: [Request] Guild Wars 2 DAT

Post by xtridence »

PF reader for those who want to delve into PF files. Note that the structure of the PF file is not completely understood yet (so the tool is not exactly that useful), however I hope that this tool might speed up some progress towards that.

@jeckerson: "lchar" refers to the character with the smallest ASCII value (assuming it followings GW specification). "type" = 16 means the text is UTF-16 (it is currently not known how to read the strings for other values).
You do not have the required permissions to view the files attached to this post.
kthackeray
n00b
Posts: 15
Joined: Tue Mar 27, 2012 7:36 pm

Re: [Request] Guild Wars 2 DAT

Post by kthackeray »

xtridence wrote:Here's a STRS reader (I did not release it earlier as the format is not fully understood yet). The format for encrypted strings is unknown.
xtridence wrote:"type" = 16 means the text is UTF-16 (it is currently not known how to read the strings for other values).
kthackeray wrote:Non UTF strings in GW1 are RC4 encrypted (with every string having a unique key) so I assume they are using the same here.
In order to read them you need the key from the server...
jeckerson
n00b
Posts: 10
Joined: Fri May 18, 2012 5:00 pm
Has thanked: 4 times

Re: [Request] Guild Wars 2 DAT

Post by jeckerson »

kthackeray wrote:In order to read them you need the key from the server...
If there are some way to brute-force that keys or read packets while playing?
kthackeray
n00b
Posts: 15
Joined: Tue Mar 27, 2012 7:36 pm

Re: [Request] Guild Wars 2 DAT

Post by kthackeray »

jeckerson wrote:If there are some way to brute-force that keys or read packets while playing?
You have to get them from analyzing server packets, yes. The GW1 algorithm has already been cracked and so far there is no evidence to show that they are using something different here. I'm not sure why you would want to waste the time to brute force them just for some text. Imagine how long it would take to do so for ~198,000 strings each with a unique key.
Post Reply