This repository has been archived by the owner on Feb 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.py
97 lines (83 loc) · 4.68 KB
/
start.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
from mmap import ACCESS_WRITE, mmap
import psutil
from time import sleep
print("""
DBD SSL Pinning Bypass
Bypass method by mguserman;
Coded by Vypivshiy;
""")
def open_path():
try:
file = open("path", 'r', encoding="utf8")
path = file.read()
path = path.strip()
file.close()
if len(path) == 0:
print("Error, empty path name!")
return None
return path
except FileNotFoundError:
print("Error, file 'path' not found!")
file = open("path", "w", encoding="utf8")
file.close()
return None
def wait_process():
while True:
for proc in psutil.process_iter():
try:
name = proc.name()
if name.startswith("EasyAntiCheat"):
return
except psutil.AccessDenied:
pass
def process_list():
names = list()
for proc in psutil.process_iter():
try:
names.append(proc.name().replace(".exe", ''))
except psutil.AccessDenied:
pass
return names
def restore_bytes():
start_bytes = b"\x5B\x3D\x3D\x53\x53\x4C\x5D\x0D\x0A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
new_bytes = b"\x5B\x3D\x3D\x53\x53\x4C\x5D\x0D\x0A\x2B\x50\x69\x6E\x6E\x65\x64\x50\x75\x62\x6C\x69\x63\x4B\x65\x79\x73\x3D\x22\x73\x74\x65\x61\x6D\x2E\x6C\x69\x76\x65\x2E\x62\x68\x76\x72\x64\x62\x64\x2E\x63\x6F\x6D\x3A\x2B\x2B\x4D\x42\x67\x44\x48\x35\x57\x47\x76\x4C\x39\x42\x63\x6E\x35\x42\x65\x33\x30\x63\x52\x63\x4C\x30\x66\x35\x4F\x2B\x4E\x79\x6F\x58\x75\x57\x74\x51\x64\x58\x31\x61\x49\x3D\x3B\x45\x58\x72\x45\x65\x2F\x58\x58\x70\x31\x6F\x34\x2F\x6E\x56\x6D\x63\x71\x43\x61\x47\x2F\x42\x53\x67\x56\x52\x33\x4F\x7A\x68\x56\x55\x47\x38\x2F\x58\x34\x6B\x52\x43\x43\x55\x3D\x22"
with open(f"{path}\\DeadByDaylight\\Content\\Paks\\pakchunk0-WindowsNoEditor.pak", "r+b") as file, mmap(file.fileno(), 0, access=ACCESS_WRITE) as s:
i = s.find(start_bytes)
if i != -1:
s[i:i + len(new_bytes)] = new_bytes
def replace_bytes():
start_bytes = b"\x2B\x50\x69\x6E\x6E\x65\x64\x50\x75\x62\x6C\x69\x63\x4B\x65\x79\x73\x3D\x22\x73\x74\x65\x61\x6D\x2E\x6C\x69\x76\x65\x2E\x62\x68\x76\x72\x64\x62\x64\x2E\x63\x6F\x6D\x3A\x2B\x2B\x4D\x42\x67\x44\x48\x35\x57\x47\x76\x4C\x39\x42\x63\x6E\x35\x42\x65\x33\x30\x63\x52\x63\x4C\x30\x66\x35\x4F\x2B\x4E\x79\x6F\x58\x75\x57\x74\x51\x64\x58\x31\x61\x49\x3D\x3B\x45\x58\x72\x45\x65\x2F\x58\x58\x70\x31\x6F\x34\x2F\x6E\x56\x6D\x63\x71\x43\x61\x47\x2F\x42\x53\x67\x56\x52\x33\x4F\x7A\x68\x56\x55\x47\x38\x2F\x58\x34\x6B\x52\x43\x43\x55\x3D\x22"
new_bytes = b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
with open(f"{path}\\DeadByDaylight\\Content\\Paks\\pakchunk0-WindowsNoEditor.pak", "r+b") as file, mmap(file.fileno(), 0, access=ACCESS_WRITE) as s:
i = s.find(start_bytes)
if i != -1:
s[i:i + len(new_bytes)] = new_bytes
if __name__ == '__main__':
print("Open directory.")
path = open_path()
if path:
if path.endswith(r"/"):
pass
else:
path = path + "/"
print("Wait process...")
wait_process()
print("OK, start path file...")
while True:
names = process_list()
if "DeadByDaylight" not in names:
break
sleep(0.3)
replace_bytes()
print("Done!"
"\nWait close game")
while True:
names = process_list()
if "EasyAntiCheat" not in names:
restore_bytes()
break
sleep(5)
print("File restored!")
input("Press Enter for exit")
else:
sleep(3)