devicesal
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devicesal [2009/05/07 10:00] – Add info on known unknowns marcus | devicesal [2024/05/20 20:15] (current) – nopsled | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | < | ||
+ | DeviceSal Dict 000 (EKB) -> (status): Verify EKB file. For version 1, check SHA-1 of first 176 bytes. | ||
+ | DeviceSal Dict 001 | ||
+ | DeviceSal Dict 002 | ||
+ | DeviceSal Dict 003 | ||
+ | DeviceSal Dict 159(0x9f) (EKB) -> (status): Verify EKB file with version > 1. Checks ECC signature, returns 0 if OK, otherwise an error code. | ||
+ | DeviceSal Dict 160(0xa0) | ||
+ | DeviceSal Dict 165(0xa5) | ||
+ | DeviceSal Dict 170(0xaa) | ||
+ | DeviceSal Dict 171(0xab) | ||
+ | DeviceSal Dict 172(0xac): Dispatch table for D171. | ||
+ | DeviceSal Dict 173(0xad) | ||
+ | DeviceSal Dict 174(0xae) | ||
+ | DeviceSal Dict 175(0xaf) | ||
+ | DeviceSal Dict 177(0xb1) | ||
+ | DeviceSal Dict 178(0xb2): Dispatch table for D177. | ||
+ | DeviceSal Dict 180(0xb4) (a,b,c) -> (1): Returns 1. | ||
+ | DeviceSal Dict 181(0xb5) (deskey, | ||
+ | DeviceSal Dict 182(0xb6) | ||
+ | DeviceSal Dict 183(0xb7) | ||
+ | DeviceSal Dict 184(0xb8 (msg, | ||
+ | DeviceSal Dict 185(0xb9) (cipher, | ||
+ | DeviceSal Dict 186(0xba) (plain, | ||
+ | DeviceSal Dict 187(0xbb) | ||
+ | DeviceSal Dict 189(0xbd) (key,value) -> (): Use D191 as a map and enter (key, value) into it. | ||
+ | DeviceSal Dict 190(0xbe) (key, | ||
+ | DeviceSal Dict 191(0xbf): Variable to pass mapping to helper functions. | ||
+ | DeviceSal Dict 193(0xc1) | ||
+ | DeviceSal Dict 194(0xc2) | ||
+ | DeviceSal Dict 195(0xc3) | ||
+ | DeviceSal Dict 196(0xc4) | ||
+ | DeviceSal Dict 197(0xc5): Dispatch table for 196. | ||
+ | DeviceSal Dict 198(0xc6): (Decrypto with hook D249, reencrypt with DES-OCM) | ||
+ | DeviceSal Dict 199(0xc7) | ||
+ | DeviceSal Dict 207(0xcf) (encobj, objkey) -> (...): DES-OCM-Decrypt encobj with objkey and unpack an ASN.1 encoded array (stripping off the length parameter) | ||
+ | DeviceSal Dict 208(0xd0) (o1, o2, objkey) -> (encobj): DES-OCM-Encrypt an ASN.1 encoded array containing the first 8 bytes of o1 and o2 each. | ||
+ | DeviceSal Dict 209(0xd1) (version) -> (ekbpath): Return the local EKB path. | ||
+ | DeviceSal Dict 210(0xd2) () -> (1): Produce 1. | ||
+ | DeviceSal Dict 211(0xd3) | ||
+ | DeviceSal Dict 212(0xd4) | ||
+ | DeviceSal Dict 213(0xd5) | ||
+ | DeviceSal Dict 214(0xd6) (encobj, protokey) -> (obj): Descramble cipher and OCM-Decrypt with SHA-1(protokey) and ASN.1-decode the result. | ||
+ | DeviceSal Dict 215(0xd7) (obj, protokey) -> (encobj): OCM-Encrypt the serialized obj with SHA-1(protokey) and scramble the result. | ||
+ | DeviceSal Dict 216(0xd8) (encobj, xorprotokey) -> (obj): DES-OCM-Decrypt with SHA-1(xorprotokey XOR D252++D252) and ASN.1-decode the result. | ||
+ | DeviceSal Dict 217(0xd9) (obj, xorprotokey) -> (encobj): DES-OCM-Encrypt the serialized obj with SHA-1(xorprotokey XOR D252++D252). | ||
+ | DeviceSal Dict 220(0xdc) (cipher, key) -> (plain): Decrypt with some weird SHA-1 based stream cipher. | ||
+ | DeviceSal Dict 221(0xdd) (plain, key) -> (cipher): Encrypt with some weird SHA-1 based stream cipher. | ||
+ | </ | ||
+ | |||
Missing Info: | Missing Info: | ||
+ | |||
+ | |||
+ | |||
< | < | ||
+ | |||
Dict 0xfc - contains an unknown 8 byte key, used in dev_0xd8, dev_0xd9. | Dict 0xfc - contains an unknown 8 byte key, used in dev_0xd8, dev_0xd9. | ||
+ | |||
</ | </ | ||
Line 155: | Line 209: | ||
</ | </ | ||
+ | NOT part of device.sal, but for lack of a better place, here an example of SsaTrans on updater.ocm: | ||
+ | < | ||
+ | $ SsaTrans updater.ocm | ||
+ | BCSeedRand63 (1, " | ||
+ | BCSetCryptTable (" | ||
+ | v_39 = BCNewBlob (8); | ||
+ | v_41 = BCDES_SetKey (" | ||
+ | arg_0 = Unknown | ||
+ | v_43 = BCDES_CBC BCDDecrypt (arg_0, v_39, v_41, " | ||
+ | v_44 = BCBlobLength (v_43); | ||
+ | v_46 = BCBlobLength ("< | ||
+ | v_49 = BCSubBlob (v_43, v_44 - v_46, -1); | ||
+ | v_51 = BCCompareBlob (v_49, "< | ||
+ | if (v_51 == 0) [1 -> 1] | ||
+ | { | ||
+ | return [v_43, 1]; | ||
+ | } | ||
+ | else [1 -> 1] | ||
+ | { | ||
+ | return [0]; | ||
+ | } | ||
+ | v_56 = BCIfElse (v_43); | ||
+ | v_57 = BCSerialize (v_56); | ||
+ | return v_57; | ||
+ | </ |
devicesal.1241690410.txt.gz · Last modified: 2009/05/07 10:00 by marcus