# GI on Linux

The goal of this project is to play Genshin Impact on Linux.
This repository includes patches to get the game running.

License: MIT


#### CURRENT GAME STATUS

![Error 31-4302 when entering the door after login](LOGO-IF-E31-4302.jpg)

<!-- Uncomment when it  finally works [Game is playable!](LOGO-IF-WORKING.jpg) -->


## Wanted

If you would like to help us, check the tasks on the [Issue tracker](https://notabug.org/Krock/GI-on-Linux/issues?state=open&labels=2024)

  * Some research is stalling, and may be missing from the Markdown files. Be sure to check the comments!

**Helpful tools:** [TOOLS.md](TOOLS.md)

**Current conclusions:** [1.1.0 Journal](110/JOURNAL.md)


## Explanation

`mhyprot2.sys` is a kernel service which is and will not be supported by wine. The service is used as cheat detection, hence being well protected.

**Possible solutions:**

 * Patch out anticheat (reason why this project exists)
 * Support the kernel service support in Wine
 * Wait for an official Linux build
 * Wait for [Blue Protocol](https://www.hitc.com/en-gb/2020/10/02/blue-protocol-release-date/) as an alternative (2021/22)

#### 1 Week of Gameplay

From 23 October 2020 (1.0.1 update) to 28 October 2020 the game was confirmed working on multiple Wine versions (5.17 and newer).
Prior and after, the error code 31-4302 is shown.

What has changed? Probably a server update. Needs investigating.


## Project rules

 1. The workarounds must not be used for cheating. GI is a nice game and does not deserve cheaters.
 2. miHoYo reserves the right to distribute files. Please do not share any game data in public.
 3. Beware that logs may contain personal information, such as MAC addresses or login data.

#### Applying the workaround

Apply the patch(.sh) as follows:

	cd "/path/to/Genshin Impact Game"
	bash "/path/to/GI-on-Linux/GAMEVER/patch.sh"

A backup will be created and the relevant files patched.


## Credits

Original research: https://www.playonlinux.com/en/app-4228.html


*If you are on this list but do not agree with the license, please open an issue or contact me directly.*

List ordered by first contribution in the project.

User Krock ([PlayOnLinux](https://www.playonlinux.com/en/profil-95230.html), NotABug)

 * Initial Ghidra experiments, self-declared project leader

User timbuntu ([PlayOnLinux](https://www.playonlinux.com/de/profil-95714.html), NotABug)

 * First success on version 1.0.1
 * MITM logs

User geearf2 (Freenode IRC)

 * Providing game data from 25 Oct

User SeppNel ([PlayOnLinux](https://www.playonlinux.com/en/profil-95643.html), NotABug)

 * Windows/Linux comparisons on the same system
 * Network and xLua logs

User 0x90 ([PlayOnLinux](https://www.playonlinux.com/en/profil-96196.html))

 * Research about in-memory modifications
 * x64dbg instructions

User Th1nkCh3ck (NotABug)

 * General information research

User Makksim (NotABug)

 * Summary of the mhyprot2 service behaviour

User tiagop (NotABug, Email)

 * Information collecting about Wine projects
