Skip to content
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

Merged
merged 2 commits into from
Nov 15, 2016
Merged

Add NpDrmPackage #79

merged 2 commits into from
Nov 15, 2016

Conversation

devnoname120
Copy link
Member

Reversed and documented by @173210.
See http://173210.github.io/scenpdrmpackage

I'm not sure about the rule for prefixing function names. Should I remove the _?

@yifanlu
Copy link
Contributor

yifanlu commented Nov 7, 2016

Yeah, remove the "_" if there's colliding names, the convention is to add "ForKernel" or "ForDriver" to ones in kernel.

@173210
Copy link
Contributor

173210 commented Nov 7, 2016

In my opinion:

I think it is legitimate because they are intended for the internal use. Those functions are actually primitive and a userland static library gives more advanced functions. Probably they are expected to be called just by the library and users will use the library instead of calling them by themselves.

Note that the library is on userland but not on kernel. Anyway, I don't think the prefix really matters in the actual use.

@d3m3vilurr
Copy link
Contributor

d3m3vilurr commented Nov 7, 2016

generically, _ mean private or internal function.
so i also agree yifanlu's opinion.
how about just remove _?

@devnoname120
Copy link
Member Author

Many functions from the pastebin file seem to lose one _ when added to db.json. If they are prefixed with __, then it becomes _, and _ becomes nothing. But this is not the case for all of them.

@yifanlu Some rules should be defined. There are currently many discepancies in db.json.

@173210
Copy link
Contributor

173210 commented Nov 7, 2016

I think that is because those names are cited from the binary of Sony. However, some are determined in the community and they cannot be distinguished from the "real" names. It is no longer possible and doesn't make sense to track real names. We should have our own rules.

@devnoname120
Copy link
Member Author

@yifanlu Let's merge it as is, it will be fixed with the rest once the standard is defined.

@devnoname120
Copy link
Member Author

This pull request is broken since the changes have been overwritten by others. I'll try to recover the changes.

@devnoname120
Copy link
Member Author

Done.

* If it is set to 0, the function just checks the header
* and doesn't create the context.
*/
int _sceNpDrmPackageCheck(const void *buffer, SceSize size, int zero, unsigned int identifier);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add documentation for the return value?

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!= 0 on error, otherwise 0.

* @param size - The size of the buffer. The minimum confirmed value is 0x20.
* @param opt - The options.
*/
int _sceNpDrmPackageDecrypt(void * restrict buffer, SceSize size, _sceNpDrmPackageDecrypt_opt * restrict opt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

* \file
* \brief Header file which defines NpDrmPackage related variables and functions
*
* Copyright (C) 2015 PSP2SDK Project
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean 2015?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this date thing really necessary? It seems to be an unnecessary burden, although minor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should follow the existing code anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

"variables": {}
}
},
"nid": 120
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need module nid

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

@devnoname120 devnoname120 Nov 12, 2016

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.

@devnoname120
Copy link
Member Author

devnoname120 commented Nov 12, 2016

Done the changes except the module nid.

@frangarcj frangarcj merged commit 6a28f81 into vitasdk:master Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants