mirror of
https://github.com/naehrwert/scetool.git
synced 2025-04-25 06:07:47 +00:00
Updated to v.0.2.14
- Added PS3 Linux support. - Fixed ECDSA checking.
This commit is contained in:
parent
3aec982aa5
commit
5a46f2f1b3
3 changed files with 36 additions and 4 deletions
|
@ -85,6 +85,9 @@ OPTIONS Possible Values Explanation
|
||||||
-j, --np-add-sig TRUE/FALSE(default) Whether to add a NP sig. or not.
|
-j, --np-add-sig TRUE/FALSE(default) Whether to add a NP sig. or not.
|
||||||
|
|
||||||
==> History <==
|
==> History <==
|
||||||
|
Version 0.2.14
|
||||||
|
- Added PS3 Linux support.
|
||||||
|
- Fixed ECDSA checking.
|
||||||
Version 0.2.13
|
Version 0.2.13
|
||||||
- Unlocked decryption for self files with network license type.
|
- Unlocked decryption for self files with network license type.
|
||||||
- Fixed one minor bug with capability flags.
|
- Fixed one minor bug with capability flags.
|
||||||
|
|
19
src/sce.cpp
19
src/sce.cpp
|
@ -119,6 +119,9 @@ void _print_sce_signature(FILE *fp, signature_t *sig)
|
||||||
void _print_sce_signature_status(FILE *fp, sce_buffer_ctxt_t *ctxt, u8 *keyset)
|
void _print_sce_signature_status(FILE *fp, sce_buffer_ctxt_t *ctxt, u8 *keyset)
|
||||||
{
|
{
|
||||||
u8 hash[0x14];
|
u8 hash[0x14];
|
||||||
|
u8 Q[0x28];
|
||||||
|
u8 M[0x14];
|
||||||
|
u8 zero_buf[0x14];
|
||||||
keyset_t *ks;
|
keyset_t *ks;
|
||||||
|
|
||||||
//Check if a keyset is provided.
|
//Check if a keyset is provided.
|
||||||
|
@ -134,10 +137,24 @@ void _print_sce_signature_status(FILE *fp, sce_buffer_ctxt_t *ctxt, u8 *keyset)
|
||||||
}
|
}
|
||||||
//Generate header hash.
|
//Generate header hash.
|
||||||
sha1(ctxt->scebuffer, _ES64(ctxt->metah->sig_input_length), hash);
|
sha1(ctxt->scebuffer, _ES64(ctxt->metah->sig_input_length), hash);
|
||||||
|
_hexdump(fp, " E", 0, hash, 0x14, FALSE);
|
||||||
|
|
||||||
//Validate the signature.
|
|
||||||
ecdsa_set_curve(ks->ctype);
|
ecdsa_set_curve(ks->ctype);
|
||||||
ecdsa_set_pub(ks->pub);
|
ecdsa_set_pub(ks->pub);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PRIVATE_BUILD
|
||||||
|
//validate private key and calculate M
|
||||||
|
ec_priv_to_pub(ks->priv, Q);
|
||||||
|
get_m(ctxt->sig->r, ctxt->sig->s, hash, ks->priv, M);
|
||||||
|
if (memcmp(ks->pub, Q, sizeof(Q)) == 0)
|
||||||
|
_hexdump (fp, " M", 0, M, 0x14, FALSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//Validate the signature.
|
||||||
|
memset(zero_buf, 0, sizeof(zero_buf));
|
||||||
|
if ((memcmp(ctxt->sig->r, zero_buf, sizeof(zero_buf)) == 0) || (memcmp(ctxt->sig->s, zero_buf, sizeof(zero_buf)) == 0))
|
||||||
|
fprintf(fp, "[*] Signature status: FAIL\n");
|
||||||
|
else
|
||||||
fprintf(fp, "[*] Signature status: %s\n", (ecdsa_verify(hash, ctxt->sig->r, ctxt->sig->s) == TRUE ? "OK" : "FAIL"));
|
fprintf(fp, "[*] Signature status: %s\n", (ecdsa_verify(hash, ctxt->sig->r, ctxt->sig->s) == TRUE ? "OK" : "FAIL"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
src/types.h
12
src/types.h
|
@ -39,6 +39,10 @@ typedef unsigned long long int u64;
|
||||||
((u16)(((((u16)val) & 0xff00) >> 8) | \
|
((u16)(((((u16)val) & 0xff00) >> 8) | \
|
||||||
((((u16)val) & 0x00ff) << 8)))
|
((((u16)val) & 0x00ff) << 8)))
|
||||||
|
|
||||||
|
#ifdef __BIG_ENDIAN__
|
||||||
|
#define _ES16(val) val
|
||||||
|
#endif
|
||||||
|
|
||||||
//Endian swap for u32.
|
//Endian swap for u32.
|
||||||
#define _ES32(val) \
|
#define _ES32(val) \
|
||||||
((u32)(((((u32)val) & 0xff000000) >> 24) | \
|
((u32)(((((u32)val) & 0xff000000) >> 24) | \
|
||||||
|
@ -46,6 +50,10 @@ typedef unsigned long long int u64;
|
||||||
((((u32)val) & 0x0000ff00) << 8 ) | \
|
((((u32)val) & 0x0000ff00) << 8 ) | \
|
||||||
((((u32)val) & 0x000000ff) << 24)))
|
((((u32)val) & 0x000000ff) << 24)))
|
||||||
|
|
||||||
|
#ifdef __BIG_ENDIAN__
|
||||||
|
#define _ES32(val) val
|
||||||
|
#endif
|
||||||
|
|
||||||
//Endian swap for u64.
|
//Endian swap for u64.
|
||||||
#define _ES64(val) \
|
#define _ES64(val) \
|
||||||
((u64)(((((u64)val) & 0xff00000000000000ull) >> 56) | \
|
((u64)(((((u64)val) & 0xff00000000000000ull) >> 56) | \
|
||||||
|
@ -57,6 +65,10 @@ typedef unsigned long long int u64;
|
||||||
((((u64)val) & 0x000000000000ff00ull) << 40) | \
|
((((u64)val) & 0x000000000000ff00ull) << 40) | \
|
||||||
((((u64)val) & 0x00000000000000ffull) << 56)))
|
((((u64)val) & 0x00000000000000ffull) << 56)))
|
||||||
|
|
||||||
|
#ifdef __BIG_ENDIAN__
|
||||||
|
#define _ES64(val) val
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue