#if 0
	//Patches
	{
		uint8* data = m_module->GetContent();
		uint32 codeOffset =  m_module->GetProgram(0)->nOffset;

		*reinterpret_cast<uint32*>(data + 0x3CD708) = 0xFE707FDF;
		*reinterpret_cast<uint32*>(data + 0x3CD718) = 0xDB83A952;

		uint32 clearSize = (0x40 * 0x20) + 0x100;

		//Message Block
		for(unsigned int i = 0; i < (clearSize / 4); i++)
		{
			uint32 address = 0x359800 + (i * 4);
			*reinterpret_cast<uint32*>(data + codeOffset + address) = 0;
			uint32 relocationPos = FindRelocationAt(*m_module, address, 0);
			if(relocationPos != -1)
			{
				*reinterpret_cast<uint32*>(data + relocationPos) = 0;
			}
		}

		//Make Message
		{
			*reinterpret_cast<uint32*>(data + codeOffset + 0x359800) = 0xFFFF0000;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x359804) = 0xFFFF0001;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x359808) = 0x00000002;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35980C) = 0x00000000;

			*reinterpret_cast<uint32*>(data + codeOffset + 0x359810) = 0xFFFF0004;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x359814) = 0xFFFF0005;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x359818) = 0xFFFF0006;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35981C) = 0xFFFF0007;
		}

		//File Name
		{
			strcpy(reinterpret_cast<char*>(data + codeOffset + 0x35A0B0), "host0:/PSP_GAME/USRDIR/xa_SOUND.adx");
			strcpy(reinterpret_cast<char*>(data + codeOffset + 0x35A0E0), "MemoryBlock");
		}

		//Call Sound_Init
		*reinterpret_cast<uint32*>(data + codeOffset + 0x3594E0) = 0x0C0DFDB2;

		//Call Sound_SendMsg(0x369800)
		{
			uint32 relocationPos = FindRelocationAt(*m_module, 0x3594E8, 0);
			*reinterpret_cast<uint32*>(data + relocationPos) = 0x3594EC;

			*reinterpret_cast<uint32*>(data + codeOffset + 0x3594E8) = 0x3C040036;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x3594EC) = 0x0C0DFBDC;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x3594F0) = 0x24849800;
			*reinterpret_cast<uint32*>(data + codeOffset + 0x3594F4) = 0x00000000;

			*reinterpret_cast<uint32*>(data + 0x5DAB00) = 0x3594E8;
			*reinterpret_cast<uint8*> (data + 0x5DAB04) = CELF::R_MIPS_HI16;
			*reinterpret_cast<uint32*>(data + 0x5DAB08) = 0x3594F0;
			*reinterpret_cast<uint8*> (data + 0x5DAB0C) = CELF::R_MIPS_LO16;
		}

		//sceExitThread
		*reinterpret_cast<uint32*>(data + codeOffset + 0x3594FC) = 0x0C0F327F;

		//Call our custom music loader
		*reinterpret_cast<uint32*>(data + codeOffset + 0x3555F8) = 0x0C0D6800;

		//Force volume to 0x7F
		*reinterpret_cast<uint32*>(data + codeOffset + 0x35522C) = 0x2405007F;
		*reinterpret_cast<uint32*>(data + codeOffset + 0x35523C) = 0x2407007F;

		//Music loader
		{
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A000) = 0x27BDFFF0;		//ADDIU		SP, SP, 0xFFF0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A004) = 0xAFB00000;		//SW		S0, $0000(SP)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A008) = 0xAFBF0004;		//SW		S1, $0004(SP)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A00C) = 0xAFB10008;		//SW		S1, $0008(SP)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A010) = 0xAFB2000C;		//SW		S2, $000C(SP)

			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A014) = 0x00808021;		//ADDU		S0, A0, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A018) = 0x3C040036;		//LUI		A0, $namePtrHi
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A01C) = 0x2484A0B0;		//ADDIU		A0, A0, $namePtrLo
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A020) = 0x24050001;		//ADDIU		A1, R0, $1
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A024) = 0x0C0F31FB;		//JAL		sceIoOpen
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A028) = 0x24060000;		//ADDIU		A2, R0, $0

			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A02C) = 0x00408821;		//ADDU		S1, V0, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A030) = 0x00402021;		//ADDU		A0, V0, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A034) = 0x24060000;		//ADDIU		A2, R0, $0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A038) = 0x0C0F31FF;		//JAL		sceIoLseek
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A03C) = 0x24080002;		//ADDIU		T0, R0, $2

			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A040) = 0x00409021;		//ADDU		S2, V0, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A044) = 0x3C040036;		//LUI		A0, $namePtrHi
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A048) = 0x2484A0E0;		//ADDIU		A0, A0, $namePtrLo
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A04C) = 0x24050000;		//ADDIU		A1, R0, $0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A050) = 0x00403021;		//ADDU		A2, V0, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A054) = 0x0C0F3225;		//JAL		sceKernelAllocMemoryBlock
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A058) = 0x24070000;		//ADDIU		A3, R0, $0

			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A05C) = 0x00402021;		//ADDU		A0, V0, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A060) = 0x0C0F322D;		//JAL		sceKernelGetMemoryBlockAddr
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A064) = 0x26050018;		//ADDIU		A1, S0, 0x0018

			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A068) = 0x02202021;		//ADDU		A0, S1, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A06C) = 0x24060000;		//ADDIU		A2, R0, $0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A070) = 0x0C0F31FF;		//JAL		sceIoLseek
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A074) = 0x24080000;		//ADDIU		T0, R0, $0

			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A078) = 0x02202021;		//ADDU		A0, S1, R0
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A07C) = 0x8E050018;		//LW		A1, 0x0018(S0)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A080) = 0x0C0F31E5;		//JAL		sceIoRead
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A084) = 0x02403021;		//ADDU		A2, S2, R0

			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A088) = 0x24020003;		//ADDIU		V0, R0, $3
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A08C) = 0x8FBF0004;		//LW		RA, $0004(SP)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A090) = 0x8FB00000;		//LW		S0, $0000(SP)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A094) = 0x8FB10008;		//LW		S1, $0008(SP)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A098) = 0x8FB2000C;		//LW		S2, $000C(SP)
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A09C) = 0x03E00008;		//JR		RA
			*reinterpret_cast<uint32*>(data + codeOffset + 0x35A0A0) = 0x27BD0010;		//ADDIU		SP, SP, 0x0010

			*reinterpret_cast<uint32*>(data + 0x5DAB10) = 0x35A018;
			*reinterpret_cast<uint8*> (data + 0x5DAB14) = CELF::R_MIPS_HI16;
			*reinterpret_cast<uint32*>(data + 0x5DAB18) = 0x35A01C;
			*reinterpret_cast<uint8*> (data + 0x5DAB1C) = CELF::R_MIPS_LO16;

			{
				uint32 relocationPos = FindRelocationAt(*m_module, 0x37F648, 0);
				*reinterpret_cast<uint32*>(data + relocationPos) = 0x35A024;
			}
			{
				uint32 relocationPos = FindRelocationAt(*m_module, 0x37F650, 0);
				*reinterpret_cast<uint32*>(data + relocationPos) = 0x35A038;
			}

			*reinterpret_cast<uint32*>(data + 0x5DAC50) = 0x35A044;
			*reinterpret_cast<uint32*>(data + 0x5DAC54) = CELF::R_MIPS_HI16;
			*reinterpret_cast<uint32*>(data + 0x5DAC58) = 0x35A048;
			*reinterpret_cast<uint32*>(data + 0x5DAC5C) = CELF::R_MIPS_LO16;

			*reinterpret_cast<uint32*>(data + 0x5DAC48) = 0x35A054;
			*reinterpret_cast<uint32*>(data + 0x5DAC4C) = CELF::R_MIPS_26;

			*reinterpret_cast<uint32*>(data + 0x5DAC60) = 0x35A060;
			*reinterpret_cast<uint32*>(data + 0x5DAC64) = CELF::R_MIPS_26;

			*reinterpret_cast<uint32*>(data + 0x5DAC80) = 0x35A070;
			*reinterpret_cast<uint32*>(data + 0x5DAC84) = CELF::R_MIPS_26;

			{
				uint32 relocationPos = FindRelocationAt(*m_module, 0x37F6A0, 0);
				*reinterpret_cast<uint32*>(data + relocationPos) = 0x35A080;
			}

			//{
			//	uint32 relocationPos = FindRelocationAt(*m_module, 0x37F694, 0);
			//	*reinterpret_cast<uint32*>(data + relocationPos) = 0;
			//}

			//{
			//	uint32 relocationPos = FindRelocationAt(*m_module, 0x37F698, 0);
			//	*reinterpret_cast<uint32*>(data + relocationPos) = 0;
			//}

			//{
			//	uint32 relocationPos = FindRelocationAt(*m_module, 0x37F6A8, 0);
			//	*reinterpret_cast<uint32*>(data + relocationPos) = 0;
			//}

			//{
			//	uint32 relocationPos = FindRelocationAt(*m_module, 0x37F6B0, 0);
			//	*reinterpret_cast<uint32*>(data + relocationPos) = 0;
			//}
		}

		//Write patched executable
		{
			FILE* output = fopen("BOOT.BIN.PATCHED", "wb");
			fwrite(data, 1, fileSize, output);
			fclose(output);
		}
	}
#endif