Register for your free account! | Forgot your password?

You last visited: Today at 17:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Forsaken Flyff Decrypt

Discussion on Forsaken Flyff Decrypt within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.

Closed Thread
 
Old 07/27/2014, 14:07   #16
 
elite*gold: 0
Join Date: Nov 2013
Posts: 100
Received Thanks: 55
Quote:
Originally Posted by WurstbrotQT View Post
Ist durch Langeweile entstanden, bin ist im Anhang.

Source:
Code:
// ForsakenDecrypt.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//

#include "stdafx.h"
#include "ForsakenDecrypt.h"
#include <vector>

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

void PrintBread();

// Das einzige Anwendungsobjekt

CWinApp theApp;

using namespace std;

void DecryptForsaken(LPCTSTR lpszPath = "");

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	HMODULE hModule = ::GetModuleHandle(NULL);

	if (hModule != NULL)
	{
		// MFC initialisieren und drucken. Bei Fehlschlag Fehlermeldung aufrufen.
		if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0))
		{
			// TODO: Den Fehlercode an Ihre Anforderungen anpassen.
			_tprintf(_T("Schwerwiegender Fehler bei der MFC-Initialisierung\n"));
			nRetCode = 1;
		}
		else
		{
			PrintBread();
			if( !PathIsDirectory("Decrypt") )
				CreateDirectory("Decrypt", nullptr);
			DecryptForsaken();
			PrintBread();
		}
	}
	else
	{
		// TODO: Den Fehlercode an Ihre Anforderungen anpassen.
		_tprintf(_T("Schwerwiegender Fehler: Fehler bei GetModuleHandle.\n"));
		nRetCode = 1;
	}

	return nRetCode;
}

BYTE Decryption(BYTE in, BYTE key)
{
	in = ~in ^ key;
	return ( in << 4 ) | ( in >> 4 );
}

// flyff source
bool CompareExt( LPCTSTR szName, LPCTSTR szExt )
{
	int nExt = strlen( szExt );
	int n = strlen( szName );
	if( n < nExt )
		return false;
	return ( memcmp( szName + n - nExt, szExt, nExt ) == 0 );
}

typedef struct tagFORSAKENRES
{
	CString strFileName;
	DWORD dwOffset;
	int nFileSize;
} FORSAKENRES;

void DecryptFile(LPCTSTR lpszFileName)
{
	CFile fIn;
	BYTE *pData = nullptr;
	//DWORD dwFileSize;
	bool bEncryption;
	bool bNewEnc = false;
	BYTE byEncryptionKey;
	int nHeaderSize;
	CHAR szFileNameLower[MAX_PATH];
	short nFileNum;
	int nPos = 7;
	short nFileNameLength;
	char szFileName[_MAX_FNAME];
	int nFileSize;
	DWORD dwOffset;
	vector<FORSAKENRES*> vecRes;
	FORSAKENRES *pRes = nullptr;

	strcpy_s(szFileNameLower,lpszFileName);
	_strlwr_s(szFileNameLower);

	if( !fIn.Open(lpszFileName,CFile::modeRead) )
		return;
	cout << "Decrypting " << lpszFileName << endl;

	if( strcmp(szFileNameLower,"data.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"datasub1.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"datasub2.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\custom.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\texture\\customtex.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\custom1.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\texture\\customtex1.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\custom2.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\texture\\customtex2.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\custom3.res") == 0 )
		bNewEnc = true;
	else if( strcmp(szFileNameLower,"model\\texture\\customtex3.res") == 0 )
		bNewEnc = true;

	fIn.Read(&bEncryption,sizeof(BYTE));
	fIn.Read(&byEncryptionKey,sizeof(BYTE));
	fIn.Read(&nHeaderSize,sizeof(int));

	pData = new BYTE[nHeaderSize];

	fIn.Read(pData,nHeaderSize);

	for( int i = 0; i < nHeaderSize; ++i )
		pData[i] = Decryption(pData[i], bEncryption);

	memcpy(&nFileNum,&pData[nPos],sizeof(short)); nPos += sizeof(short);


	for( short i = 0; i < nFileNum; ++i )
	{
		ZeroMemory(szFileName,_MAX_FNAME);
		memcpy(&nFileNameLength,&pData[nPos],sizeof(short)); nPos += sizeof(short);
		if( bNewEnc )
			nFileNameLength += 64;
		memcpy(szFileName,&pData[nPos],nFileNameLength); nPos += nFileNameLength;

		memcpy(&nFileSize,&pData[nPos], sizeof(int)); nPos += sizeof(int);
		nPos += 4; // wtf (ROFL?)
		memcpy(&dwOffset,&pData[nPos],sizeof(DWORD)); nPos += sizeof(DWORD);
		pRes = new FORSAKENRES();
		pRes->dwOffset = dwOffset;
		pRes->nFileSize = nFileSize;
		pRes->strFileName = szFileName;
		vecRes.push_back(pRes);
	}
	
	for( auto pRes : vecRes )
	{
		fIn.Seek(pRes->dwOffset, CFile::begin);
		CFile fOut;
		CString strFileName;
		strFileName.Format("Decrypt\\%s", pRes->strFileName);
		cout << "Writing " << pRes->strFileName << endl;
		if( !fOut.Open(strFileName, CFile::modeCreate | CFile::modeWrite) )
		{
			delete pRes;
			continue;
		}
		BYTE *abyContent = new BYTE[pRes->nFileSize];
		fIn.Read(abyContent, pRes->nFileSize);
		if( byEncryptionKey != 0 )
		{
			for( int i = 0; i < pRes->nFileSize; ++i )
				abyContent[i] = Decryption(abyContent[i],'W');
		}
		fOut.Write(abyContent,pRes->nFileSize);
		fOut.Flush();
		fOut.Close();
		delete [] abyContent;
		delete pRes;
	}

	fIn.Close();
	delete [] pData;
	cout << "Ready!" << endl;
}

