Advertising (This ad goes away for registered users. You can Login or Register)

hbl hook.c : Hook sceAudioOutput2GetRestSample

This is the development forum of the half-byte loader project. For general Half Byte Loader questions, visit the Half Byte Loader forum.
Forum rules
This forum is for HBL Development discussions ONLY. For User support or HBL general discussions, go to viewforum.php?f=3 . Messages that are not development related will be deleted.
Locked
wth
HBL Developer
Posts: 834
Joined: Wed Aug 31, 2011 4:44 pm
Contact:

hbl hook.c : Hook sceAudioOutput2GetRestSample

Post by wth »

Hi,

currently adapting hbl to run on my 6.60 user exploit, it already loads a few homebrews pretty nicely (should work on vita too since vita apparently emulates 6.60, gonna try tomorrow hopefully)
but I still have some missing syscalls (since syscall estimation doesn't work on 6.60), like sceAudioOutput2GetRestSample which I need to hook somehow to avoid crashes

So I was wondering, anyone knows how to hook sceAudioOutput2GetRestSample using sceAudioGetChannelRestLength ? Is such a hook even possible ?

Edit:
Well apparently it must be possible, since there are only 8 channels I guess we'd just have to use sceAudioGetChannelRestLength on each one and return the sum of them all (assuming sceAudioOutput2GetRestSample returns the number of unplayed samples remaining on ALL channels). Gonna try this.
Edit2:
thx to biscottealacrevette for this link, but it still doesn't look so easy to hook properly, since we have no access to the SceAudio g_audio global in hbl <.<
Advertising
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: hbl hook.c : Hook sceAudioOutput2GetRestSample

Post by m0skit0 »

That code looks like a kernel module (correct me if I'm wrong), so doesn't access to g_audio need kernel privileges?
Advertising
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
wth
HBL Developer
Posts: 834
Joined: Wed Aug 31, 2011 4:44 pm
Contact:

Re: hbl hook.c : Hook sceAudioOutput2GetRestSample

Post by wth »

m0skit0 wrote:That code looks like a kernel module (correct me if I'm wrong), so doesn't access to g_audio need kernel privileges?
Hm indeed I didn't even think of that
Well I guess it will stay a dirty hook then ^^'


// sceAudioOutput2GetRestSample lame hook (hopefully it's not super necessary)
int _hook_sceAudioOutput2GetRestSample()
{
int sum = 0, i, res;

for (i=0;i<PSP_AUDIO_CHANNEL_MAX;++i)
{
res = sceAudioGetChannelRestLength(i);
if (res >=0) sum+= res;
}


return sum;
}
Locked

Return to “Half Byte Loader Development”