vitasdk / vita-headers Goto Github PK
View Code? Open in Web Editor NEWDocumentation:
Home Page: https://docs.vitasdk.org
License: MIT License
Documentation:
Home Page: https://docs.vitasdk.org
License: MIT License
I am planning to write a game cheater for psvita, which can read/write process's memory. But how can I get the memory info about a process? Thanks
Currently project use 3 types licenses
so,
Copyright (C) 2016 vitasdk
or Copyright (C) 2015-2016 vitasdk
to all headers(but maybe late, already end of year..)Currently, C++ function names are put in their mangled form in db.yml
: 5ed41dd#diff-db62ffcced04f71944400ad9ae4310ceR3772
This is not ideal for several reasons:
db.yml
is potentially incompatible with other SDKs, and GCC updates.db.yml
is mostly manually maintained.This is something required for properly implementing #124 .
At the moment we have some headers that actually contain functions from several modules like:
psp2/videodec.h having sceAvcdec and sceVideodec functions.
psp2/net/http.h having sceHttp and sceHttps functions.
Actually splitting headers shouldn't bother too much since the suggested way to use headers is actually to just include vitasdk.h without cherry picking headers.
Example in display.h:
enum {
SCE_DISPLAY_SETBUF_IMMEDIATE = 0,
SCE_DISPLAY_SETBUF_NEXTFRAME = 1
};
should be replaced with
typedef enum SceDisplaySetBufSync {
SCE_DISPLAY_SETBUF_IMMEDIATE = 0,
SCE_DISPLAY_SETBUF_NEXTFRAME = 1
} SceDisplaySetBufSync;
It can then be referenced in the documentation as ::SceDisplaySetBufSync
.
#200 found these
psp2kern/bt.h: Could not find NID ksceBtPairingOOB
psp2kern/udcd.h: Could not find NID ksceUdcdGetDrvList
psp2kern/udcd.h: Could not find NID ksceUdcdWaitCancel
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelChangeCurrentThreadAttr
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelReleaseWaitThread
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetThreadId
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetThreadExitStatus
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelCheckThreadStack
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetThreadInfo
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetThreadRunStatus
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelWaitSemaCB
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelCancelSema
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetSemaInfo
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelOpenMutex
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelCloseMutex
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelLockMutexCB
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetMutexInfo
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetEventFlagInfo
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetCallbackInfo
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelCreateMsgPipe
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelDeleteMsgPipe
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelSendMsgPipe
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelSendMsgPipeCB
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelTrySendMsgPipe
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelReceiveMsgPipe
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelReceiveMsgPipeCB
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelTryReceiveMsgPipe
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelCancelMsgPipe
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetMsgPipeInfo
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelGetSystemInfo
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelCreateLwMutex
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelDeleteLwMutex
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelLockLwMutex
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelUnlockLwMutex
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelCreateLwCond
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelDeleteLwCond
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelSignalLwCond
psp2kern/kernel/threadmgr.h: Could not find NID ksceKernelWaitLwCond
psp2kern/io/fcntl.h: Could not find NID ksceIoOpenAsync
psp2kern/io/fcntl.h: Could not find NID ksceIoCloseAsync
psp2kern/io/fcntl.h: Could not find NID ksceIoPread
psp2kern/io/fcntl.h: Could not find NID ksceIoPwrite
psp2kern/io/fcntl.h: Could not find NID ksceIoLseekAsync
psp2kern/io/fcntl.h: Could not find NID ksceIoLseek32
psp2kern/io/fcntl.h: Could not find NID ksceIoLseek32Async
psp2kern/io/fcntl.h: Could not find NID ksceIoWaitAsync
psp2kern/io/fcntl.h: Could not find NID ksceIoWaitAsyncCB
psp2kern/io/fcntl.h: Could not find NID ksceIoPollAsync
psp2kern/io/fcntl.h: Could not find NID ksceIoGetAsyncStat
psp2kern/io/fcntl.h: Could not find NID ksceIoCancel
psp2kern/io/fcntl.h: Could not find NID ksceIoGetDevType
psp2kern/io/fcntl.h: Could not find NID ksceIoChangeAsyncPriority
psp2kern/io/fcntl.h: Could not find NID ksceIoSetAsyncCallback
psp2/gxm.h: Could not find NID sceGxmSetValidationEnable
psp2/gxm.h: Could not find NID sceGxmSetAuxiliarySurface
psp2/gxm.h: Could not find NID sceGxmPadTriggerGpuPaTrace
psp2/gxm.h: Could not find NID sceGxmShaderPatcherSetAuxiliarySurface
psp2/gxm.h: Could not find NID sceGxmTextureSetAnisoMode
psp2/gxm.h: Could not find NID sceGxmTextureGetAnisoMode
psp2/gxm.h: Could not find NID sceGxmPrecomputedFragmentStateSetAllAuxiliarySurfaces
psp2/gxm.h: Could not find NID sceGxmRenderTargetGetHostMem
psp2/gxt.h: Could not find NID sceGxtCheckData
psp2/gxt.h: Could not find NID sceGxtGetDataSize
psp2/gxt.h: Could not find NID sceGxtGetHeaderSize
psp2/gxt.h: Could not find NID sceGxtGetTextureCount
psp2/gxt.h: Could not find NID sceGxtSetPalette
psp2/vshbridge.h: Could not find NID sceIdStorageIsReadOnly
psp2/net/http.h: Could not find NID sceHttpSetProxy
psp2/net/http.h: Could not find NID sceHttpGetProxy
psp2/net/http.h: Could not find NID sceHttpEnableKeepAlive
psp2/net/http.h: Could not find NID sceHttpDisableKeepAlive
psp2/net/http.h: Could not find NID sceHttpEnableHttp0_9
psp2/net/http.h: Could not find NID sceHttpDisableHttp0_9
psp2/net/http.h: Could not find NID sceHttpSetResponseHeaderMaxSize
psp2/net/http.h: Could not find NID sceHttpSetRecvBlockSize
psp2/net/net.h: Could not find NID sceNetEmulationSet
psp2/net/net.h: Could not find NID sceNetEmulationGet
psp2/kernel/threadmgr.h: Could not find NID sceKernelReleaseWaitThread
psp2/io/devctl.h: Could not find NID sceIoIoctlAsync
psp2/io/fcntl.h: Could not find NID sceIoOpenAsync
psp2/io/fcntl.h: Could not find NID sceIoLseekAsync
psp2/io/fcntl.h: Could not find NID sceIoLseek32Async
psp2/io/fcntl.h: Could not find NID sceIoWaitAsync
psp2/io/fcntl.h: Could not find NID sceIoWaitAsyncCB
psp2/io/fcntl.h: Could not find NID sceIoPollAsync
psp2/io/fcntl.h: Could not find NID sceIoGetAsyncStat
psp2/io/fcntl.h: Could not find NID sceIoGetDevType
psp2/io/fcntl.h: Could not find NID sceIoChangeAsyncPriority
psp2/io/fcntl.h: Could not find NID sceIoSetAsyncCallback
an idea from @Princess-of-Sleeping
current db.yml is too big;
it exists multiple option
vita-headers/include/psp2/appmgr.h
Lines 322 to 332 in 54c6bea
See:
vita-headers/include/psp2kern/kernel/cpu.h
Lines 1 to 4 in e5521d4
The group should be added in: https://github.com/vitasdk/vita-headers/blob/e5521d49fefc0c226392efc4e41dae9cae85ed79/docs/definitions.dox
int scePowerRequestColdReset(void);
int scePowerRequestStandby(void);
int scePowerRequestSuspend(void);
https://forums.vitasdk.org/viewtopic.php?f=4&t=14
In the included databases, it seems like the module/library nids all have placeholder values. For extras, we should either come up with a NID generation system (ideally, reverse sony's linker and see how nids are generated), which is needed for vitasdk to support creating dynamic libraries or use hard coded values for now.
For the sony imports, the module nids never change, so we should keep them in the database. Library nids do change, so we can either remove that field from the specifications or mark it optional (and make it an array of "known nids" or something). The advantage for the second option is that it may be useful in the future.
we already suffered sdk break as multiple times. each time someone like me suggest versioning, then return history.
pros:
cons:
I don't know if this is possible but would like to have a way to open the quick menu without pressing or triggering the PS button.
The problem is that a lot of people (including me) have a frozen power button, the PS home button does not work either when the power button is stuck, so there is no way to open the quick menu.
I have also tried remapping the buttons in reVita, where the PS home button in combination hotkeys work too, but there is no option to open the quick menu with a hotkey (most probably because the sdk does not have a function for that yet), so again, simply holding the PS button to trigger the quick menu does not work.
On another note, a way to completely disable a button (power button in my case) would also be a sufficient workaround.
Currently, some function names are prefixed with a '_' or two. The exact meaning of this prefixing is still debated.
Since they only convey information that is useless for homebrew developers, should we delete them all?
From a homebrew developer point of view, adding an underscore to some functions but not to others is a annoyance.
In addition, the function names come from very different sources: it's currently inconsistent, and it would be very hard to fix the names to a chosen standard.
Do you agree with the suggestion of deleting all prefixed underscores from db.json
?
I have found scePowerSetArmClockFrequency in libScePower_stub.a, it looks like a function to set cpu clock, and other functions about bus clock, gpu clock. But I dont find those APIs in vita-headers.
Do they work on psvita? Why not add those APIs to vita-headers?
MajorTomSec already did this and would be nice if this could be added to the SDK.
https://github.com/MajorTomSec/VitaCID/tree/master/extra
Hey, it looks like the link on the homepage for the PS Vita dev wiki seems to be dead, as it moved to another domain without a redirect to the new one. Here's the new one: https://playstationdev.wiki/psvitadevwiki
I have a module, which I'm loading it with "ksceKernelLoadStartModule" and unloading with "ksceKernelStopUnloadModule", which are (kind of) equivalent to dlopen and dlclose linux functions. (yes, it's a kernel module)
How do I call a certain function from that module? e.g. int sum(int a, int b)
According to arm-vita-eabi-readelf my module exports the function in the symtable.
Is there some equivalent to dlsym?
Unless there's a way to add the kernel lib (skprx) in cmake so I don't have to Load/Unload modules manually?
Thanks
It doesn't do anything and will only confuse people.
The more I get into developing things on Vita, the more I notice how inconsistent the headers are between each other. For example, the constants in ctrl.h are named such as this: PSP2_CTRL_MODE_ANALOG and meanwhile in touch.h, constants are named with a SCE prefix instead of PSP2: SCE_TOUCH_SAMPLING_STATE_START
IMO it should be more consistent across the various headers, but I don't see how that can be done without creating compile errors on pretty much every homebrew / library out there.
So, what ( if anything ) could be done about this?
ForDriver
to ForKernel
sceSysmoduleLoadModule(SCE_SYSMODULE_NET);
I downloaded source code, but after running build.py appeared folders build/0.990/SceSysmem.yml without any files
Is it an error on code side?
- [ ] Write a JSON schema
Hi,
I installed vitasdk with vdpm on my linux machine and ran into the following error which is fixed by this pull request #339 .
Scanning dependencies of target kernel
[ 16%] Building C object CMakeFiles/kernel.dir/main.c.obj
In file included from /home/philipp/Projects/VitaShell/modules/kernel/main.c:21:0:
/home/philipp/Projects/vitasdk/arm-vita-eabi/include/psp2kern/kernel/sysmem.h:446:41: error: unknown type name 'kernel_message_ctx'
int ksceDebugPrintf2(int msg_type_flag, kernel_message_ctx *msg_ctx, const char *fmt, ...);
Could you add travis-ci checks to prevent merges of broken header files like this?
Hello,
With the current PS-Vita dev tools:
Is it possible to build a skprx module that can allocate memory for the running app, but with an arbitrary virtual address?
Like, when the app asks for memory, I'll give it starting from 0xA0000000 Virtual address onwards, using my own skprx module function.
If there is, which functions from the headers do I need to use?
I haven't found too much info about this specific topic, maybe you people could answer this,
Thanks in advance.
None for now (2022/05/01)
I write down here to remember them
when I use the old SceAppMgr library it's ok work fine but with the newest version I have this error:
undefined reference to `sceAppMgrLaunchAppByName2'
Maybe a fix ?
Noticed twice:
pss_app_exit_liveboard
and pss_errno_loc
have the same NID: 0x58ABAD62
scePafResourceGetAttributeIdInt
and scePafResourceGetAttributeIdIntLpb
have the same NID: 0xABFA169F
recently, C++ header has introduced by #455.
current script only can check that methods names start with sce
or ksce
.
we should update script to check c++ mangled method/variable names.
In db.json, sqlite3_temp_directory is exported as a function ( https://github.com/vitasdk/vita-headers/blob/master/db.json#L4116 ) even if it's in reality a variable ( https://www.sqlite.org/c3ref/temp_directory.html ) causing any attempt to access to such variable to end up with a system crash and a coredump.
Follow-up of #390.
Use this script: https://github.com/devnoname120/vitasdk-db-tools/blob/master/dbtools.py
Database: https://bin.shotatoshounenwachigau.moe/vdsuite/ghidra-loader-db.yml
I converted this database to a nids.txt
format for converting it more easily:
ghidra-loader-db.txt
cancel
SCE_CTRL_HEADPHONE , SCE_CTRL_VOLUP, SCE_CTRL_VOLDOWN, SCE_CTRL_POWER seems to not be interceptable by any usermode function. Not tested in kernel mode but it can be deleted from the psp2 part of the header files i assume.
https://github.com/vitasdk/vita-headers/blob/master/include/psp2/ctrl.h#L43
Testcase used:
https://pastebin.com/gKdFfP7J
Comparison:
JSON: https://gist.github.com/devnoname120/d5f71d70ae82414a051dc1ab698e8e9d
YAML: https://gist.github.com/devnoname120/ff2a08dbcfa0126d9099ce894f7fe783
The main advantages of YAML are its readability and native support for hexadecimal (which also means better syntax coloring).
Also, YAML supports commenting (with #
) whereas JSON doesn't.
Related: #83
I create a server on vita and a client on pc, why I break the connect, the send function still works and not throw error?
At the moment I am unable to read the documentation because the menu is hiding the text :(
https://i.imgur.com/yt89gWT.png
https://i.imgur.com/yQobr5O.png
For example, "psp2kern/kernel/sysmem.h" is written to link SceSysmemForDriver_stub, but ksceKernelRxMemcpyKernelToUserForPid or ksceKernelGetSysrootBuffer etc. throws an error as a function that is not defined even if SceSysmemForDriver_stub is linked.
So to avoid the error
sysmem_driver.h : SceSysmemForDriver
sysmem_kernel.h : SceSysmemForKernel
sysroot_driver.h : SceSysrootForDriver
sysroot_kernel.h : SceSysrootForKernel
Need to be like
split from #393
motivation:
we have/found multiple kernel hash functions, but some functions communicated via encdec_w_portability_sm.self
, another cases didn't.
original kernel nids are these 3 cases
NP means no portability
so that would change to WithoutPortability
to match WithPortability
(but if we can write header definitions, it doesn't need. we can explain that meaning in document)
so we need to choose one(or two) of options;
WithPortability
(or replace something)WithoutPortability
instead NP/WithKeygen
ref: https://wiki.henkaku.xyz/vita/SceSblSsMgr
PS. please don't talk about ForDriver
, ForKernel
postfix anymore. we don't accept that since 2016 (#99) .
As imported from https://wiki.henkaku.xyz/vita/SceSysmem in commit f9c34e2:
Both sceKernelCreateUidObjForDriver
and sceKernelCreateUidObjForKernel
are renamed to functions with same name: ksceKernelCreateUidObj
It makes new compiled taiHEN kernel plugin not working properly due to linking ksceKernelCreateUidObj
to sceKernelCreateUidObjForDriver
instead of sceKernelCreateUidObjForKernel
Although the temproary resolution is that put SceSysmemForKernel_stub before SceSysmemForDriver_stub in target_link_libraries, it is better to avoid duplicate function names in SDK libs.
working with HTTP had some issues, so started looking into it...
I found out SSL need to be initialised (and I found lib but no .h file)
when I include .h with this 2 functions it worked
Reference: http://www.smartpsp.net/doxygen-doc-en/html/pspssl_8h.html
int sceSslInit(int poolSize);
int sceSslTerm(void);
as I opened lib with hex there is lot more functions but I needed only this ones
so if someone can look into it and make proper .h file
\usage{psp2kern/net/net.h,-lSceNet_stub}
should be replaced with:
\usage{psp2kern/net/net.h, libSceNet_stub.a}
Some tutorial regarding those should be added too.
SceKernelThreadmgr export
kernel
//174: ksceKernelGetMutexInfo 0x69b78a12 @OFF: 0xe819 VADDR: 0x8100e819
user
//393: SceThreadmgr_69B78A12 0x69b78a12 @OFF: 0x2d6fd VADDR: 0x8102d6fd
Example:
https://docs.vitasdk.org/group__SceSystemParamUser.html
The SCE_SYSTEM_PARAM_LANG
enumeration only has a 3 members in the documentation when it should have a lot more.
These symbols are imported by default
https://github.com/vitasdk/vita-headers/blob/master/db.json#L1742-L1764
when using newlib you get
/home/travis/vitasdk/bin/../lib/gcc/arm-vita-eabi/6.2.0/libgcc.a(_udivsi3.o): In function
__aeabi_uidiv':
(.text+0x0): multiple definition of __aeabi_uidiv' /home/travis/vitasdk/arm-vita-eabi/lib/libSceSysmem_stub.a(SceSysmem_SceSysclibForDriver___aeabi_uidiv.o):(.vitalink.fstubs+0x0): first defined here collect2: error: ld returned 1 exit status
If SceSysmem is removed from libspec it is partially fixed because if you use dynarec you need to import SceSysmem getting the same error.
I think the solution could be to split SceSysmen in SceSysmen, SceSysmemForDriver, SceSysmenForKernel
What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.