Example #1
0
s32 main(s32 argc, const char* argv[])
{
    if(peekq(0x80000000007EF220ULL)==0x45737477616C6420ULL && is_payload_loaded()) {

        sys8_path_table(0LL); // break libfs.sprx re-direction

        if(restore_syscall8[0]) sys8_pokeinstr(restore_syscall8[0], restore_syscall8[1]);
    }

    if(argc>0 && argv) {
    
        if(!strncmp(argv[0], "/dev_hdd0/game/", 15)) {
            int n;

            strcpy(self_path, argv[0]);

            n= 15; while(self_path[n] != '/' && self_path[n] != 0) n++;

            if(self_path[n] == '/') {
                self_path[n] = 0;
            }
        }
    }

    strcat(self_path, "/USRDIR/iris_manager.self");

    sysProcessExitSpawn2(self_path, NULL, NULL, NULL, 0, 1001, SYS_PROCESS_SPAWN_STACK_SIZE_1M);
}
Example #2
0
s32 main(s32 argc, const char* argv[])
{
	PadInfo padinfo;
	PadData paddata;
	int i;
	
	atexit(unload_modules);

	if(SysLoadModule(SYSMODULE_FS)!=0) return 0; else module_flag |=1;

	if(SysLoadModule(SYSMODULE_PNGDEC)!=0) return 0; else module_flag |=2;
	//if(SysLoadModule(SYSMODULE_NET)!=0) return 0; else module_flag |=3;
	//net_initialize_network();
	init_screen();
	ioPadInit(7);
	//init_pggl();
	int pressed = 0;
	// Ok, everything is setup. Now for the main loop.
	while(1){
		// Check the pads.
		ioPadGetInfo(&padinfo);
		for(i=0; i<MAX_PADS; i++){
			if(padinfo.status[i]){
				ioPadGetData(i, &paddata);
				
				if(paddata.BTN_TRIANGLE){
					if(!pressed){
						pressed = 1;
						//tcp_test();
						httpGet("174.121.34.92", "nzhawk.co.cc", "/vers.txt");
					}
				} else if(paddata.BTN_CIRCLE){
					//httpGet("174.121.34.92");
				} else if(paddata.BTN_CROSS){
					sysProcessExitSpawn2("/dev_hdd0/ps3load.self", 0, 0, NULL, 0, 1001, SYS_PROCESS_SPAWN_STACK_SIZE_1M);
				} else {
					pressed = 0;
				}
			}
			
		}
		waitFlip(); // Wait for the last flip to finish, so we can draw to the old buffer
		setBackColour(buffer[currentBuffer], 0xFFFFFFFF);  // setBuffer to white
		/* PGGL Demo */
		//drawInt(frame, 0, res.height - 80);
		//draw("PSL1GHT GRAPHICAL\n GAME L1BRARY", (res.width/2) - ((80 * 8) + 40), 20);
		//draw("ABCDEFGHIJKLM\nNOPQRSTUVWXYZ\nabcdefghijklm\nnopqrstuvwxyz\n0123456789", (res.width/2) - ((80 * 6) + 40), 500);
		/*			 */
		flip(currentBuffer); // Flip buffer onto screen
		currentBuffer = !currentBuffer;
		if(frame < 1000000)
			frame++;
		else
			frame = 0;
	}
	return 0;
}
Example #3
0
int main() {
	sysUtilRegisterCallback(SYSUTIL_EVENT_SLOT0, sysutil_callback, NULL);

	void *host_addr = memalign(1024*1024, HOST_SIZE);
	init_screen(host_addr, HOST_SIZE);

	setRenderTarget(curr_fb);

	int payload = payload_status();
	/*
	char dlgmsg[256];
	sprintf(dlgmsg, "Payload: %d", payload);
	showDialog(dlgmsg);
	*/
	if(payload == ZERO_PAYLOAD) {
		s32 fd = 0;
		int bdemu = bdemu_version(&fd);

		if(bdemu == 0) {
			//Wrong or inexistent file.
			lv2buzzer(0x1004, 0xa, 0x1b6);
			showDialog("Couldn't find correct \"BDEMU.BIN\".");
		}
		else {
			int fw_version = get_version();

			if(fw_version == FW_355_VALUE) {
				if(bdemu == 2) {
					payload_sky(fd);
				}
				else {
					payload_dean(fd);
				}
			}
			else if(fw_version == FW_341_VALUE && bdemu == 2) {
				payload_hermes(fd);
			}
			else {
				lv2buzzer(0x1004, 0xa, 0x1b6);
				showDialog("BDEMU.BIN doesn't suppoort your firmware.");
			}
		}
	}

	msgDialogAbort();

	gcmSetWaitFlip(context);
	rsxFinish(context, 1);

	//Launch Application on exit.
	sysProcessExitSpawn2(APP_LAUNCH, NULL, NULL, NULL, 0, 1001, SYS_PROCESS_SPAWN_STACK_SIZE_1M);

	return 0;
}
Example #4
0
// =============================================
// MAIN MODULE
// =============================================
int main(int argc, const char* argv[])
{
	int i;
	int r				= -1;
	//int count			= 0;
	int nTry			= 0;	
	char* cur_device	= NULL;
	char path[1024]		= { 0 };
	memset(&path, 0, sizeof(path));
	FILE* fp_isolist	= NULL;

	fp_isolist = fopen(SISOPATH"/iso_list.txt", "w"); // always overwrite with clean list...

	cur_device = (char*)malloc(strlen("/ntfs0:")+1);
	memset(cur_device, 0, strlen("/ntfs0:")+1);

	// Try to mount devices ...
	while(nTry < 1000)
	{
		//count = 0;

		// __io_ntfs_usb000 ... __io_ntfs_usb007		
				
		for(i = 0; i < 8 ; i++) 
		{
			int rr = NTFS_Event_Mount(i);

			if(rr == 1) 
			{ 
				// mount device            
				NTFS_UnMount(i);

				mounts[i] = NULL;
				mountCount[i] = 0;

				mountCount[i] = ntfsMountDevice (disc_ntfs[i], &mounts[i], NTFS_DEFAULT | NTFS_RECOVER);
            
				if(mountCount[i] > 0) {
					//count = 1;
				} // update counter
			} 
			else if(rr == -1) 
			{ 
				// unmount device
				NTFS_UnMount(i);
				//count = 1;
			}
		}

		r = -1;		

		r = NTFS_Test_Device("ntfs0");
		if(r >= 0) { strcpy(cur_device, (char*)"/ntfs0:"); break; }

		r = NTFS_Test_Device("ntfs1");
		if(r >= 0) { strcpy(cur_device, (char*)"/ntfs1:"); break; }
		
		r = NTFS_Test_Device("ntfs2");
		if(r >= 0) { strcpy(cur_device, (char*)"/ntfs2:"); break; }
		
		r = NTFS_Test_Device("ntfs3");
		if(r >= 0) { strcpy(cur_device, (char*)"/ntfs3:"); break; }
		
		nTry++;
	}

	if(r>=0 && cur_device) 
	{
		sprintf(path, "%s/PS3ISO"	, cur_device);
		generate_list(fp_isolist, path, 0);

		sprintf(path, "%s/PSXISO"	, cur_device);
		generate_list(fp_isolist, path, 0);

		sprintf(path, "%s/BDISO"	, cur_device);
		generate_list(fp_isolist, path, 0);

		sprintf(path, "%s/DVDISO"	, cur_device);
		generate_list(fp_isolist, path, 0);
	}

	if(fp_isolist) { fclose(fp_isolist); *&fp_isolist = NULL; }

	NTFS_UnMountAll();

	// This flag will let "Simple NTFS ISO Mounter" that this was already launched,
	// allowing it to continue booting normally...

	FILE* fp = fopen(SISOPATH"/isolist_finished", "w");
	if(fp) { fclose(fp); *&fp = NULL; }

	sysProcessExitSpawn2( SISOPATH"/RELOAD.SELF", NULL, NULL, NULL, 0, 1001, SYS_PROCESS_SPAWN_STACK_SIZE_1M );	

	return 0;
}