-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a DashLaunch class to interact with the DashLaunch config
- Loading branch information
1 parent
98a38ae
commit 773a410
Showing
6 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# DashLaunch | ||
|
||
Get and set a DashLaunch option value by its name: | ||
```C++ | ||
void Init() | ||
{ | ||
// Initialize the DashLaunch functions | ||
HRESULT hr = XexUtils::DashLaunch::Init(); | ||
if (FAILED(hr)) | ||
{ | ||
XexUtils::Log::Error("Couldn't get functions from DashLaunch"); | ||
return; | ||
} | ||
|
||
// Force liveblock to be enabled | ||
uint32_t liveBlockEnabled = 0; | ||
BOOL result = XexUtils::DashLaunch::GetOptionValueByName("liveblock", &liveBlockEnabled); | ||
if (result == FALSE) | ||
{ | ||
XexUtils::Log::Error("Couldn't get the liveblock value from DashLaunch"); | ||
return; | ||
} | ||
|
||
if (liveBlockEnabled == 0) | ||
{ | ||
uint32_t enableLiveBlock = 1; | ||
result = XexUtils::DashLaunch::SetOptionValueByName("liveblock", &enableLiveBlock); | ||
if (result == FALSE) | ||
{ | ||
XexUtils::Log::Error("Couldn't enable liveblock"); | ||
return; | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
namespace XexUtils | ||
{ | ||
|
||
typedef BOOL (*DLAUNCHGETOPTVALBYNAME)(const char *optionName, uint32_t *pOptionValue); | ||
typedef BOOL (*DLAUNCHSETOPTVALBYNAME)(const char *optionName, uint32_t *pOptionValue); | ||
|
||
class DashLaunch | ||
{ | ||
public: | ||
// Get the pointers to the DashLaunch functions. | ||
static HRESULT Init(); | ||
|
||
// Get the value of optionName as a uint32_t, 1 for true, 0 for false, pointer to the first character for strings. | ||
static DLAUNCHGETOPTVALBYNAME GetOptionValueByName; | ||
|
||
// Set the value of optionName as a uint32_t, 1 for true, 0 for false, pointer to the first character for strings. | ||
static DLAUNCHSETOPTVALBYNAME SetOptionValueByName; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ | |
#include "Xam_.h" | ||
#include "SMC.h" | ||
#include "Socket.h" | ||
#include "DashLaunch.h" | ||
#include "Log.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "pch.h" | ||
#include "DashLaunch.h" | ||
|
||
#include "Memory.h" | ||
|
||
#define LAUNCH_MODULE "launch.xex" | ||
|
||
namespace XexUtils | ||
{ | ||
|
||
enum | ||
{ | ||
DL_ORDINALS_GETOPTVALBYNAME = 9, | ||
DL_ORDINALS_SETOPTVALBYNAME = 10, | ||
}; | ||
|
||
DLAUNCHGETOPTVALBYNAME DashLaunch::GetOptionValueByName = nullptr; | ||
DLAUNCHSETOPTVALBYNAME DashLaunch::SetOptionValueByName = nullptr; | ||
|
||
HRESULT DashLaunch::Init() | ||
{ | ||
GetOptionValueByName = static_cast<DLAUNCHGETOPTVALBYNAME>(Memory::ResolveFunction(LAUNCH_MODULE, DL_ORDINALS_GETOPTVALBYNAME)); | ||
if (GetOptionValueByName == nullptr) | ||
return E_FAIL; | ||
|
||
SetOptionValueByName = static_cast<DLAUNCHSETOPTVALBYNAME>(Memory::ResolveFunction(LAUNCH_MODULE, DL_ORDINALS_SETOPTVALBYNAME)); | ||
if (SetOptionValueByName == nullptr) | ||
return E_FAIL; | ||
|
||
return S_OK; | ||
} | ||
|
||
} |