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

IOS/ES: Implement ES_SetUpStreamKey #5575

Merged
merged 2 commits into from Jun 8, 2017

Conversation

leoetlino
Copy link
Member

This ioctlv is used to get an IOSC decrypt handle for a title. It is known to be used internally by the WFS modules, but it can also be used from the PPC under some conditions.

Some title type constants that are used in IOS are pretty much unknown and not named anywhere (neither in the open sourced IOS source code, nor in IOS, nor in debug messages), unfortunately.

Implementing SetUpStreamKey brings us down to 2 essentially unimplementable ioctlvs (syscalls which seem to return kernel thread priorities...), and 1 known but unimplemented ioctlv (VerifySign).

Copy link
Member

@BhaaLseN BhaaLseN left a comment

Choose a reason for hiding this comment

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

Haven't looked at the actual IOS, but it looks good to me other than that one comment.

// Only allow using this function with some titles (WFS titles).
// The following is the exact check from IOS. Unfortunately, other than knowing that the
// title type is what IOS checks, we don't know anything about the constants used here.
if ((!(title_type & 4) && ~(title_type >> 5) & 1) || (title_type & 0x24) == 36)

This comment was marked as off-topic.

This comment was marked as off-topic.

@leoetlino leoetlino force-pushed the setup-stream-key branch 2 times, most recently from 6480bc7 to da5ebd0 Compare June 8, 2017 15:35
const u32 mask = m_key_entries[handle].owner_mask | mask_with_current_pid;
if (mask != mask_with_current_pid)
return IOSC_EACCES;
m_key_entries[handle].owner_mask = (new_owner & 0xFFFFFFF8) | mask;

This comment was marked as off-topic.

This comment was marked as off-topic.

This ioctlv is used to get an IOSC decrypt handle for a title.
It is known to be used internally by the WFS modules, but it can also
be used from the PPC under some conditions.

Brings us down to 2 essentially unimplementable ioctlvs (syscalls which
seem to return kernel thread priorities...), and 1 known but
unimplemented ioctlv (VerifySign).
@leoetlino leoetlino merged commit 9885a2b into dolphin-emu:master Jun 8, 2017
@leoetlino leoetlino deleted the setup-stream-key branch June 8, 2017 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants