Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
131
GameTools/Z3SCrypt/Z3SCrypt.cpp
Normal file
131
GameTools/Z3SCrypt/Z3SCrypt.cpp
Normal file
@@ -0,0 +1,131 @@
|
||||
// Z3SCrypt.cpp : <20>ܼ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1><D7B7><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <Windows.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
char * enckey = "cjsgkdmlTlqkfshaemfdmlwktlsdjqtsmsgkfn";
|
||||
|
||||
void Encrypt(char * filein, char * fileout)
|
||||
{
|
||||
// ó<><C3B3> 256<35><36><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD>
|
||||
ifstream in (filein, ios::in|ios::binary);
|
||||
|
||||
DeleteFileA(fileout);
|
||||
|
||||
ofstream out (fileout, ios::out|ios::app|ios::binary);
|
||||
|
||||
|
||||
if ( (in.is_open()) && (out.is_open()) ){
|
||||
char a;
|
||||
int counter = 0;
|
||||
|
||||
for(int i = 0; i < 256; ++i)
|
||||
{
|
||||
in.get(a);
|
||||
out.put(a);
|
||||
}
|
||||
|
||||
while (in.get(a))
|
||||
{
|
||||
if (counter == ((sizeof(enckey) / sizeof(char)) - 1))
|
||||
{
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
a = ((a ^ enckey[counter]) + counter);
|
||||
out.put(a);
|
||||
counter++;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Could not open input or output file.");
|
||||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
printf("Done.\n");
|
||||
system("pause");
|
||||
}
|
||||
|
||||
void Decrypt(char * filein, char * fileout)
|
||||
{
|
||||
// ó<><C3B3> 256<35><36><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD>
|
||||
ifstream in (filein, ios::in|ios::binary);
|
||||
|
||||
DeleteFileA(fileout);
|
||||
|
||||
ofstream out (fileout, ios::out|ios::app|ios::binary);
|
||||
|
||||
if ( (in.is_open()) && (out.is_open()) )
|
||||
{
|
||||
char a;
|
||||
int counter = 0;
|
||||
|
||||
for(int i = 0; i < 256; ++i)
|
||||
{
|
||||
in.get(a);
|
||||
out.put(a);
|
||||
}
|
||||
|
||||
while (in.get(a))
|
||||
{
|
||||
if (counter == ((sizeof(enckey) / sizeof(char)) - 1))
|
||||
{
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
a = ((a - counter) ^ enckey[counter]);
|
||||
out.put(a);
|
||||
counter++;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Could not open input or output file.");
|
||||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
printf("Done.\n");
|
||||
system("pause");
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
printf("ROW Z3S Crypt v1.0\n\n");
|
||||
|
||||
if(argc < 4)
|
||||
{
|
||||
printf("z3scrypt.exe cryptname inputfile outputfile\n\n");
|
||||
printf("ex) z3scrypt.exe encrypt zone1.z3s zone1.cry\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(_stricmp(argv[1], "encrypt") == 0)
|
||||
{
|
||||
Encrypt(argv[2], argv[3]);
|
||||
}
|
||||
else if(_stricmp(argv[1], "decrypt") == 0)
|
||||
{
|
||||
Decrypt(argv[2], argv[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("No such option.\n\n");
|
||||
}
|
||||
|
||||
printf("done.\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user