-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenginetribe_mitmproxy.py
More file actions
35 lines (29 loc) · 1.05 KB
/
enginetribe_mitmproxy.py
File metadata and controls
35 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from dataclasses import dataclass
from typing import Literal
@dataclass
class Config:
# Game platform.
# "PC" for PC, "MB" for Android
platform: Literal["PC", "MB"] = "PC"
# Game language.
# "ES" for Spanish, "CN" for Chinese, "EN" for English, "PT" for Portuguese
locale: Literal["ES", "CN", "EN", "PT"] = "CN"
original_token: str = "382041526"
original_host: str = "199.127.62.141"
original_port: int = 25624
replace_token: str = f"SMMWE{platform}{locale}"
replace_host: str = "hexpserver.ddns.net"
replace_port: int = 30000
class EngineTribeProxy:
def request(self, flow):
if flow.request.host == Config.original_host and flow.request.port == Config.original_port:
# Apply replacement
flow.request.host = Config.replace_host
flow.request.port = Config.replace_port
flow.request.text = flow.request.text.replace(
"token=" + Config.original_token,
"token=" + Config.replace_token
)
addons = [
EngineTribeProxy()
]