#include <stdio.h>
#include <string.h>

unsigned short offsets[] =
{
	0xAF5,
	0xB19,
	0xB58,
	0xB7C,
	0xBB8,
	0XBDC,
	0
};

int main(int argc, char **argv)
{
	FILE *f;
	unsigned char val = 0x90;
	unsigned short *o;

	f = fopen("ezquake-security.so", "r+");
	if (f)
	{
		o = offsets;
		while(*o)
		{
			if (fseek(f, *o, SEEK_SET) == 0)
			{
				if (fwrite(&val, 1, 1, f) == 1 && fwrite(&val, 1, 1, f) == 1)
				{
					printf("Successfully updated file!\n");
				}
				else
					printf("Unable to write new path\n");
			}
			else
				printf("Unable to seek to the correct position in the file\n");

			o++;
		}

		fclose(f);
	}
	else
		printf("Unable to open \"ezquake-security.so\"\n");

	return 0;
}

