mirror of
https://github.com/wiiu-env/wudd.git
synced 2024-11-25 19:26:58 +01:00
Simplify game.key dumping
This commit is contained in:
parent
fc2e994b72
commit
8f1cfdc982
@ -126,7 +126,7 @@ void ApplicationState::render() {
|
|||||||
WiiUScreen::drawLine("Read disc information");
|
WiiUScreen::drawLine("Read disc information");
|
||||||
} else if (this->state == STATE_READ_DISC_INFO_DONE) {
|
} else if (this->state == STATE_READ_DISC_INFO_DONE) {
|
||||||
WiiUScreen::drawLinef("Dumping: %s", this->discId);
|
WiiUScreen::drawLinef("Dumping: %s", this->discId);
|
||||||
} else if (this->state == STATE_DUMP_TICKET) {
|
} else if (this->state == STATE_DUMP_DISC_KEY) {
|
||||||
WiiUScreen::drawLinef("Dumping game.key");
|
WiiUScreen::drawLinef("Dumping game.key");
|
||||||
} else if (this->state == STATE_DUMP_DISC_START || this->state == STATE_DUMP_DISC || this->state == STATE_WAIT_USER_ERROR_CONFIRM) {
|
} else if (this->state == STATE_DUMP_DISC_START || this->state == STATE_DUMP_DISC || this->state == STATE_WAIT_USER_ERROR_CONFIRM) {
|
||||||
WiiUScreen::drawLinef("Dumping: %s", this->discId);
|
WiiUScreen::drawLinef("Dumping: %s", this->discId);
|
||||||
@ -277,29 +277,19 @@ void ApplicationState::update(Input *input) {
|
|||||||
return;
|
return;
|
||||||
} else if (this->state == STATE_READ_DISC_INFO_DONE) {
|
} else if (this->state == STATE_READ_DISC_INFO_DONE) {
|
||||||
DEBUG_FUNCTION_LINE("STATE_READ_DISC_INFO_DONE");
|
DEBUG_FUNCTION_LINE("STATE_READ_DISC_INFO_DONE");
|
||||||
this->state = STATE_DUMP_TICKET;
|
this->state = STATE_DUMP_DISC_KEY;
|
||||||
} else if (this->state == STATE_DUMP_TICKET) {
|
} else if (this->state == STATE_DUMP_DISC_KEY) {
|
||||||
DEBUG_FUNCTION_LINE("STATE_DUMP_TICKET");
|
DEBUG_FUNCTION_LINE("STATE_DUMP_DISC_KEY");
|
||||||
|
|
||||||
auto res = IOSUHAX_FSA_RawRead(gFSAfd, this->sectorBuf, READ_SECTOR_SIZE, 1, 3, this->oddFd);
|
auto res = IOSUHAX_FSA_RawRead(gFSAfd, this->sectorBuf, READ_SECTOR_SIZE, 1, 3, this->oddFd);
|
||||||
uint8_t discKey[16];
|
uint8_t discKey[16];
|
||||||
bool hasDiscKey = false;
|
bool hasDiscKey = false;
|
||||||
if (res >= 0) {
|
if (res >= 0) {
|
||||||
if (((uint32_t *) this->sectorBuf)[0] != 0xCCA6E67B) {
|
if (((uint32_t *) this->sectorBuf)[0] != 0xCCA6E67B) {
|
||||||
uint8_t iv[16];
|
auto discKeyRes = IOSUHAX_ODM_GetDiscKey(discKey);
|
||||||
memset(iv, 0, 16);
|
if (discKeyRes >= 0) {
|
||||||
|
|
||||||
auto odm_handle = IOS_Open("/dev/odm", IOS_OPEN_READ);
|
|
||||||
if (odm_handle >= 0) {
|
|
||||||
uint32_t io_buffer[0x20 / 4];
|
|
||||||
// disc encryption key, only works with patched IOSU
|
|
||||||
io_buffer[0] = 3;
|
|
||||||
if (IOS_Ioctl(odm_handle, 0x06, io_buffer, 0x14, io_buffer, 0x20) == 0) {
|
|
||||||
memcpy(discKey, io_buffer, 16);
|
|
||||||
hasDiscKey = true;
|
hasDiscKey = true;
|
||||||
}
|
}
|
||||||
IOS_Close(odm_handle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public:
|
|||||||
STATE_DUMP_APP_FILES_DONE,
|
STATE_DUMP_APP_FILES_DONE,
|
||||||
STATE_READ_DISC_INFO,
|
STATE_READ_DISC_INFO,
|
||||||
STATE_READ_DISC_INFO_DONE,
|
STATE_READ_DISC_INFO_DONE,
|
||||||
STATE_DUMP_TICKET,
|
STATE_DUMP_DISC_KEY,
|
||||||
STATE_DUMP_DISC_START,
|
STATE_DUMP_DISC_START,
|
||||||
STATE_DUMP_DISC_DONE,
|
STATE_DUMP_DISC_DONE,
|
||||||
STATE_WAIT_USER_ERROR_CONFIRM,
|
STATE_WAIT_USER_ERROR_CONFIRM,
|
||||||
|
Loading…
Reference in New Issue
Block a user