PSCode: Difference between revisions

From Vita Developer wiki
Jump to navigation Jump to search
(Initial page)
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Software]]<noinclude>[[Category:Main]]</noinclude>
[[Category:Software]]<noinclude>[[Category:Main]]</noinclude>


The PSCode is a 8 bytes code that contains console specific information like Region or Model Type.
The PSCode is a 8 bytes code that contains console specific information. It is derived from the [[ConsoleId]].
It is derived from the [[ConsoleId]].
 
Knowing PSCode we are able to deduce the 9 first Bytes of [[ConsoleId]].
Knowing PSCode we are able to deduce the 9 first bytes of [[ConsoleId]].
What information this stores is almost completely known (see [[ConsoleId#Structure]]).
 
See [[ConsoleId#Structure]]) and [[https://github.com/CelesteBlue-dev/PS-ConsoleId-wiki PSConsoleId-wiki]].


= Structure =
= Structure =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Chassis Revision
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&dArr;&nbsp;&nbsp;&dArr;&nbsp;&nbsp;                   
00000000  00 01 01 05 00 10 00 03
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&uArr;&nbsp;&uArr;&nbsp;&nbsp;&nbsp;&uArr;&nbsp;&uArr;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Target ID&nbsp;&nbsp;&nbsp;SKU Model
(Internal: Product Code)&nbsp;(Internal: Product Sub Code)


1st and 2nd bytes represent the Company Code


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Chassis Check&nbsp;&nbsp;
3th and 4th bytes represent the [[Product Code]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&dArr;&nbsp;&nbsp;                   
 
00000000  00 01 01 05 00 10 00 03
5th and 6th bytes represent the [[Product Sub Code]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&uArr;&nbsp;&uArr;&nbsp;&nbsp;&nbsp;&uArr;&nbsp;&uArr;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Target ID&nbsp;&nbsp;Vita Model Type
&nbsp;&nbsp;&nbsp;&nbsp;(Internal: Product Code)&nbsp;(Internal: Product Sub Code)


5th and 6th bytes represent the Target ID (region code) TODO:list PSVita target id
7th and 8th bytes represent the [[Factory Code]]


7th and 8th bytes represent the [[SKU_Models|Vita SKU Model]]
= Usage in the OS =


9th byte: chassis check
== PSVita ==


= Where is it used ? =
It is get in userland by _vshSblAimgrGetPscode, _vshSblAimgrGetPscode2, and used by sceRegMgrSrvCnvRegionPsCode.


It is get by GetPsCode or GetPsCode2.
It is get in kernel by sceSblAimgrGetPscodeForDriver, sceSblAimgrGetPscode2ForDriver, and used by sceRegMgrSrvCnvRegionPsCodeForDriver.


It is only used by non-secure kernel to determine the model of the device:
It is used by non-secure kernel and userland to determine the model of the device:
- IsCEX, IsDEX, IsTool, IsTest
- IsCEX, IsDEX, IsTool, IsTest
- IsVita, IsDolce, IsGenuineVita, IsGenuineDolce
- IsVita, IsDolce, IsGenuineVita, IsGenuineDolce


but also the region by the [[TargetId]] it embeds.
but also in userland to detect the region by the [[TargetId]] that it embeds.

Latest revision as of 04:17, 23 March 2020


The PSCode is a 8 bytes code that contains console specific information. It is derived from the ConsoleId.

Knowing PSCode we are able to deduce the 9 first bytes of ConsoleId.

See ConsoleId#Structure) and [PSConsoleId-wiki].

Structure[edit | edit source]

                            Chassis Revision
                             ⇓  ⇓                      
00000000  00 01 01 05 00 10 00 03
                 ⇑ ⇑   ⇑ ⇑
           Target ID   SKU Model
(Internal: Product Code) (Internal: Product Sub Code)

1st and 2nd bytes represent the Company Code

3th and 4th bytes represent the Product Code

5th and 6th bytes represent the Product Sub Code

7th and 8th bytes represent the Factory Code

Usage in the OS[edit | edit source]

PSVita[edit | edit source]

It is get in userland by _vshSblAimgrGetPscode, _vshSblAimgrGetPscode2, and used by sceRegMgrSrvCnvRegionPsCode.

It is get in kernel by sceSblAimgrGetPscodeForDriver, sceSblAimgrGetPscode2ForDriver, and used by sceRegMgrSrvCnvRegionPsCodeForDriver.

It is used by non-secure kernel and userland to determine the model of the device: - IsCEX, IsDEX, IsTool, IsTest - IsVita, IsDolce, IsGenuineVita, IsGenuineDolce

but also in userland to detect the region by the TargetId that it embeds.