Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Installing

Magix edited this page Apr 11, 2022 · 2 revisions

Before Installing

Open Shen is not ready to go out of the box. Before installing, understand you will need to self provide the following:

  • An SSL certificate & private key for the host server
    • This isn't required if you are running Fiddler Classic to redirect traffic.
  • Protobuffer definitions for the version of Yuan Shen you want to run
  • Yuan Shen packet IDs for the version you want to run
  • Dummy packet responses for the Yuan Shen version you want to run
    • These can be dumped from a tool like Iridium.

Prerequisites

  • An SSL certificate & private key for the host server
  • Protobuffer definitions for your Yuan Shen client
  • Yuan Shen packet IDs for your client
  • Dummy packet responses for your Yuan Shen client
  • Access to your system's hosts file
    • You can avoid modifying the hosts file by using Fiddler to redirect traffic to the localhost.
  • Port 443 and 80 and 22102 open (and forwarded if necessary) on the host server

Installation

To install Open Shen:

  1. Download the latest version of Open Shen from GitHub Releases.
    1. Make sure you download the version for your operating system.
  2. Place the downloaded executable in a directory on your host.
  3. In the same directory, create the following directories and place the corresponding files in them.
    1. certs: Add your HTTPS certificate and private key to this directory.
    2. versions: Add a version config for your Yuan Shen client to this directory.
    3. protocol: Add the protobuffer definitions for your Yuan Shen client to this directory.
    4. packets/rawPackets: Add dummy packet responses for your Yuan Shen client to this directory.
  4. Configure a version of Yuan Shen for the server to use.
    1. A guide to this can be found here.
  5. Run Open Shen.

Connecting

With Open Shen running, use one of the following methods to connect.

System Hosts File (recommended)

Note: This method only works if you have access (usually root or administrator) to your system's hosts file.

On Windows

Run: notepad C:\Windows\System32\drivers\etc\hosts in an Administrator Command Prompt and add or remove the hosts block.

On macOS/Linux/UNIX-based Systems

Run: sudo vi /etc/hosts in a Terminal and add or remove the hosts block.

Using Open Shen's Configurator

Note: This method has not been completed. Come back to this later for a quick and easy way to configure your hosts file!

Hosts Block

127.0.0.1 api-os-takumi.mihoyo.com
127.0.0.1 hk4e-api-os-static.mihoyo.com
127.0.0.1 hk4e-sdk-os.mihoyo.com
127.0.0.1 dispatchosglobal.yuanshen.com
127.0.0.1 osusadispatch.yuanshen.com
127.0.0.1 account.mihoyo.com
127.0.0.1 log-upload-os.mihoyo.com
127.0.0.1 dispatchcntest.yuanshen.com
127.0.0.1 devlog-upload.mihoyo.com
127.0.0.1 webstatic.mihoyo.com
127.0.0.1 log-upload.mihoyo.com
127.0.0.1 hk4e-sdk.mihoyo.com
127.0.0.1 api-beta-sdk.mihoyo.com
127.0.0.1 api-beta-sdk-os.mihoyo.com
127.0.0.1 cnbeta01dispatch.yuanshen.com
127.0.0.1 dispatchcnglobal.yuanshen.com
127.0.0.1 cnbeta02dispatch.yuanshen.com
127.0.0.1 sdk-os-static.mihoyo.com
127.0.0.1 webstatic-sea.mihoyo.com
127.0.0.1 hk4e-sdk-os-static.hoyoverse.com
127.0.0.1 webstatic-sea.hoyoverse.com
127.0.0.1 sdk-os-static.hoyoverse.com
127.0.0.1 api-account-os.hoyoverse.com
127.0.0.1 hk4e-sdk-os.hoyoverse.com
127.0.0.1 uspider.yuanshen.com

Fiddler (legacy)

  1. Install & Run Fiddler.
  2. Open the FiddlerScript tab.
  3. Add the following to the FiddlerScript tab:
import System;
import System.Windows.Forms;
import Fiddler;
import System.Text.RegularExpressions;

var list = [
    "https://api-os-takumi.mihoyo.com",
    "https://hk4e-api-os-static.mihoyo.com",
    "https://hk4e-sdk-os.mihoyo.com",
    "https://dispatchosglobal.yuanshen.com",
    "https://osusadispatch.yuanshen.com",
    "https://account.mihoyo.com",
    "https://log-upload-os.mihoyo.com",
    "https://dispatchcntest.yuanshen.com",
    "https://devlog-upload.mihoyo.com",
    "https://webstatic.mihoyo.com",
    "https://log-upload.mihoyo.com",
    "https://hk4e-sdk.mihoyo.com",
    "https://api-beta-sdk.mihoyo.com",
    "https://api-beta-sdk-os.mihoyo.com",
    "https://cnbeta01dispatch.yuanshen.com",
    "https://dispatchcnglobal.yuanshen.com",
    "https://cnbeta02dispatch.yuanshen.com",
    "https://sdk-os-static.mihoyo.com",
    "https://webstatic-sea.mihoyo.com",
    "https://webstatic-sea.hoyoverse.com",
    "https://hk4e-sdk-os-static.hoyoverse.com",
    "https://sdk-os-static.hoyoverse.com",
    "https://api-account-os.hoyoverse.com",
    "https://hk4e-sdk-os.hoyoverse.com"
];

class Handlers
{
    static function OnBeforeRequest(oS: Session) {
        var active = true;
        if(active) {
            if(oS.uriContains("http://overseauspider.yuanshen.com:8888/log")){
                oS.oRequest.FailSession(404, "Blocked", "yourmom");
            }
            
            for(var i = 0; i < 23 ;i++) {
                 if(oS.uriContains(list[i])) {
                    oS.fullUrl = oS.fullUrl.Replace("https://", "http://");
                    oS.host = "localhost"; // This can also be replaced with another IP address.  
                    break;
                }
            }
        }
    }                       
};
  1. Click save and launch Yuan Shen.
    1. You must keep Fiddler open to connect and play.