Small update
This commit is contained in:
parent
7dafc03484
commit
1b22c80c5c
|
@ -67,7 +67,7 @@ void init_tom_lib()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool xbox_exp_mod(unsigned char* pA, const unsigned char* pB, const unsigned char* pC, const unsigned char* pD,
|
bool xbox_exp_mod(unsigned char* pA, const unsigned char* pB, const unsigned char* pC, const unsigned char* pD,
|
||||||
size_t b_size, size_t c_size, size_t d_size)
|
size_t a_size, size_t b_size, size_t c_size, size_t d_size)
|
||||||
{
|
{
|
||||||
mp_int a, b, c, d;
|
mp_int a, b, c, d;
|
||||||
CHK_MP_RET(mp_init(&a));
|
CHK_MP_RET(mp_init(&a));
|
||||||
|
@ -80,7 +80,7 @@ bool xbox_exp_mod(unsigned char* pA, const unsigned char* pB, const unsigned cha
|
||||||
|
|
||||||
CHK_MP_RET(mp_exptmod(&b, &c, &d, &a));
|
CHK_MP_RET(mp_exptmod(&b, &c, &d, &a));
|
||||||
|
|
||||||
CHK_MP_RET(mp_export(pA, NULL, -1, 4, -1, 0, &a));
|
CHK_MP_RET(mp_export(pA, NULL, -1, a_size, 0, 0, &a));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ typedef union _RSA_PUBLIC_KEY
|
||||||
|
|
||||||
void init_tom_lib();
|
void init_tom_lib();
|
||||||
bool xbox_exp_mod(unsigned char* pA, const unsigned char* pB, const unsigned char* pC, const unsigned char* pD,
|
bool xbox_exp_mod(unsigned char* pA, const unsigned char* pB, const unsigned char* pC, const unsigned char* pD,
|
||||||
size_t b_size, size_t c_size, size_t d_size);
|
size_t a_size, size_t b_size, size_t c_size, size_t d_size);
|
||||||
bool xbox_rsa_public(const unsigned char* in_buf, unsigned char* out_buf, RSA_PUBLIC_KEY key);
|
bool xbox_rsa_public(const unsigned char* in_buf, unsigned char* out_buf, RSA_PUBLIC_KEY key);
|
||||||
bool verify_hash(const unsigned char* hash, const unsigned char* decryptBuffer, RSA_PUBLIC_KEY key);
|
bool verify_hash(const unsigned char* hash, const unsigned char* decryptBuffer, RSA_PUBLIC_KEY key);
|
||||||
|
|
||||||
|
|
|
@ -792,7 +792,7 @@ bool Xbe::CheckXbeSignature()
|
||||||
memcpy(keys[2].Default, (void*)xboxkrnl::XePublicKeyDataChihiroBoot, 284);
|
memcpy(keys[2].Default, (void*)xboxkrnl::XePublicKeyDataChihiroBoot, 284);
|
||||||
// TODO: memcpy(keys[3].Default, (void*)xboxkrnl::XePublicKeyDataDebug, 284);
|
// TODO: memcpy(keys[3].Default, (void*)xboxkrnl::XePublicKeyDataDebug, 284);
|
||||||
|
|
||||||
for (int i = 0; i < keys.size(); i++) {
|
for (unsigned int i = 0; i < keys.size(); i++) {
|
||||||
if (xbox_rsa_public(m_Header.pbDigitalSignature, crypt_buffer, keys[i])) {
|
if (xbox_rsa_public(m_Header.pbDigitalSignature, crypt_buffer, keys[i])) {
|
||||||
if (verify_hash(SHADigest, crypt_buffer, keys[i])) {
|
if (verify_hash(SHADigest, crypt_buffer, keys[i])) {
|
||||||
// Load the successful key into XboxKrnl::XePublicKeyData for application use
|
// Load the successful key into XboxKrnl::XePublicKeyData for application use
|
||||||
|
|
|
@ -216,7 +216,7 @@ xboxkrnl::ULONG NTAPI JumpedModExp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
unsigned int len = dwN * 4;
|
unsigned int len = dwN * 4;
|
||||||
if (xbox_exp_mod((unsigned char*)pA, (const unsigned char*)pB, (const unsigned char*)pC, (const unsigned char*)pD, len, len, len)) {
|
if (xbox_exp_mod((unsigned char*)pA, (const unsigned char*)pB, (const unsigned char*)pC, (const unsigned char*)pD, len, len, len, len)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue