-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
84 lines (71 loc) · 2.07 KB
/
main.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
import ctypes
import ntplib
import datetime
import time
import os
from console.utils import set_title
set_title("No Bitches?")
print()
print("""
vFix 1.0
Script Made By @LaweaCosmica [Discord]
s/@Haiers For The Method [Yotube]
""")
def sync_with_ntp():
c = ntplib.NTPClient()
response = c.request('pool.ntp.org', version=3)
ntp_time = datetime.datetime.fromtimestamp(response.tx_time)
return ntp_time
# Get Actual Date From NTP Server
print("[LOG] Starting Script...")
actual_date = sync_with_ntp()
original_date = actual_date
# get a new date
new_Date = datetime.datetime(2022, 10, 2)
# Def The SYSTEMTIME Struct for set the new date
class SYSTEMTIME(ctypes.Structure):
_fields_ = [("wYear", ctypes.c_uint16),
("wMonth", ctypes.c_uint16),
("wDayOfWeek", ctypes.c_uint16),
("wDay", ctypes.c_uint16),
("wHour", ctypes.c_uint16),
("wMinute", ctypes.c_uint16),
("wSecond", ctypes.c_uint16),
("wMilliseconds", ctypes.c_uint16)]
# Create SYSTEMTIME with a new date
new_system_time = SYSTEMTIME(
new_Date.year,
new_Date.month,
new_Date.weekday(),
new_Date.day,
actual_date.hour,
actual_date.minute,
actual_date.second,
0
)
# Call SetSystemTime Func
kernel32 = ctypes.WinDLL('kernel32.dll')
kernel32.SetLocalTime(ctypes.byref(new_system_time))
print("[LOG] vFix is Applied! (Working)")
print("Press Enter To Unload vFix (Restore)")
input()
print("[LOG] Unloading vFix...")
actual_date = sync_with_ntp()
# Restore to original
new_system_time2 = SYSTEMTIME(
original_date.year,
original_date.month,
original_date.weekday(),
original_date.day,
actual_date.hour,
actual_date.minute,
actual_date.second,
0
)
# Call SetSystemTime Func For Restore Date to Original
kernel32.SetLocalTime(ctypes.byref(new_system_time2))
print("[LOG] vFix Unloaded!")
time.sleep(1.5)
print("[Warning] Closing vFix...")
time.sleep(2.5)
os._exit(0)