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

Help with *.arc files

The Original Forum. Game archives, full of resources. How to open them? Get help here.
robotnick
beginner
Posts: 23
Joined: Sun Feb 17, 2008 1:52 pm
Has thanked: 4 times

Help with *.arc files

Post by robotnick »

The contents of this post was deleted because of possible forum rules violation.
User avatar
Savage
VIP member
VIP member
Posts: 559
Joined: Sun Apr 17, 2005 11:00 am
Has thanked: 16 times
Been thanked: 18 times

Re: Help with *.arc files

Post by Savage »

Plz next time try to upload in another file hosting
Thanks
Let's to see this file
Image
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Help with *.arc files

Post by Rheini »

Well the data is completely encrypted. I managed to decrypt everything. It is a simple xor algorithm. The directory can be decrypted with the global xorValue (data is treated as dwords, see the first file as an example, the last 3 bytes aren't encrypted there)
Each file is encrypted using its own xorValue.

However, the best way to deal with arc archives is to write a program for the system.dll. All functions to modify ARC archives are available in there.

my 010 editor binary template:

Code: Select all

char magic[4];
uint version;
uint numFiles;
uint dirOffset;

FSeek(FileSize()-4);
uint xorValue<format=hex>;

FSeek(dirOffset);
struct Entry
{
	char filename[128]; // 0 terminated
	char pathname[256]; // 0 terminated
	uint offset;
	uint size;
	uint xorValue; // the value used
} directory[numFiles];
after applying it, you need to select the directory and binary xor it with the global xorValue to get the correct values.

I attached the first 3 decrypted files as an example.
You do not have the required permissions to view the files attached to this post.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Help with *.arc files

Post by Rheini »

Rheini wrote:However, the best way to deal with arc archives is to write a program for the system.dll. All functions to modify ARC archives are available in there.
Well, it's harder than I thought. Got to figure out all the class hierarchy relations.

Code: Select all

namespace lexis
{
	namespace system
	{
		class TE_DLL_API IArchive
		{
		public:
			struct FileEntry
			{
				uint uk1;
				uint uk2;
				uint uk3;
				uint uk4;
				uint uk5;
				uint uk6;
				uint uk7;
				uint uk8;
				uint uk9;
				uint uk10;
				uint uk11;
				uint uk12;
				uint uk13;
				uint uk14;
				uint uk15;
				uint offsetInFIle; // Offset of the file in the ARC0 ?!
				uint filesize;
			}; // ????
			struct FindData {}; // ???
			IArchive();
			IArchive(const IArchive& rhs);
			~IArchive();
			string getName();
		};

		class TE_DLL_API ArchiveARC
		{
		public:
			ArchiveARC();
			ArchiveARC(const ArchiveARC& rhs);
			~ArchiveARC();
			int addFile(string name, const char* name2, uint id); // bool
			uint addFolder(string name);
			uint clear();
			uint close();
			uint findFile(string name, IArchive::FileEntry fileEntry);
			void* findFileBegin(IArchive::FindData findData);
			void* findFileNext(IArchive::FindData findData);
			virtual uint load(const string& name);
			uint open(uint id);
			int readFile(const IArchive::FileEntry& fileEntry, void* destBuffer);
			uint removeFile(const IArchive::FileEntry& fileEntry);
			uint save(string filename);

		};

		class TE_DLL_API ArchiveFilter
		{
		public:
			ArchiveFilter();
			ArchiveFilter(const ArchiveFilter& rhs);
			~ArchiveFilter();
			IArchive* addArchive(string name);
			int findFile(string name, IArchive::FileEntry& fileEntry); // bool
			uint forAllArchives(int (*callbackFunc) (IArchive*,void*), void*);
			IArchive* getArchive(string name);
			string getExtension();
			string getName();
			void registerArchives(string name);
			void setExtension(string ext);
			void setName(string name);
		};
	}
}
Anyone got experience with C++-DLLs (exported classes and stuff)?
You do not have the required permissions to view the files attached to this post.
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Re: Help with *.arc files

Post by Mr.Mouse »

Hmm, I've only "google" experience from the past, when I created a dlll in C++ that I needed as a wrapper. But that would not help you. .. . :(
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Help with *.arc files

Post by Rheini »

The problem is the exe doesn't use many functions, mainly just createInstance or getInstance functions.
This seems like compiler generated stuff.
So I can't really see how the ARC management code is called. :(
Rick
Moderator
Posts: 388
Joined: Tue Aug 09, 2005 10:10 pm
Been thanked: 84 times
Contact:

Re: Help with *.arc files

Post by Rick »

Rheini wrote:The problem is the exe doesn't use many functions, mainly just createInstance or getInstance functions.
This seems like compiler generated stuff.
So I can't really see how the ARC management code is called. :(
Interfaces and vtable calls. I'm working on this game now myself.
https://blog.gib.me/

Don't ask me about localization tools; if you don't have the resources to develop them yourself you don't need them.
Rick
Moderator
Posts: 388
Joined: Tue Aug 09, 2005 10:10 pm
Been thanked: 84 times
Contact:

Re: Help with *.arc files

Post by Rick »

I have a functional extractor now, I will post it later if I confirm it to be working correctly.
https://blog.gib.me/

Don't ask me about localization tools; if you don't have the resources to develop them yourself you don't need them.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Help with *.arc files

Post by Rheini »

Rick wrote:
Rheini wrote:The problem is the exe doesn't use many functions, mainly just createInstance or getInstance functions.
This seems like compiler generated stuff.
So I can't really see how the ARC management code is called. :(
Interfaces and vtable calls. I'm working on this game now myself.
So you have knowledge about that stuff? Would you tell me where you got that from? Are there any tutorials out there (or something like that)?
Rick
Moderator
Posts: 388
Joined: Tue Aug 09, 2005 10:10 pm
Been thanked: 84 times
Contact:

Re: Help with *.arc files

Post by Rick »

Rheini wrote:So you have knowledge about that stuff? Would you tell me where you got that from? Are there any tutorials out there (or something like that)?
Yes I do, it's mostly from experimenting myself rather than tutorials, though I believe there is some information on vtables and such.

Attached is ExtractArc.zip (with a single file, ExtractArc.exe), command-line application, specify archive file as first argument, will extract contents to current directory. 'system.dll' from the game directory is required to be present in the directory of ExtractArc.exe. I suggest placing ExtractArc in the game directory then changing to the resources directory and doing ..\ExtractArc.exe archiveName.arc.

You can override any file in the archives by placing it in the same path it was extracted to in either the main game directory or resources, eg, scripts\start.lua in scripts.arc can be in .\scripts\start.lua or .\resources\scripts\start.lua (the game checks both paths for existence of this file before checking archives for it).
You do not have the required permissions to view the files attached to this post.
https://blog.gib.me/

Don't ask me about localization tools; if you don't have the resources to develop them yourself you don't need them.
robotnick
beginner
Posts: 23
Joined: Sun Feb 17, 2008 1:52 pm
Has thanked: 4 times

Re: Help with *.arc files

Post by robotnick »

It's working great Rick!! Thanks to everybody! :) :)
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: Help with *.arc files

Post by Rheini »

There's another game from that developer, probably they use the same system for that one.
http://www.gamershell.com/download_22691.shtml
Rick
Moderator
Posts: 388
Joined: Tue Aug 09, 2005 10:10 pm
Been thanked: 84 times
Contact:

Re: Help with *.arc files

Post by Rick »

Rheini wrote:There's another game from that developer, probably they use the same system for that one.
http://www.gamershell.com/download_22691.shtml
The Experiment and Experience 112 are the same game. The Experiment is the US title for Experience 112.
https://blog.gib.me/

Don't ask me about localization tools; if you don't have the resources to develop them yourself you don't need them.
qorilla
ultra-n00b
Posts: 2
Joined: Mon Apr 02, 2007 4:19 pm

Re: Help with *.arc files

Post by qorilla »

Hi!

Thanks for this extractor program!
My question is, would it be possible to somehow pack new archives? I mean repacking the archive, with some changes to some files in it.

Thank you very much!
Rick
Moderator
Posts: 388
Joined: Tue Aug 09, 2005 10:10 pm
Been thanked: 84 times
Contact:

Re: Help with *.arc files

Post by Rick »

qorilla wrote:Hi!

Thanks for this extractor program!
My question is, would it be possible to somehow pack new archives? I mean repacking the archive, with some changes to some files in it.

Thank you very much!
Probably, but what is the need when you can just use overriding the files as I mentioned earlier?
https://blog.gib.me/

Don't ask me about localization tools; if you don't have the resources to develop them yourself you don't need them.
Post Reply