Add implementations for CFG::SecureInfoGetByte101 and CFG::GetLocalFriendCodeSeed

This commit is contained in:
wheremyfoodat 2023-09-24 17:11:40 +03:00
parent e682dad4ee
commit 7d55193087
2 changed files with 21 additions and 0 deletions

View file

@ -16,9 +16,11 @@ class CFGService {
// Service functions
void getConfigInfoBlk2(u32 messagePointer);
void getCountryCodeID(u32 messagePointer);
void getLocalFriendCodeSeed(u32 messagePointer);
void getRegionCanadaUSA(u32 messagePointer);
void getSystemModel(u32 messagePointer);
void genUniqueConsoleHash(u32 messagePointer);
void secureInfoGetByte101(u32 messagePointer);
void secureInfoGetRegion(u32 messagePointer);
public:

View file

@ -16,6 +16,9 @@ namespace CFGCommands {
GetRegionCanadaUSA = 0x00040000,
GetSystemModel = 0x00050000,
GetCountryCodeID = 0x000A0040,
GetLocalFriendCodeSeed = 0x04050000,
SecureInfoGetByte101 = 0x04070000,
};
}
@ -208,4 +211,20 @@ void CFGService::getCountryCodeID(u32 messagePointer) {
mem.write32(messagePointer + 4, Result::CFG::NotFound);
mem.write16(messagePointer + 8, 0xFF);
}
}
void CFGService::secureInfoGetByte101(u32 messagePointer) {
log("CFG::SecureInfoGetByte101\n");
mem.write32(messagePointer, IPC::responseHeader(0x407, 2, 0));
mem.write32(messagePointer + 4, Result::Success);
mem.write8(messagePointer + 8, 0); // Secure info byte 0x101 is usually 0 according to 3DBrew
}
void CFGService::getLocalFriendCodeSeed(u32 messagePointer) {
log("CFG::GetLocalFriendCodeSeed\n");
mem.write32(messagePointer, IPC::responseHeader(0x405, 3, 0));
mem.write32(messagePointer + 4, Result::Success);
mem.write64(messagePointer + 8, 0);
}