-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroblox.py
48 lines (39 loc) · 1.4 KB
/
roblox.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
import ctypes
from ctypes import wintypes
TH32CS_SNAPPROCESS = 0x00000002
class PROCESSENTRY32(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("cntUsage", wintypes.DWORD),
("th32ProcessID", wintypes.DWORD),
("th32DefaultHeapID", wintypes.LPVOID),
("th32ModuleID", wintypes.DWORD),
("cntThreads", wintypes.DWORD),
("th32ParentProcessID", wintypes.DWORD),
("pcPriClassBase", wintypes.LONG),
("dwFlags", wintypes.DWORD),
("szExeFile", wintypes.CHAR * 260)
]
kernel32 = ctypes.WinDLL("kernel32.dll")
def nt_get_roblox_pid():
process_id = 0
h_snapshot = kernel32.CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
if h_snapshot == -1:
return process_id
pe32 = PROCESSENTRY32()
pe32.dwSize = ctypes.sizeof(PROCESSENTRY32)
if kernel32.Process32First(h_snapshot, ctypes.byref(pe32)):
while True:
if pe32.szExeFile.decode('utf-8').lower() == "robloxplayerbeta.exe":
process_id = pe32.th32ProcessID
break
if not kernel32.Process32Next(h_snapshot, ctypes.byref(pe32)):
break
kernel32.CloseHandle(h_snapshot)
return process_id
if __name__ == "__main__":
roblox_pid = nt_get_roblox_pid()
if roblox_pid:
print(f"Roblox process ID: {roblox_pid}")
else:
print("Roblox process not found.")