void DecryptForsaken(LPCTSTR lpszPath)
{
	WIN32_FIND_DATA data;
	CHAR szPath[MAX_PATH];
	sprintf_s(szPath,"%s*.*",lpszPath);
	HANDLE hFile = FindFirstFile(szPath,&data);
	if(FAILED(hFile))
		return;

	do
	{
		if( !(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
		{
			if( CompareExt(data.cFileName, ".res") )
			{
				CString strFile;
				strFile.Format("%s%s", lpszPath, data.cFileName);
				DecryptFile(strFile);
			}
		}
		else if( strcmp(data.cFileName,".") && strcmp(data.cFileName,"..") )
		{
			CString strPath;
			strPath.Format("%s%s\\", lpszPath, data.cFileName);
			DecryptForsaken(strPath);
		}
	}while( FindNextFile(hFile,&data) );
	FindClose(hFile);
}

void PrintBread()
{
	cout << "_________#########_##_###"				<< endl;
	cout << "_____#####__#____#__#____###"			<< endl;
	cout << "___###___#__##___#___#____#_###"		<< endl;
	cout << "_###_____#___#___##__#____#___###"		<< endl;
	cout << "_#_______##__##___#___#___##__#__#"	<< endl;
	cout << "#_________#___#____#__#____#___#_##"	<< endl;
	cout << "#__________#__#____##_##___##__#__##"	<< endl;
	cout << "_##_________##______###_____####___##"	<< endl;
	cout <<	"__###______________________________##" << endl;
	cout << "_____###___________________________##" << endl;
	cout <<	"________###########################"	<< endl << endl;
	cout <<	"*************************************" << endl;
	cout << "**************Bread Art**************" << endl;
	cout <<	"******Forsaken FlyFF Decrypt0r*******" << endl;
	cout <<	"******Press Any Key to continue******" << endl;
	cout <<	"*************************************" << endl;
	getchar();
}
Fragt mich nicht was das rofl da zu suchen hat...
You should give credits to whoever send you it. You know what I am talking bout that the epvp scrubs don't need to know.
AsuraDeveloper is offline  
Thanks
1 User
Old 07/27/2014, 18:39   #17
 
elite*gold: 0
Join Date: Jun 2013
Posts: 166
Received Thanks: 259
Quote:
Originally Posted by AsuraDeveloper View Post
You should give credits to whoever send you it. You know what I am talking bout that the epvp scrubs don't need to know.
'xcuse me, all credits to AsuraDeveloper, he's da real MVP.
WurstbrotQT is offline  
Thanks
2 Users
Old 07/27/2014, 18:58   #18
 
Wezzy_Dev's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 248
Received Thanks: 28
Where's the full source code of this sir?
Wezzy_Dev is offline  
Old 07/27/2014, 19:03   #19
 
Stagе6's Avatar
 
elite*gold: 307
Join Date: May 2012
Posts: 421
Received Thanks: 325
Quote:
Originally Posted by Wezzy_Dev View Post
Where's the full source code of this sir?
pa lang pinoy

Here is everything important:
Stagе6 is offline  
Thanks
1 User
Old 08/08/2014, 10:27   #20
 
Schulzie's Avatar
 
elite*gold: 317
Join Date: Jul 2013
Posts: 426
Received Thanks: 305
did the decryptor is no more working?
current client don't work...
Schulzie is offline  
Closed Thread


Similar Threads Similar Threads
Forsaken Chips (Forsaken Flyff )
06/12/2017 - Flyff Trading - 3 Replies
Hey verkaufe 1,2mio Fc´s auf dem Server Forsakenflyff Trade gerne über Middleman, sonst ihr first ! Nehme nur Psc Schreibt mir einfach ne Pm
[Selling] Forsaken Chips auf Forsaken Flyff
08/01/2014 - Flyff Trading - 10 Replies
Verkaufe Forsaken Chips und einen Platin 40 Arcanist Es sind noch über 600k Chips vorhanden. Nehme Paypal und Paysafe Cards
[Selling] Verkaufe Equip/Forsaken Chip![Forsaken Flyff]
07/02/2014 - Flyff Trading - 0 Replies
bl



All times are GMT +2. The time now is 17:35.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.