Skip to content

Instantly share code, notes, and snippets.

@Informhunter
Last active June 5, 2025 18:29
Show Gist options
  • Select an option

  • Save Informhunter/c5c00fb08a6c14dc4279 to your computer and use it in GitHub Desktop.

Select an option

Save Informhunter/c5c00fb08a6c14dc4279 to your computer and use it in GitHub Desktop.
eTest test file decryptor
//Binary Win32 + source = https://www.dropbox.com/sh/4zp5okf5c1o6zyq/AAA1AJ-9t4vFuocoRCCGq_7Ia
#include <stdio.h>
#include <malloc.h>
#include <string.h>
char* TS1_KEY = "PoLiK";
char* TS2_KEY = "dfafFDSAFffdf342fd";
char* TS3_KEY = "jfkbFDSFDSdsf32cxc";
void decryptData(char* data, int size, char* key)
{
int i;
int keylen;
char mask;
keylen = strlen(key);
for(i = 0; i < size; i++)
{
mask = ((i % 0x400) % 0x28 + key[i % keylen]) % 0xFF;
data[i] ^= mask;
}
}
int main(int argc, char const **argv)
{
FILE* f1;
FILE* f2;
char magic[5];
char* key;
int fileSize;
char* buffer;
if(argc < 3)
{
printf("Usage: %s infile outfile\n", argv[0]);
return 0;
}
f1 = fopen(argv[1], "rb");
if(!f1)
{
printf("Can't find file %s\n", argv[1]);
return 1;
}
f2 = fopen(argv[2], "wb");
if(!f2)
{
printf("Can't open file %s for writing!\n", argv[2]);
fclose(f1);
return 1;
}
fseek(f1, 0, SEEK_END);
fileSize = ftell(f1);
fseek(f1, 0, SEEK_SET);
fread(magic, 1, 5, f1);
if(!strncmp(magic, "[TS1]", 5))
{
key = TS1_KEY;
}
else if(!strncmp(magic, "[TS2]", 5))
{
key = TS2_KEY;
}
else if(!strncmp(magic, "[TS3]", 5))
{
key = TS3_KEY;
}
else
{
fclose(f1);
fclose(f2);
printf("Can't find Magic!\n");
return 1;
}
buffer = (char*)malloc(fileSize);
fread(buffer, 1, fileSize - 5, f1);
fclose(f1);
decryptData(buffer, fileSize - 5, key);
fwrite(buffer, 1, fileSize - 5, f2);
fclose(f2);
free(buffer);
printf("Decrypted successfully!\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment