6 Commits

Author SHA1 Message Date
6d742b2a15 v1.1.6 2023-07-02 23:29:47 +03:00
cf5d87f7a7 Refuse to launch if the patcher is inside the game directory 2023-07-02 23:21:17 +03:00
181d14e4ce Minor readme styling changes 2023-07-02 20:51:49 +03:00
0067ceb85c Document AAT third-party launchers 2023-07-02 20:50:49 +03:00
33cf0a65e8 Document HI3 v6.7.0 support 2023-06-30 11:55:12 +03:00
d30a2aba9e Update comment in hi3.c 2023-06-29 12:58:57 +03:00
5 changed files with 45 additions and 8 deletions

View File

@ -1,5 +1,5 @@
### Games and regions ### Games and regions
- **3rd**: glb v6.6.0 - **3rd**: glb v6.7.0
- **SR**: os/cn v1.1.0 (unsafe, refer to [configuration](#configuration)) - **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. 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.
@ -14,7 +14,7 @@ The anticheat the games use is fundamentally incompatible with Wine in multiple
**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. **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 ### 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)** 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.** **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.**
@ -55,7 +55,8 @@ A part of the source code is witheld (`game_payload/src/tp6.c`). This is a force
Please do not report any issues with the Game to the official channels. Use the issue tracker of this repository Please do not report any issues with the Game to the official channels. Use the issue tracker of this repository
### Third-party launchers ### Third-party launchers
Will be written later - Honkers Launcher — Linux launcher for 3rd ([GitHub](https://github.com/an-anime-team/honkers-launcher) | [Codeberg](https://codeberg.org/an-anime-team/honkers-launcher))
- The Honkers Railway Launcher — Linux launcher for SR ([GitHub](https://github.com/an-anime-team/the-honkers-railway-launcher) | [Codeberg](https://codeberg.org/an-anime-team/the-honkers-railway-launcher))
### Credits ### Credits
- mkrsym1 — project leader, reverse engineering - mkrsym1 — project leader, reverse engineering

View File

@ -17,7 +17,7 @@ const struct crc_id_pair HI3_REGIONS[] = {
// Only glb for now // Only glb for now
// It may be possible to get rid of region-specific data altogether in the future // It may be possible to get rid of region-specific data altogether in the future
{ 0x45221647, GAME_HI3_GLB } // glb v6.6.0 { 0x45221647, GAME_HI3_GLB } // glb v6.7.0
}; };
void hi3_fill_data(struct game_data *buf) { void hi3_fill_data(struct game_data *buf) {

View File

@ -5,6 +5,10 @@
#include <game_p.h> #include <game_p.h>
typedef char *(*wgufn_t)(wchar_t* path); // wine_get_unix_file_name
const char *J_MB_TITLE = "Jadeite Launcher Payload";
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) { BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
// Only listen for attach // Only listen for attach
if (reason != DLL_PROCESS_ATTACH) { if (reason != DLL_PROCESS_ATTACH) {
@ -25,6 +29,38 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
strcpy(workdir, targetExe); strcpy(workdir, targetExe);
*(strrchr(workdir, '\\')) = '\0'; *(strrchr(workdir, '\\')) = '\0';
// SAFETY: verify that the injector is not inside the game directory
HMODULE kernel32 = GetModuleHandleA("kernel32.dll");
wgufn_t wine_get_unix_file_name = (wgufn_t)GetProcAddress(kernel32, "wine_get_unix_file_name");
if (wine_get_unix_file_name) {
wchar_t wInjectDll[MAX_PATH], wWorkdir[MAX_PATH];
MultiByteToWideChar(CP_UTF8, 0, injectDll, strlen(injectDll) + 1, wInjectDll, MAX_PATH);
MultiByteToWideChar(CP_UTF8, 0, workdir, strlen(workdir) + 1, wWorkdir, MAX_PATH);
char *unixInjectDll = wine_get_unix_file_name(wInjectDll);
char *unixWorkdir = wine_get_unix_file_name(wWorkdir);
char startsWith = 0;
while (*unixInjectDll != '\0' && *unixWorkdir != '\0') {
startsWith = *unixInjectDll == *unixWorkdir;
if (!startsWith) break;
unixInjectDll++, unixWorkdir++;
}
HANDLE heap = GetProcessHeap();
HeapFree(heap, 0, unixInjectDll);
HeapFree(heap, 0, unixWorkdir);
if (startsWith) {
MessageBoxA(NULL, "Putting the patcher (or any other foreign PE binaries) inside the game directory is dangerous! Please move it elsewhere.", J_MB_TITLE, MB_OK | MB_ICONERROR);
exit(1);
}
} else {
MessageBoxA(NULL, "Could not find wine_get_unix_file_name! Wine version too old?", J_MB_TITLE, MB_OK | MB_ICONWARNING);
}
// Start the game // Start the game
STARTUPINFO si; STARTUPINFO si;
ZeroMemory(&si, sizeof(si)); ZeroMemory(&si, sizeof(si));
@ -47,7 +83,7 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
)) { )) {
char message[64]; char message[64];
sprintf(message, "Failed to start game process: %ld", GetLastError()); sprintf(message, "Failed to start game process: %ld", GetLastError());
MessageBoxA(NULL, message, "Jadeite Launcher Payload", MB_OK | MB_ICONERROR); MessageBoxA(NULL, message, J_MB_TITLE, MB_OK | MB_ICONERROR);
exit(1); exit(1);
} }
@ -62,7 +98,7 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
if (waitEnabled && strcmp(waitEnabled, "") != 0) { if (waitEnabled && strcmp(waitEnabled, "") != 0) {
char message[64]; char message[64];
sprintf(message, "PID: %ld. Press OK to continue", pi.dwProcessId); sprintf(message, "PID: %ld. Press OK to continue", pi.dwProcessId);
MessageBoxA(NULL, message, "Jadeite Launcher Payload", MB_OK | MB_ICONINFORMATION); MessageBoxA(NULL, message, J_MB_TITLE, MB_OK | MB_ICONINFORMATION);
} }
// Resume the process // Resume the process

View File

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

View File

@ -1,6 +1,6 @@
{ {
"jadeite": { "jadeite": {
"version": "1.1.5" "version": "1.1.6"
}, },
"games": { "games": {
"hi3rd": { "hi3rd": {