Skip to content

Instantly share code, notes, and snippets.

@psxdev
Created October 22, 2022 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psxdev/1890b084465db150e27b60465117770c to your computer and use it in GitHub Desktop.
Save psxdev/1890b084465db150e27b60465117770c to your computer and use it in GitHub Desktop.
Simple code example using prosperodev sdk
Compiler vanilla llvm clang
clang -v
clang version 16.0.0 (https://github.com/llvm/llvm-project 1ae405144d62299d87096de4dc2596a04a4fee84)
Target: x86_64-sie-ps5
Thread model: posix
InstalledDir: /usr/local/prosperodev/bin
Linker vanilla llvm lld
prospero-lld -v
LLD 16.0.0 (compatible with GNU linkers)
Sample code
/*
# ____ ____ ____ ___ ____ ____ ____ ____ ____ ____ _ _
# ____| ____> | | | ____| <____ ____> | | | <____ \ /
# | | \ |____| ___| | <____ | \ |____| ____| <____ \_/
#
# PROSPERODEV Open Source Project.
#------------------------------------------------------------------------------------
# Copyright 2010-2022, prosperodev - http://github.com/prosperodev
# Licenced under MIT License
# Review README & LICENSE files for further details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#include <stdbool.h>
#include <prosperodev.h>
#include <debugnet.h>
dlsym_t *prosperoDlsym;
int initApp()
{
libkernel_sys_init();
libSceLibcInternal_init();
libSceNet_init();
libSceSysmodule_init();
debugNetInit("192.168.1.12",18194,3);
return 0;
}
void finishApp()
{
debugNetFinish();
}
int payload_main(struct payload_args *args)
{
if(args==NULL)
{
return -1;
}
prosperoDlsym=args->dlsym;
initApp();
/*int ret=getpid();
debugNetPrintf(DEBUGNET_INFO,"[%s] getpid return %d\n",__FUNCTION__,ret);
*(args->payloadout)=ret;*/
int ret;
int i;
debugNetPrintf(DEBUGNET_INFO,"PROSPERODEV sdk sample\n");
debugNetPrintf(DEBUGNET_INFO,"Modules loaded inside WebKit environment\n");
for(i=0;i<=0x7c;i++)
{
SceKernelModuleInfo tmpInfo;
//Important put the struct size :P
tmpInfo.size=352;
ret=sceKernelGetModuleInfo(i,&tmpInfo);
if(ret)
{
//debugNetPrintf(DEBUGNET_ERROR,"[%s][%d] error 0x%08X\n",__FUNCTION__,__LINE__,ret);
//goto finish;
}
else
{
debugNetPrintf(DEBUGNET_INFO,"Module %s is loaded with handle 0x%08X\n",tmpInfo.name,i);
}
}
finish:
finishApp();
return 0;
}
The output on macos:
[HOST] debugnet listener up
[HOST] ready to have a lot of fun!!!
[PROSPERO][INFO]: debugnet initialized
[PROSPERO][INFO]: Copyright (C) 2010,2022 Antonio Jose Ramos Marquez aka bigboss @psxdev
[PROSPERO][INFO]: ready to have a lot of fun...
[PROSPERO][INFO]: PROSPERODEV sdk sample
[PROSPERO][INFO]: Modules loaded inside WebKit environment
[PROSPERO][INFO]: Module NKWebProcess.self is loaded with handle 0x00000000
[PROSPERO][INFO]: Module libSceLibcInternal.sprx is loaded with handle 0x00000002
[PROSPERO][INFO]: Module libSceSysmodule.sprx is loaded with handle 0x00000010
[PROSPERO][INFO]: Module libScePosixForWebKit.sprx is loaded with handle 0x00000012
[PROSPERO][INFO]: Module libSceIpmi.sprx is loaded with handle 0x00000013
[PROSPERO][INFO]: Module libSceMediaFrameworkInterface.sprx is loaded with handle 0x00000014
[PROSPERO][INFO]: Module libSceSysCore.sprx is loaded with handle 0x00000053
[PROSPERO][INFO]: Module libSceNet.sprx is loaded with handle 0x00000054
[PROSPERO][INFO]: Module libSceNetCtl.sprx is loaded with handle 0x00000063
[PROSPERO][INFO]: Module libSceRandom.sprx is loaded with handle 0x00000065
[PROSPERO][INFO]: Module libSceLibreSsl3.sprx is loaded with handle 0x00000066
[PROSPERO][INFO]: Module libSceRegMgr.sprx is loaded with handle 0x00000067
[PROSPERO][INFO]: Module libSceSystemService.sprx is loaded with handle 0x00000068
[PROSPERO][INFO]: Module libSceCompositeExt.sprx is loaded with handle 0x0000006F
[PROSPERO][INFO]: Module libSceMbus.sprx is loaded with handle 0x00000070
[PROSPERO][INFO]: Module libSceAvSetting.sprx is loaded with handle 0x00000071
[PROSPERO][INFO]: Module libSceVideoOut.sprx is loaded with handle 0x00000072
[PROSPERO][INFO]: Module libSceGLSlimClientVSH.sprx is loaded with handle 0x00000073
[PROSPERO][INFO]: Module libicu.sprx is loaded with handle 0x00000074
[PROSPERO][INFO]: Module libpng16.sprx is loaded with handle 0x00000075
[PROSPERO][INFO]: Module libharfbuzz.sprx is loaded with handle 0x00000076
[PROSPERO][INFO]: Module libfreetype.sprx is loaded with handle 0x00000077
[PROSPERO][INFO]: Module libfontconfig.sprx is loaded with handle 0x00000078
[PROSPERO][INFO]: Module libcairo.sprx is loaded with handle 0x00000079
[PROSPERO][INFO]: Module libSceNKWebKitRequirements.sprx is loaded with handle 0x0000007A
[PROSPERO][INFO]: Module libSceNKWebKit.sprx is loaded with handle 0x0000007C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment