// locFile.cpp : Defines the entry point for the console application.
// locFile module for Audition
// Author: Nguyen Truong Tho. Email:
thont@live.com
// Explaination:
// Each byte in this file is crypted by xoring with 0x64
// To see that, set break point at where Kernel.ReadFile is called,
// then Set hardware break point at any byte in file buffer.
// F9 and u will catch the ecrypt function
// Welcome new moderator for Audition forum ^_^
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
FILE *fi = fopen(argv[0], "rb");
FILE *fo = fopen(argv[1], "wb");
// Read the file size
fseek(fi, 0, SEEK_END);
long fiSize = ftell(fi);
fseek(fi, 0, SEEK_SET);
// Other way: long fiSize = filelength(fileno(fi));
char buff[fiSize];
fread(buff, 1, fiSize, fi);
// decrypt
for (int i = 0; i < fiSize; i++) *(buff + i) ^= 0x64;
fwrite(buff, fiSize, 1, fo);
// free the memory
delete [] buff;
fclose(fi);
fclose(fo);
return 0;
}