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: Return IPC_EINVAL for unknown ioctlvs #5212

Merged
merged 1 commit into from
Apr 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 21 additions & 4 deletions Source/Core/Core/IOS/ES/ES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,29 @@ IPCCommandResult ES::IOCtlV(const IOCtlVRequest& request)
return Sign(request);
case IOCTL_ES_GETBOOT2VERSION:
return GetBoot2Version(request);

case IOCTL_ES_VERIFYSIGN:
case IOCTL_ES_DELETESHAREDCONTENT:
case IOCTL_ES_UNKNOWN_39:
case IOCTL_ES_UNKNOWN_3A:
case IOCTL_ES_UNKNOWN_3B:
case IOCTL_ES_UNKNOWN_3C:
case IOCTL_ES_UNKNOWN_3D:
case IOCTL_ES_UNKNOWN_3E:
case IOCTL_ES_UNKNOWN_3F:
case IOCTL_ES_UNKNOWN_40:
case IOCTL_ES_UNKNOWN_41:
case IOCTL_ES_UNKNOWN_42:
case IOCTL_ES_UNKNOWN_43:
case IOCTL_ES_UNKNOWN_44:
PanicAlert("IOS-ES: Unimplemented ioctlv 0x%x (%zu in vectors, %zu io vectors)",
request.request, request.in_vectors.size(), request.io_vectors.size());
request.DumpUnknown(GetDeviceName(), LogTypes::IOS_ES, LogTypes::LERROR);
return GetDefaultReply(IPC_EINVAL);

default:
request.DumpUnknown(GetDeviceName(), LogTypes::IOS_ES);
break;
return GetDefaultReply(IPC_EINVAL);
}

return GetDefaultReply(IPC_SUCCESS);
}

IPCCommandResult ES::GetConsumption(const IOCtlVRequest& request)
Expand Down
15 changes: 13 additions & 2 deletions Source/Core/Core/IOS/ES/ES.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,26 @@ class ES final : public Device
IOCTL_ES_GETBOOT2VERSION = 0x2E,
IOCTL_ES_ADDTITLECANCEL = 0x2F,
IOCTL_ES_SIGN = 0x30,
// IOCTL_ES_VERIFYSIGN = 0x31,
IOCTL_ES_VERIFYSIGN = 0x31,
IOCTL_ES_GETSTOREDCONTENTCNT = 0x32,
IOCTL_ES_GETSTOREDCONTENTS = 0x33,
IOCTL_ES_GETSTOREDTMDSIZE = 0x34,
IOCTL_ES_GETSTOREDTMD = 0x35,
IOCTL_ES_GETSHAREDCONTENTCNT = 0x36,
IOCTL_ES_GETSHAREDCONTENTS = 0x37,
IOCTL_ES_DELETESHAREDCONTENT = 0x38,
//
IOCTL_ES_UNKNOWN_39 = 0x39,
IOCTL_ES_UNKNOWN_3A = 0x3A,
IOCTL_ES_UNKNOWN_3B = 0x3B,
IOCTL_ES_UNKNOWN_3C = 0x3C,
IOCTL_ES_UNKNOWN_3D = 0x3D,
IOCTL_ES_UNKNOWN_3E = 0x3E,
IOCTL_ES_UNKNOWN_3F = 0x3F,
IOCTL_ES_UNKNOWN_40 = 0x40,
IOCTL_ES_UNKNOWN_41 = 0x41,
IOCTL_ES_UNKNOWN_42 = 0x42,
IOCTL_ES_UNKNOWN_43 = 0x43,
IOCTL_ES_UNKNOWN_44 = 0x44,
IOCTL_ES_CHECKKOREAREGION = 0x45,
};

Expand Down