Jump to content

eix index file function


Recommended Posts

  • Former Staff

hello guys ... i'm asking if there is a function which generate the index content

at the moment i'm using MakePack (own compiled) with some python scripts to help me but my point is i've created a new function in makepack project... i called it "MakePackFile" to be more specific 

void MakePackFile(const char * filename, int type)
{
	if (type < COMPRESSED_TYPE_COMPRESS || 
		type > COMPRESSED_TYPE_HYBRIDCRYPT)
		type = COMPRESSED_TYPE_SECURITY;
	const char* comptype;
	if (type == 1)
		comptype = "CompressExtNameList";
	if (type == 2)
		comptype = "SecurityExtNameList";
	if (type == 3)
		comptype = "panamaextnamelist";
	if (type == 4)
		comptype = "cshybridencryptexenamelist";
	boost::filesystem::path p(filename);
	string extension = ".txt";
	std::string path = p.stem().string();
	ofstream myfile((path + extension).c_str());
	myfile << "FolderName\t\"packed\"\n";
	myfile << "PackName\t" << p.stem() << "\n";

	myfile << "\nList\t" << comptype << "\n{\n";
	myfile << "\t\"" << "\"\n"; // <--- type all extinsion included in thje pack 
	myfile << "}\n\n";
	myfile << "\nList\tFilelist\n{\n";
	myfile << "\t\"" << "\"\n";
	myfile << "}\n";
	myfile << "List\tFileList\n{\n";
	myfile << "\t\"" << "\"\n";// <--- type file name .. try to take it from "CEterPack::Extract()" function

}

now my goal is to check the type of the pack and send it to this function like this

	else if (!strcmp(argv[1], "--extract"))
	{
		// .exe --extract <packname> [<IV filename>]
		if (argc < 3)
		{
			printf("Usage: %s --extract <packname> [<IV filename>]\n", argv[0]);
			return 1;
		}

		CMappedFile file;
		const BYTE* iv = NULL;

		if (argc >= 4)
		{
			if (!file.Create(argv[3], (const void**)&iv, 0, 32))
			{
				printf("Cannot load IV file %s\n", argv[3]);
				return 1;
			}
		}
		CEterPack pack;
		CEterFileDict dict;
		if (pack.Create(dict, argv[2], "", true, iv))
		{
			pack.Extract();
			MakePackFile(argv[2], X);//argv[2] = name of the pack
			                         //x = type of pack 
			return 0;
		}

		printf("Cannot extract pack %s\n", argv[2]);
		return 1;
	}

 

Edited by flygun
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.