summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/kernel/kernel/modulemgr.h105
-rw-r--r--include/user/ctrl.h1
-rw-r--r--include/user/incoming_dialog.h8
-rw-r--r--include/user/jpegarm.h103
-rw-r--r--include/user/kernel/modulemgr.h49
-rw-r--r--include/user/notification_util.h2
-rw-r--r--nids/360/SceIncomingDialog.yml4
-rw-r--r--nids/360/SceJpegArm.yml13
-rw-r--r--nids/360/SceKernelModulemgr.yml6
9 files changed, 213 insertions, 78 deletions
diff --git a/include/kernel/kernel/modulemgr.h b/include/kernel/kernel/modulemgr.h
index d3de54d..c8e115c 100644
--- a/include/kernel/kernel/modulemgr.h
+++ b/include/kernel/kernel/modulemgr.h
@@ -21,38 +21,39 @@ extern "C" {
#define SCE_KERNEL_STOP_CANCEL SCE_KERNEL_STOP_FAIL
/** @} */
-typedef char SceKernelModuleName[0x1C];
+typedef struct SceKernelModuleName {
+ char s[0x1C];
+} SceKernelModuleName;
-typedef struct
-{
- SceUInt size; //!< this structure size (0x18)
+typedef struct SceKernelSegmentInfo {
+ SceSize size; //!< this structure size (0x18)
SceUInt perms; //!< probably rwx in low bits
void *vaddr; //!< address in memory
- SceUInt memsz; //!< size in memory
- SceUInt flags; //!< meaning unknown
- SceUInt res; //!< unused?
+ SceSize memsz; //!< size in memory
+ SceSize filesz; //!< original size of memsz
+ SceUInt res; //!< unused
} SceKernelSegmentInfo;
-typedef struct
-{
- SceUInt size; //!< 0x1B8 for Vita 1.x
- SceUInt handle; //!< kernel module handle?
- SceUInt flags; //!< some bits. could be priority or whatnot
+typedef struct SceKernelModuleInfo {
+ SceSize size; //!< 0x1B8 for Vita 1.x
+ SceUID modid;
+ uint16_t modattr;
+ uint8_t modver[2];
char module_name[28];
SceUInt unk28;
- void *module_start;
- void *module_stop;
- void *module_exit;
- void *exidxTop;
- void *exidxBtm;
- SceUInt unk40;
- SceUInt unk44;
+ void *start_entry;
+ void *stop_entry;
+ void *exit_entry;
+ void *exidx_top;
+ void *exidx_btm;
+ void *extab_top;
+ void *extab_btm;
void *tlsInit;
SceSize tlsInitSize;
SceSize tlsAreaSize;
char path[256];
SceKernelSegmentInfo segments[4];
- SceUInt type; //!< 6 = user-mode PRX?
+ SceUInt type; //!< 6 = user-mode PRX?
} SceKernelModuleInfo;
typedef struct {
@@ -114,20 +115,19 @@ typedef struct {
};
} SceKernelModuleListInfo;
-typedef struct {
- SceSize size; //!< sizeof(SceKernelModuleInfo2) : 0x120
- SceUID modid1;
- uint32_t unk_0x08;
- uint16_t unk_0x0C;
- uint16_t unk_0x0E;
- uint16_t unk_0x10;
- uint16_t unk_0x12;
+typedef struct SceKernelModuleLibraryInfo {
+ SceSize size; //!< sizeof(SceKernelModuleLibraryInfo) : 0x120
+ SceUID libid;
+ uint32_t libnid;
+ uint16_t libver[2];
+ uint16_t entry_num_function;
+ uint16_t entry_num_variable;
uint16_t unk_0x14;
uint16_t unk_0x16;
- char module_name[0x100]; // offset : 0x18
+ char library_name[0x100]; // offset : 0x18
uint32_t unk_0x118;
SceUID modid2;
-} SceKernelModuleInfo2;
+} SceKernelModuleLibraryInfo;
/**
* @brief Register syscall function
@@ -203,17 +203,6 @@ int sceKernelGetModuleList2(SceUID pid, SceKernelModuleListInfo *infolists, size
int sceKernelGetModuleInfo(SceUID pid, SceUID modid, SceKernelModuleInfo *info);
/**
- * @brief Get module info2
- *
- * @param[in] pid - target pid
- * @param[in] modid - target module id
- * @param[out] info - info output
- *
- * @return 0 on success, < 0 on error.
- */
-int sceKernelGetModuleInfo2(SceUID pid, SceUID modid, SceKernelModuleInfo2 *info);
-
-/**
* @brief Get module info mini by module address
*
* @param[in] pid - target pid
@@ -480,7 +469,7 @@ int sceKernelUmountBootfs(void);
SceUID sceKernelGetProcessMainModule(SceUID pid);
/**
- * @brief Get the main module path for a given process.
+ * @brief Get the module path
*
* @param[in] pid - target pid
* @param[out] path - module path output
@@ -488,9 +477,37 @@ SceUID sceKernelGetProcessMainModule(SceUID pid);
*
* @return 0 on success, < 0 on error.
*/
-int sceKernelGetProcessMainModulePath(SceUID pid, char *path, int pathlen);
+int sceKernelGetModulePath(SceUID modid, char *path, int pathlen);
+
+/**
+ * @brief Get library info
+ *
+ * @param[in] pid - target pid
+ * @param[in] modid - target library id
+ * @param[out] info - info output
+ *
+ * @return 0 on success, < 0 on error.
+ */
+int sceKernelGetModuleLibraryInfo(SceUID pid, SceUID libid, SceKernelModuleLibraryInfo *info);
+
+typedef struct SceKernelModuleExportEntry {
+ uint32_t libnid;
+ const void *entry; // function ptr. or vars?
+} SceKernelModuleExportEntry;
+
+/**
+ * @brief Get module export entry
+ *
+ * @param[in] pid - target pid
+ * @param[in] libid - target library uid
+ * @param[out] list - data output
+ * @param[inout] num - in:list max num, out:get entry num
+ * @param[in] cpy_skip_num - The index at which to start copying
+ *
+ * @return 0 on success, < 0 on error.
+ */
+int sceKernelGetModuleLibExportList(SceUID pid, SceUID libid, SceKernelModuleExportEntry *list, SceSize *num, SceSize cpy_skip_num);
-int sceKernelGetModuleLibraryInfo(SceUID pid, SceUID modid, void *unk1, const void *unk2, int unk3);
int sceKernelGetModuleUid(SceUID pid, SceUID modid, SceUID *modid_out, const void *unk1, int unk2);
int sceKernelGetModuleUidList(SceUID pid, SceUID *modids, size_t *num);
diff --git a/include/user/ctrl.h b/include/user/ctrl.h
index ab6bc7e..4758f6c 100644
--- a/include/user/ctrl.h
+++ b/include/user/ctrl.h
@@ -20,6 +20,7 @@ typedef enum SceCtrlErrorCode {
/** Enumeration for the digital controller buttons.
* @note - L1/R1/L3/R3 only can bind using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
* @note - Values bigger than 0x00010000 can be intercepted only with shell privileges
+ * @note - Vita's L Trigger and R Trigger are mapped to L1 and R1 when using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
*/
typedef enum SceCtrlButtons {
SCE_CTRL_SELECT = 0x00000001, //!< Select button.
diff --git a/include/user/incoming_dialog.h b/include/user/incoming_dialog.h
index c110cf0..616b89e 100644
--- a/include/user/incoming_dialog.h
+++ b/include/user/incoming_dialog.h
@@ -25,7 +25,7 @@ typedef enum SceIncomingDialogStatus {
/**
* Errors
*/
-#define SCE_INCOMINGDIALOG_ERROR_INVALID_ARG 0x80106202;
+#define SCE_INCOMING_DIALOG_ERROR_INVALID_ARG 0x80106202;
typedef struct SceIncomingDialogParam {
SceInt32 sdkVersion;
@@ -42,7 +42,7 @@ typedef struct SceIncomingDialogParam {
/**
* Initialize incoming dialog library, initType must be 0.
*/
-SceInt32 sceIncomingDialogInitialize(int initType);
+SceInt32 sceIncomingDialogInit(int initType);
/**
* Open incoming dialog.
@@ -65,9 +65,9 @@ SceInt32 sceIncomingDialogSwitchToDialog(void);
SceInt32 sceIncomingDialogClose(void);
/**
- * Finalize incoming dialog library
+ * Terminate incoming dialog library
*/
-SceInt32 sceIncomingDialogFinalize(void);
+SceInt32 sceIncomingDialogTerm(void);
static inline
void sceIncomingDialogParamInit(SceIncomingDialogParam* dialogParam)
diff --git a/include/user/jpegarm.h b/include/user/jpegarm.h
new file mode 100644
index 0000000..6a5f5c7
--- /dev/null
+++ b/include/user/jpegarm.h
@@ -0,0 +1,103 @@
+#ifndef _DOLCESDK_PSP2_JPEGARM_H_
+#define _DOLCESDK_PSP2_JPEGARM_H_
+
+#include <psp2/types.h>
+#include <psp2/jpeg.h>
+
+#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
+extern "C" {
+#endif
+
+/* Error codes */
+#define SCE_JPEG_ARM_OK (SCE_JPEG_OK)
+
+#define SCE_JPEG_ARM_ERROR_IMAGE_EMPTY (SCE_JPEG_ERROR_IMAGE_EMPTY | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_MARKER_LENGTH (SCE_JPEG_ERROR_BAD_MARKER_LENGTH | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DHT_COUNTS (SCE_JPEG_ERROR_BAD_DHT_COUNTS | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DHT_INDEX (SCE_JPEG_ERROR_BAD_DHT_INDEX | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DQT_INDEX (SCE_JPEG_ERROR_BAD_DQT_INDEX | 0x100)
+#define SCE_JPEG_ARM_ERROR_DECODE_ERROR (SCE_JPEG_ERROR_DECODE_ERROR | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_POINTER (SCE_JPEG_ERROR_INVALID_POINTER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_COMPONENT_ID (SCE_JPEG_ERROR_BAD_COMPONENT_ID | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_COLORSPACE (SCE_JPEG_ERROR_UNSUPPORT_COLORSPACE | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_MCU_SIZE (SCE_JPEG_ERROR_BAD_MCU_SIZE | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_PRECISION (SCE_JPEG_ERROR_BAD_PRECISION | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_SAMPLING (SCE_JPEG_ERROR_UNSUPPORT_SAMPLING | 0x100)
+#define SCE_JPEG_ARM_ERROR_COMPONENT_COUNT (SCE_JPEG_ERROR_COMPONENT_COUNT | 0x100)
+#define SCE_JPEG_ARM_ERROR_EOI_EXPECTED (SCE_JPEG_ERROR_EOI_EXPECTED | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_IMAGE_SIZE (SCE_JPEG_ERROR_UNSUPPORT_IMAGE_SIZE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_HUFF_TABLE (SCE_JPEG_ERROR_NO_HUFF_TABLE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_QUANT_TABLE (SCE_JPEG_ERROR_NO_QUANT_TABLE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_SOI (SCE_JPEG_ERROR_NO_SOI | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DHT_MARKER (SCE_JPEG_ERROR_BAD_DHT_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_DRI_MARKER (SCE_JPEG_ERROR_BAD_DRI_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_SOF_MARKER (SCE_JPEG_ERROR_BAD_SOF_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_SOS_MARKER (SCE_JPEG_ERROR_BAD_SOS_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_SOF_DUPLICATE (SCE_JPEG_ERROR_SOF_DUPLICATE | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_LOSSLESS_SUPPORT (SCE_JPEG_ERROR_NO_LOSSLESS_SUPPORT | 0x100)
+#define SCE_JPEG_ARM_ERROR_NO_ARITH_SUPPORT (SCE_JPEG_ERROR_NO_ARITH_SUPPORT | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNKNOWN_MARKER (SCE_JPEG_ERROR_UNKNOWN_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_RESTART_MARKER (SCE_JPEG_ERROR_BAD_RESTART_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_UNEXPECTED_MARKER (SCE_JPEG_ERROR_UNEXPECTED_MARKER | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_REGION (SCE_JPEG_ERROR_INVALID_REGION | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_STATE (SCE_JPEG_ERROR_INVALID_STATE | 0x100)
+#define SCE_JPEG_ARM_ERROR_CANNOT_CONTINUE (SCE_JPEG_ERROR_CANNOT_CONTINUE | 0x100)
+#define SCE_JPEG_ARM_ERROR_MEMORY_SIZE (SCE_JPEG_ERROR_MEMORY_SIZE | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_COLOR_FORMAT (SCE_JPEG_ERROR_INVALID_COLOR_FORMAT | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_DECODE_MODE (SCE_JPEG_ERROR_INVALID_DECODE_MODE | 0x100)
+#define SCE_JPEG_ARM_ERROR_BAD_PROGRESSIVE_PARAM (SCE_JPEG_ERROR_BAD_PROGRESSIVE_PARAM | 0x100)
+#define SCE_JPEG_ARM_ERROR_INIT_DONE (SCE_JPEG_ERROR_INIT_DONE | 0x100)
+#define SCE_JPEG_ARM_ERROR_INPUT_SUSPENDED (SCE_JPEG_ERROR_INPUT_SUSPENDED | 0x100)
+#define SCE_JPEG_ARM_ERROR_INPUT_DATA_TOO_BIG (SCE_JPEG_ERROR_INPUT_DATA_TOO_BIG | 0x100)
+#define SCE_JPEG_ARM_ERROR_INVALID_DATA_SIZE (SCE_JPEG_ERROR_INVALID_DATA_SIZE | 0x100)
+
+/* for backward compatibility */
+#define SCE_JPEG_ARM_ERROR_UNSUPPORT_DOWNSCALE (SCE_JPEG_ARM_ERROR_INVALID_DECODE_MODE)
+#define SCE_JPEG_ARM_ERROR_OUT_OF_MEMORY (SCE_JPEG_ARM_ERROR_MEMORY_SIZE)
+
+/* Decode JPEG data to RGBA format */
+int sceJpegArmDecodeMJpeg(
+ const unsigned char *pJpeg,
+ SceSize isize,
+ void *pRGBA,
+ SceSize osize,
+ int decodeMode,
+ void *pCoefBuffer,
+ SceSize coefBufferSize);
+
+/* Decode JPEG data (no color conversion) */
+int sceJpegArmDecodeMJpegYCbCr(
+ const unsigned char *pJpeg,
+ SceSize isize,
+ unsigned char *pYCbCr,
+ SceSize osize,
+ int decodeMode,
+ void *pCoefBuffer,
+ SceSize coefBufferSize);
+
+/* tempBufferSize is always 0, even when using colour space conversion */
+typedef SceJpegOutputInfo SceJpegArmOutputInfo;
+
+/* Return color space and each buffer sizes required when decoding a JPEG image */
+int sceJpegArmGetOutputInfo(
+ const unsigned char *pJpeg,
+ SceSize isize,
+ int outputFormat,
+ int decodeMode,
+ SceJpegArmOutputInfo *pOutputInfo);
+
+/* Split decoder (control struct is different from sceJpeg, no reference anywhere in the apps)
+ * These functions cannot be used at the moment.
+ */
+
+int sceJpegArmCreateSplitDecoder(void *pCtrl);
+int sceJpegArmDeleteSplitDecoder(void *pCtrl);
+
+int sceJpegArmSplitDecodeMJpeg(void *pCtrl);
+
+#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
+}
+#endif
+
+#endif /* _DOLCESDK_PSP2_JPEGARM_H_ */
+
diff --git a/include/user/kernel/modulemgr.h b/include/user/kernel/modulemgr.h
index a8d44f6..3aa6f30 100644
--- a/include/user/kernel/modulemgr.h
+++ b/include/user/kernel/modulemgr.h
@@ -22,33 +22,34 @@ extern "C" {
/** @} */
typedef struct SceKernelSegmentInfo {
- SceUInt size; //!< sizeof(SceKernelSegmentInfo)
- SceUInt perms; //!< probably rwx in low bits
- void *vaddr; //!< address in memory
- SceUInt memsz; //!< size in memory
- SceUInt flags; //!< meaning unknown
- SceUInt res; //!< unused?
+ SceSize size; //!< this structure size (0x18)
+ SceUInt perms; //!< probably rwx in low bits
+ void *vaddr; //!< address in memory
+ SceSize memsz; //!< size in memory
+ SceSize filesz; //!< original size of memsz
+ SceUInt res; //!< unused
} SceKernelSegmentInfo;
typedef struct SceKernelModuleInfo {
- SceUInt size; //!< 0x1B8 for Vita 1.x
- SceUInt handle; //!< kernel module handle?
- SceUInt flags; //!< some bits. could be priority or whatnot
- char module_name[28];
- SceUInt unk28;
- void *module_start;
- void *module_stop;
- void *module_exit;
- void *exidxTop;
- void *exidxBtm;
- SceUInt unk40;
- SceUInt unk44;
- void *tlsInit;
- SceSize tlsInitSize;
- SceSize tlsAreaSize;
- char path[256];
- SceKernelSegmentInfo segments[4];
- SceUInt type; //!< 6 = user-mode PRX?
+ SceSize size; //!< 0x1B8 for Vita 1.x
+ SceUID modid;
+ uint16_t modattr;
+ uint8_t modver[2];
+ char module_name[28];
+ SceUInt unk28;
+ void *start_entry;
+ void *stop_entry;
+ void *exit_entry;
+ void *exidx_top;
+ void *exidx_btm;
+ void *extab_top;
+ void *extab_btm;
+ void *tlsInit;
+ SceSize tlsInitSize;
+ SceSize tlsAreaSize;
+ char path[256];
+ SceKernelSegmentInfo segments[4];
+ SceUInt type; //!< 6 = user-mode PRX?
} SceKernelModuleInfo;
typedef struct SceKernelLMOption {
diff --git a/include/user/notification_util.h b/include/user/notification_util.h
index e9a5298..4aa362a 100644
--- a/include/user/notification_util.h
+++ b/include/user/notification_util.h
@@ -10,7 +10,7 @@ extern "C" {
/**
* Errors
*/
-#define SCE_NOTIFICATIONUTIL_ERROR_INTERNAL 0x80106301
+#define SCE_NOTIFICATION_UTIL_ERROR_INTERNAL 0x80106301
/**
* BGDL-type notification event handler function
diff --git a/nids/360/SceIncomingDialog.yml b/nids/360/SceIncomingDialog.yml
index 01ba346..7b50553 100644
--- a/nids/360/SceIncomingDialog.yml
+++ b/nids/360/SceIncomingDialog.yml
@@ -6,8 +6,8 @@ modules:
nid: 0x5058F4AB
functions:
sceIncomingDialogClose: 0x126BD15E
- sceIncomingDialogFinalize: 0x860B1885
sceIncomingDialogGetStatus: 0x839DE14C
- sceIncomingDialogInitialize: 0x18AF99EB
+ sceIncomingDialogInit: 0x18AF99EB
sceIncomingDialogOpen: 0x2BEDC1A0
sceIncomingDialogSwitchToDialog: 0x0123B83A
+ sceIncomingDialogTerm: 0x860B1885
diff --git a/nids/360/SceJpegArm.yml b/nids/360/SceJpegArm.yml
new file mode 100644
index 0000000..235f5c4
--- /dev/null
+++ b/nids/360/SceJpegArm.yml
@@ -0,0 +1,13 @@
+modules:
+ SceJpegArm:
+ nid: 0xC3ACF942
+ libraries:
+ SceJpegArm:
+ nid: 0x19F04693
+ functions:
+ sceJpegArmCreateSplitDecoder: 0x9DA48DB6
+ sceJpegArmDecodeMJpeg: 0xA4ABFCE3
+ sceJpegArmDecodeMJpegYCbCr: 0xE9B1B86F
+ sceJpegArmDeleteSplitDecoder: 0xE9CB3DFD
+ sceJpegArmGetOutputInfo: 0x23AE3BEA
+ sceJpegArmSplitDecodeMJpeg: 0x5D83C606
diff --git a/nids/360/SceKernelModulemgr.yml b/nids/360/SceKernelModulemgr.yml
index 1f1cb61..058cd5e 100644
--- a/nids/360/SceKernelModulemgr.yml
+++ b/nids/360/SceKernelModulemgr.yml
@@ -53,16 +53,16 @@ modules:
sceKernelFinalizeKbl: 0xFDD7F646
sceKernelGetModuleIdByAddr: 0x0053BA4A
sceKernelGetModuleInfo: 0xD269F915
- sceKernelGetModuleInfo2: 0x6A655255
sceKernelGetModuleInfoMinByAddr: 0x8309E043
sceKernelGetModuleInternal: 0xFE303863
- sceKernelGetModuleLibraryInfo: 0xD4BF409C
+ sceKernelGetModuleLibExportList: 0xD4BF409C
+ sceKernelGetModuleLibraryInfo: 0x6A655255
sceKernelGetModuleList: 0x97CF7B4E
sceKernelGetModuleList2: 0x410E1D2E
+ sceKernelGetModulePath: 0x779A1025
sceKernelGetModuleUid: 0x3B93CF88
sceKernelGetModuleUidList: 0x1FDEAE16
sceKernelGetProcessMainModule: 0x20A27FA9
- sceKernelGetProcessMainModulePath: 0x779A1025
sceKernelLoadModuleForPid: 0xFA21D8CB
sceKernelLoadPreloadingModules: 0x3AD26B43
sceKernelLoadProcessImage: 0xAC4EABDB