[REQUEST]Source code for a data.sah/saf reader

07/31/2014 18:55 [DaE]Asew#1
Hey fellow Devs,

I was wondering if anyone had or could program a data.saf/sah reader in python, Java or C++, because I would very much need one for my programs I'm programming. I'm not sure if this is the right place to ask but I'm pretty sure some people in this community would know how to program one.

If nobody has one or could program one I'll take my own chances and try to program on myself but I guess I'd be better off if I didn't have to create one myself as I merely know where to start(well I know how the data.sah and data.saf work but thats just about it).

Thanks a lot if anyone could help, :handsdown: :handsdown:

[DaE]Asew :rtfm:
07/31/2014 19:14 nubness#2
Quote:
Originally Posted by [DaE]Asew View Post
well I know how the data.sah and data.saf work but thats just about it
What's the actual problem then ?
07/31/2014 20:32 [DaE]Asew#3
Quote:
Originally Posted by nubness View Post
What's the actual problem then ?
I don't know where to start. oO
07/31/2014 20:54 nubness#4
Do you know any programming language ?
07/31/2014 21:01 [DaE]Asew#5
Quote:
Originally Posted by nubness View Post
Do you know any programming language ?
Well all 3 stated in my post (Python, Java and C++) but mostly oriented in creating 2D games but I'm a little less comfortable in C++ then the other 2. Why would I have asked for the source codes in tose languages if I didn't know those languages?

And this is pretty much all I know about a data.sah and data.saf: a data.sah file is a kind of meta-indexes, it contains the list of all files present in the .saf archive; for each file we found its name, its length and the offset within data.sah where this file starts, the data.saf is the concatenation of all files, all stored one after the others without any delimiter.
07/31/2014 22:48 [GM]TroubleMaker#6
Well I would suggest you just make up your own files like data.xsaf and data.xsah and you can have encryption and stuff like that but it mostly keeps the same structure as the normal .sah/.saf
Well its just a suggestion I'm not sure if its a good one but yeah, if you can't code a reader, do that.
07/31/2014 23:34 [Admin]Slice#7
Quote:
Originally Posted by [DaE]Asew View Post
Hey fellow Devs,

I was wondering if anyone had or could program a data.saf/sah reader in python, Java or C++, because I would very much need one for my programs I'm programming. I'm not sure if this is the right place to ask but I'm pretty sure some people in this community would know how to program one.

If nobody has one or could program one I'll take my own chances and try to program on myself but I guess I'd be better off if I didn't have to create one myself as I merely know where to start(well I know how the data.sah and data.saf work but thats just about it).

Thanks a lot if anyone could help, :handsdown: :handsdown:

[DaE]Asew :rtfm:
If Your a real developer, you should not need help. You should be able to figure it out your self, i mean comon this is just simple programming. How about you try to program it before you ask for help. Also, No one should have to help you with this, many have managed to do this by themselves, its not exactly that hard. You can also google and research how to do somethings, like how to get started on making readers.
08/01/2014 00:14 nubness#8
Quote:
Originally Posted by [Admin]Slice View Post
If Your a real developer, you should not need help. You should be able to figure it out your self, i mean comon this is just simple programming. How about you try to program it before you ask for help. Also, No one should have to help you with this, many have managed to do this by themselves, its not exactly that hard. You can also google and research how to do somethings, like how to get started on making readers.
It's simple programming ? Simple programming ?!? Relatively speaking, it is super simple programming, but for some people it isn't.

You can use any language you're familiar with. All you need are basic I/O operations.

Try to study the .sah file format, it's quite easy to understand. I would tell you the format myself, but I think you'll feel much better after you crack it on your own. Good luck.
08/01/2014 02:21 [Admin]Slice#9
Quote:
Originally Posted by nubness View Post
It's simple programming ? Simple programming ?!? Relatively speaking, it is super simple programming, but for some people it isn't.

You can use any language you're familiar with. All you need are basic I/O operations.

Try to study the .sah file format, it's quite easy to understand. I would tell you the format myself, but I think you'll feel much better after you crack it on your own. Good luck.
i was just saying, i made some readers in the past, and it was pretty simple for me.
08/01/2014 08:47 [DaE]Asew#10
Quote:
Originally Posted by nubness View Post
It's simple programming ? Simple programming ?!? Relatively speaking, it is super simple programming, but for some people it isn't.

You can use any language you're familiar with. All you need are basic I/O operations.

Try to study the .sah file format, it's quite easy to understand. I would tell you the format myself, but I think you'll feel much better after you crack it on your own. Good luck.
Ok then I'll try it out myself.
Its actually easier than I thought...

EDIT: Im actually gonna go with what GM TroubleMaker said because it would actually be pretty easy to get hold of all the data if using data.sah/saf cos there are already so many tools out there to break into the files. So now im making two file data.gdh -> data.sah and data.gdf -> data.saf and well the only differents really is kind of the way the data.sah is structured and that the whole file is encrypted.
08/04/2014 04:43 castor4878#11
Hi Folks,

No, I wasn't dead ;)

I recently noticed that shaiya discover the "i18n" paradigm, never tool late.
It also means that shStudio will soon or later only manage a very few part of the files.
I so decide to re-re-spend some time on it.

And since I have the code that close ...

1) the data.saf in a big stream resulting of the concatenation (a cat) of all files used by the client, it has no own structure since it is not packed (zipped) in any manner.

2) the data.sah contains the indexes required to parse the archive (meaning the .saf).

the header of the file is as follows:

Code:
struct sah_header {
//	51 bytes flat structure
	char	signature[3];	//	'SAH'
	long	unk1;			//	0
	long	nbFiles;		//	number of all files (not including folders)
	char	padding[40];	//	00s
};
then, one reads recursively:

- name of current directory
- number of files in that directory (long, 32 bits)
+ for each file
- name of file (relative to the parent directory)
- offset in .saf where the file starts (__int64, 64 bits)
- file's length (long, 32 bits)
- "attributs" (long, 32 bits) can be anything, not used by clients (can store "version" info).
+ end for
- number of child directories (long, 32 bits)
{ each sub-dir is read recursively with same structure }

all string (names of files and directories) are prefixed by their length coded as a long (32 bits, Little Endian), the ZeroTerminal char. is usually included in this length; so for instance the root directory (which is usually - but not mandatory - empty) is coded as: [01 00 00 00](length) [00] "\0"

once you have found the right file name in right directory, you use the corresponding offset within the .saf to read the given size of data.
after edition, if any, you can store the file at the same offset as long as it is not bigger than its original size, you will store the new (shorter) length if required; if file is larger, a new block is added at the end of .saf and the record in .sah is updated with the new offset & length.

Quote:
So now im making two file data.gdh -> data.sah and data.gdf -> data.saf and well the only differents really is kind of the way the data.sah is structured and that the whole file is encrypted.
I definitively failed to get the point !...
If the purpose was to read the files used by a valid client and to generate files still valid for a client, use the structure above; if the point is to produce random data, you can indeed encipher the files with an unknown key or easier XOR the whole file with the current CPU temperature.

Cheers.
01/16/2015 23:29 SevenZeroNine#12
Have 1010 Dell mini, All works except some game panels will not open when depressing tab, or talk... Like, Skill tab, it sling the slider down, and the entire window will not drag anywhere, and can not open skill.. basic, combat, or special. The warehouse, and NGC quest givers won't open either.

Have re-installed, have updated last drivers known, and cleaned with CCleaner as told.

Now suspecting the game streaming is not returning from client to function.

Got any ideas?

709