Skip to content

Commit

Permalink
Add implementations for CFG::SecureInfoGetByte101 and CFG::GetLocalFr…
Browse files Browse the repository at this point in the history
…iendCodeSeed
  • Loading branch information
wheremyfoodat committed Sep 24, 2023
1 parent e682dad commit 7d55193
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/services/cfg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions src/core/services/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ namespace CFGCommands {
GetRegionCanadaUSA = 0x00040000,
GetSystemModel = 0x00050000,
GetCountryCodeID = 0x000A0040,

GetLocalFriendCodeSeed = 0x04050000,
SecureInfoGetByte101 = 0x04070000,
};
}

Expand Down Expand Up @@ -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);
}

0 comments on commit 7d55193

Please sign in to comment.