7 Commits

Author SHA1 Message Date
cba9b20171 v1.1.1 2023-06-10 19:24:07 +03:00
5640987ead metadata.json for third-party launchers 2023-06-10 19:19:11 +03:00
54a127b848 Minor injector and launcher payload refactoring 2023-06-10 18:28:19 +03:00
3994188b08 Add WAIT_BEFORE_RESUME envvar 2023-06-10 18:23:43 +03:00
7ffce8fe3a Update readme 2023-06-10 13:07:47 +03:00
5143dc0d56 Minor readme styling changes 2023-06-09 21:10:44 +03:00
0afdf60cc6 Add HSR logging servers to SERVERS.txt 2023-06-08 23:01:07 +03:00
7 changed files with 60 additions and 25 deletions

View File

@ -1,38 +1,41 @@
# PROOF OF CONCEPT. DO NOT USE IF YOU DON'T KNOW WHAT YOU'RE DOING
### Games and regions
3rd: glb v6.6.0
SR: os/cn v1.1.0 (unsafe, refer to [configuration](#configuration))
- **3rd**: glb v6.6.0
- **SR**: os/cn v1.1.0 (unsafe, refer to [configuration](#configuration))
It may be possilbe to completely remove the region and version-specific data in the future. Refer to the source code in `game_payload/src` for details.
### Information
The anticheat the games use is fundamentally incompatible with Wine in multiple ways. This tool launches the game without it (`injector/launcher_payload`) and imitates it's behaviour (`game_payload`).
Does not work on Windows.
**SR-specific**: this tool disables the use of DirectX shared resources in a rather hacky way. It is required, as there is no (and most likely never will be) shared resources support in DirectX translation layers (WineD3D/DXVK). Refer to [configuration](#configuration) if you wish to run the game without the fix.
**Using third-party software (such as this tool) with the games violates their Terms of Service**. Therefore, **you may receive a ban**. No bans were ever reported with 3rd, however the legacy patch for SR did cause many. **Use at your own risk and only if you understand all the possible consequences**.
**This is not a cheating tool**. Using it with Windows is not possible, and Windows support is not planned or intended in any way. However, as it does not perform any on-disk file modifications, you may reuse the same game install for Windows if you have a dual-boot setup.
### Usage
**Refer to [Third-party launchers](#third-party-launchers) (will be written later)** for convenient usage. If you don't want to (or can't) use third-party launchers, continue reading the section below.
**Refer to [third-party launchers](#third-party-launchers) (will be written later)** for convenient usage. If you don't want to (or can't) use third-party launchers, continue reading the section below.
**Wine 8.0+ is recommended**, as lower versions leak "The Wine project" as the device identifier. Not critical, but taking a precaution never hurt anyone. **DXVK is strongly recommended.**
3rd-specific: In some cases, and if you're not using Proton GE, **a fix for Media Foundation may be required to play videos. The Game may crash without it.** You can download it from [here](https://github.com/z0z0z/mf-install). You might need to [limit the number of cores available to the game](https://github.com/z0z0z/mf-install/issues/44) if your CPU has more than 8.
**3rd-specific**: In some cases, and if you're not using Proton GE, **a fix for Media Foundation may be required to play videos. The Game may crash without it.** You can download it from [here](https://github.com/z0z0z/mf-install). You might need to [limit the number of cores available to the game](https://github.com/z0z0z/mf-install/issues/44) if your CPU has more than 8.
Manual usage instructions:
- Download the game you want to run
- Download a release from this repository
- Extract the archive (**NOT INTO THE GAME DIRECTORY! THIS IS IMPORTANT!**)
- Block analytics servers in your `hosts` file. You can find the list in SERVERS.txt
- Run `wine jadeite.exe "Z:\\wine\\path\\to\\game.exe"`
- Run `wine jadeite.exe 'Z:\wine\path\to\game.exe'`
This tool is capable of starting the games from a different process. This may be useful for spoofing the parent process (SR is known to report it). Use `wine jadeite.exe "Z:\\wine\\path\\to\\game.exe" "Z:\\wine\\path\\to\\launcher.exe"`. `explorer.exe` is used as the default.
This tool is capable of starting the games from a different process. This may be useful for spoofing the parent process (SR is known to report it). Use `wine jadeite.exe 'Z:\wine\path\to\game.exe' 'Z:\wine\path\to\launcher.exe'`. `explorer.exe` is used as the default.
### Configuration
These environment variables can be used to configure the behaviour of the tool.
SR-exclusive:
- `I_WANT_A_BAN=1` - allows to launch HSR. Please only use testing accounts, as there is an extremely high risk of getting banned
- `WAIT_BEFORE_RESUME=1` - show a messagebox and wait for user input before resuming the game process. Useful on my side for debugging
**SR-exclusive**:
- `I_WANT_A_BAN=1` - allows to launch SR. Please only use testing accounts, as there is an extremely high risk of getting banned
- `SRFIX_DISABLE=1` - disable shared resources fix
### Internals

View File

@ -2,3 +2,11 @@
0.0.0.0 log-upload-os.hoyoverse.com
0.0.0.0 sg-public-data-api.hoyoverse.com
0.0.0.0 dump.gamesafe.qq.com
# Honkai Star Rail logging servers (oversea)
0.0.0.0 log-upload-os.hoyoverse.com
0.0.0.0 sg-public-data-api.hoyoverse.com
# Honkai Star Rail logging servers (China)
0.0.0.0 log-upload.mihoyo.com
0.0.0.0 public-data-api.mihoyo.com

View File

@ -14,6 +14,7 @@ cp ./build/injector/jadeite.exe ./out
cp ./build/injector/launcher_payload/launcher_payload.dll ./out
cp ./build/game_payload/game_payload.dll ./out
cp ./LICENSE.txt ./out
cp ./metadata.json ./out
$strip ./out/*.{exe,dll}

View File

@ -4,11 +4,6 @@
#include <lpayload.h>
static inline void read_env(const char *env, char *dest, size_t size) {
GetEnvironmentVariableA(env, dest, size);
SetEnvironmentVariableA(env, "");
}
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
// Only listen for attach
if (reason != DLL_PROCESS_ATTACH) {
@ -16,12 +11,10 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
}
// Get target EXE path
char targetExe[MAX_PATH];
read_env(ENV_EXE_PATH, targetExe, sizeof(targetExe));
char *targetExe = getenv(ENV_EXE_PATH);
// Get the path of the DLL to inject
char injectDll[MAX_PATH];
read_env(ENV_DLL_PATH, injectDll, sizeof(injectDll));
char *injectDll = getenv(ENV_DLL_PATH);
// Compute the working directory path
char workdir[MAX_PATH];
@ -60,6 +53,14 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
size_t payloadSize = (size_t)&_binary_lpayload_o_p_payload_bin_size;
inject(pi.hProcess, payloadStart, payloadSize, injectDll);
// Optional: wait for user input before resuming (useful for debugging)
char *waitEnabled = getenv("WAIT_BEFORE_RESUME");
if (waitEnabled && strcmp(waitEnabled, "") != 0) {
char message[64];
sprintf(message, "PID: %ld. Press OK to continue", pi.dwProcessId);
MessageBoxA(NULL, message, "Jadeite Launcher Payload", MB_OK | MB_ICONINFORMATION);
}
// Resume the process
ResumeThread(pi.hThread);

View File

@ -34,8 +34,7 @@ int main(int argc, char **argv) {
char injectorPath[MAX_PATH];
GetModuleFileNameA(GetModuleHandleA(NULL), injectorPath, sizeof(injectorPath));
char *lastSep = strrchr(injectorPath, '\\');
*lastSep = '\0';
*(strrchr(injectorPath, '\\')) = '\0';
SetCurrentDirectoryA(injectorPath);
@ -49,7 +48,7 @@ int main(int argc, char **argv) {
char launcherPayloadPath[MAX_PATH];
GetFullPathNameA(LAUNCHER_INJECT_DLL, sizeof(launcherPayloadPath), launcherPayloadPath, NULL);
printf("Starting \"%s\" via \"%s\"\n", gameExePath, launcherPath);
printf("Starting '%s' via '%s'\n", gameExePath, launcherPath);
// Set envvars
SetEnvironmentVariableA(ENV_EXE_PATH, gameExePath);

View File

@ -1,4 +1,4 @@
project('jadeite', 'c', version: '1.1.0')
project('jadeite', 'c', version: '1.1.1')
nasm = find_program('nasm')
gen_res = find_program('gen_resources.sh')

23
metadata.json Normal file
View File

@ -0,0 +1,23 @@
{
"jadeite": {
"version": "1.1.1"
},
"games": {
"hi3rd": {
"global": {
"status": "verified",
"version": "6.6.0"
}
},
"hsr": {
"global": {
"status": "verified",
"version": "1.1.0"
},
"china": {
"status": "verified",
"version": "1.1.0"
}
}
}
}