Post: help needed for VSH Notification - SPRX
03-30-2016, 10:17 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So, i did a lot of searching on how to make the notification work with my sprx. Unfortunately i couldn't make it work.
here's what i did:

    #include <cellstatus.h>
#include <sys/prx.h>
#include <sys/ppu_thread.h>

#include <stdio.h>
#include <string.h>
#include <sys/timer.h>

SYS_MODULE_INFO( test, 0, 1, 1 );
SYS_MODULE_START( _test_prx_entry );

int( *showNotification )( int, const char * ) = NULL;

void sleep( usecond_t time )
{
sys_timer_usleep( time * 1000 );
}

void * getNIDfunc( const char * vsh_module, uint32_t fnid )
{
uint32_t table = ( *( uint32_t *)0x1008C ) + 0x984;

while( ( ( uint32_t ) *( uint32_t *) table ) != 0 )
{
uint32_t* export_stru_ptr = ( uint32_t *)*( uint32_t *) table;
const char* lib_name_ptr = ( const char *) *(uint32_t *)( ( char * ) export_stru_ptr + 0x10 );
if( strncmp( vsh_module, lib_name_ptr, strlen( lib_name_ptr ) ) == 0 )
{
uint32_t lib_fnid_ptr = *( uint32_t *)( ( char *)export_stru_ptr + 0x14 );
uint32_t lib_func_ptr = *( uint32_t *)( ( char *)export_stru_ptr + 0x18 );
uint16_t count = * (uint16_t *)( ( char *)export_stru_ptr + 6 );

for( int i = 0; i < count; i++ )
{
if( fnid == *( uint32_t *)( ( char *)lib_fnid_ptr + i * 4 ) )
{
return ( void *&Winky Winky *( ( uint32_t *)( lib_func_ptr ) + i );
}
}
}
table = table + 4;
}
return 0;
}

void myThread( uint64_t nothing )
{
sleep( 100 );
showNotification( 0, "Hello World!" );
sys_ppu_thread_exit( nothing );
}

extern "C" int _test_prx_entry( void )
{
( void*& )( showNotification ) = ( void* )( ( int )getNIDfunc( "vshtask", 0xA02D46E7 ) );

sys_ppu_thread_t ThreadID;
sys_ppu_thread_create( &ThreadID, myThread, 0, 10, 0x10, 0, "notification test" );
return SYS_PRX_RESIDENT;
}


and my AdditionalDependencies:

    libsn.a;libm.a;libio_stub.a;libfs_stub.a;libc.a;libsysmodule_stub.a;libsysutil_stub.a;libsysutil_rec_stub.a


The build was done! But after launch the game the console freeze. Thanks in advance.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo