-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NpDrmPackage #79
Add NpDrmPackage #79
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* \file | ||
* \brief Header file which defines NpDrmPackage related variables and functions | ||
* | ||
* Copyright (C) 2016 PSP2SDK Project | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef _PSP2_NPDRMPACKAGE_H_ | ||
#define _PSP2_NPDRMPACKAGE_H_ | ||
|
||
#include <psp2/types.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** Options for _sceNpDrmPackageDecrypt */ | ||
typedef struct { | ||
/** The offset in the encrypted data */ | ||
SceOff offset; | ||
|
||
/** | ||
* The identifier specified for _sceNpDrmPackageCheck but NOT ORed | ||
* with (1 << 8) | ||
*/ | ||
unsigned int identifier; | ||
} _sceNpDrmPackageDecrypt_opt; | ||
|
||
/** | ||
* Read the header of the PKG and initialize the context | ||
* | ||
* @param buffer - The buffer containing the header of PKG. | ||
* @param size - The size of buffer. The minimum confirmed value is 0x8000. | ||
* @param zero - Unknown. Supposed to be set to 0. | ||
* @param identifier - arbitrary value [0, 6) ORed with (1 << 8) or 0. | ||
* If it is set to 0, the function just checks the header | ||
* and doesn't create the context. | ||
* | ||
* @return 0 on success, != 0 on error | ||
*/ | ||
int _sceNpDrmPackageCheck(const void *buffer, SceSize size, int zero, unsigned int identifier); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add documentation for the return value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose it's < 0 on error, otherwise 0. Need @173210 's confirmation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. != 0 on error, otherwise 0. |
||
|
||
/** | ||
* Decrypt a PKG | ||
* | ||
* @param buffer - The buffer containing the content of the PKG. | ||
* @param size - The size of the buffer. The minimum confirmed value is 0x20. | ||
* @param opt - The options. | ||
* | ||
* @return 0 on success, != 0 on error | ||
*/ | ||
int _sceNpDrmPackageDecrypt(void * restrict buffer, SceSize size, _sceNpDrmPackageDecrypt_opt * restrict opt); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _PSP2_NPDRMPACKAGE_H_ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need module nid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't all entries in
db.json
use a placeholder NID currently?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most do, yes. We have the technology to fill these in properly now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this should be done with the massive overhaul, including the _ change.