Created
August 27, 2016 20:34
-
-
Save yifanlu/27f49196ec301596bbe661cadc189b69 to your computer and use it in GitHub Desktop.
ScePromoter usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "promoterutil.h" | |
int promote(const char *path) | |
{ | |
int res; | |
int ret; | |
int state; | |
ret = sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_PROMOTER_UTIL); | |
printf("sceSysmoduleLoadModuleInternal: 0x%x\n", ret); | |
if (ret < 0) | |
return ret; | |
ret = scePromoterUtilityInit(); | |
printf("scePromoterUtilityInit: 0x%x\n", ret); | |
if (ret < 0) | |
return ret; | |
// ret = scePromoterUtilityPromotePkgWithRif(path, 0); | |
ret = scePromoterUtilityPromotePkg(path, 0); | |
printf("scePromoterUtilityPromotePkg: 0x%x\n", ret); | |
if (ret < 0) | |
return ret; | |
state = 1; | |
do | |
{ | |
ret = scePromoterUtilityGetState(&state); | |
if (ret < 0) | |
{ | |
printf("scePromoterUtilityGetState error 0x%x\n", ret); | |
return ret; | |
} | |
printf("scePromoterUtilityGetState status 0x%x\n", ret); | |
sceKernelDelayThread(1000000); | |
} while (state); | |
ret = scePromoterUtilityGetResult(&res); | |
printf("scePromoterUtilityGetResult: ret=0x%x res=0x%x\n", ret, res); | |
if (ret < 0) | |
return ret; | |
ret = scePromoterUtilityExit(); | |
printf("scePromoterUtilityExit: 0x%x\n", ret); | |
if (ret < 0) | |
return ret; | |
ret = sceSysmoduleUnloadModuleInternal(SCE_SYSMODULE_PROMOTER_UTIL); | |
printf("sceSysmoduleUnloadModuleInternal: 0x%x\n", ret); | |
if (ret < 0) | |
return ret; | |
printf("res = 0x%x\n", res); | |
return res; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _PSP2_PROMOTERUTIL_H_ | |
#define _PSP2_PROMOTERUTIL_H_ | |
#include <psp2/types.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
typedef struct ScePromoterUtilityLAUpdate { | |
char titleid[12]; // target app | |
char path[128]; // directory of extracted LA update data | |
} ScePromoterUtilityLAUpdate; | |
int scePromoterUtilityInit(void); | |
int scePromoterUtilityExit(void); | |
int scePromoterUtilityDeletePkg(void *unk); | |
int scePromoterUtilityUpdateLiveArea(ScePromoterUtilityLAUpdate *args); | |
int scePromoterUtilityPromotePkg(char *path, int unk); | |
int scePromoterUtilityPromotePkgWithRif(const char *path, int unk); | |
int scePromoterUtilityGetState(int *state); | |
int scePromoterUtilityGetResult(int *res); | |
#ifdef __cplusplus | |
} | |
#endif | |
#endif /* _PSP2_PROMOTERUTIL_H_ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment