//functions for manipulating the HBC stub by giantpune #include #include #include #include #include "lstub.h" #include "stub_bin.h" #define TITLE_1(x) ((u8)((x) >> 8)) #define TITLE_2(x) ((u8)((x) >> 16)) #define TITLE_3(x) ((u8)((x) >> 24)) #define TITLE_4(x) ((u8)((x) >> 32)) #define TITLE_5(x) ((u8)((x) >> 40)) #define TITLE_6(x) ((u8)((x) >> 48)) #define TITLE_7(x) ((u8)((x) >> 56)) #define TITLE_ID(x,y) (((u64)(x) << 32) | (y)) s32 Set_Stub(u64 reqID) { u32 tmdsize; u64 tid = 0; u64 *list; u32 titlecount; s32 ret; u32 i; ret = ES_GetNumTitles(&titlecount); if (ret < 0) return WII_EINTERNAL; list = memalign(32, titlecount * sizeof(u64) + 32); ret = ES_GetTitles(list, titlecount); if (ret < 0) { free(list); return WII_EINTERNAL; } for (i=0; i