-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlive_analysis.py
More file actions
1546 lines (1323 loc) · 62.1 KB
/
Copy pathlive_analysis.py
File metadata and controls
1546 lines (1323 loc) · 62.1 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Análise AO VIVO do processo Roblox:
- Lista TODAS as DLLs carregadas (memory_maps)
- Flagga DLLs em paths suspeitos (Temp/Downloads/Desktop/AppData)
- Verifica assinatura digital via WinVerifyTrust
- Match contra database de keywords
Cheat injetado fica EXPOSTO mesmo se o arquivo foi apagado depois,
porque a DLL ainda tá no espaço de endereço do Roblox.
"""
from models import _result, _item, _fmt_ts
import os
import ctypes
from ctypes import wintypes
from datetime import datetime
import functools
import debug
from database import (
ROBLOX_PROCESS_NAMES,
TRUSTED_DLL_PATHS,
SUSPICIOUS_DLL_PATHS,
)
try:
import psutil
HAS_PSUTIL = True
except ImportError:
HAS_PSUTIL = False
# ============================ Win32/NT Memory & Debugger setup ============================
PROCESS_QUERY_INFORMATION = 0x0400
PROCESS_VM_READ = 0x0010
MEM_COMMIT = 0x1000
MEM_PRIVATE = 0x20000
MEM_IMAGE = 0x1000000 # região mapeada de arquivo de imagem (.exe/.dll)
PAGE_EXECUTE = 0x10
PAGE_EXECUTE_READ = 0x20
PAGE_EXECUTE_READWRITE = 0x40
PAGE_EXECUTE_WRITECOPY = 0x80
EXECUTE_PROTECTIONS = (
PAGE_EXECUTE,
PAGE_EXECUTE_READ,
PAGE_EXECUTE_READWRITE,
PAGE_EXECUTE_WRITECOPY
)
class MEMORY_BASIC_INFORMATION(ctypes.Structure):
_fields_ = [
("BaseAddress", ctypes.c_void_p),
("AllocationBase", ctypes.c_void_p),
("AllocationProtect", wintypes.DWORD),
("PartitionId", wintypes.WORD),
("RegionSize", ctypes.c_size_t),
("State", wintypes.DWORD),
("Protect", wintypes.DWORD),
("Type", wintypes.DWORD),
]
try:
kernel32 = ctypes.windll.kernel32
# OpenProcess
kernel32.OpenProcess.argtypes = [wintypes.DWORD, wintypes.BOOL, wintypes.DWORD]
kernel32.OpenProcess.restype = wintypes.HANDLE
# CloseHandle
kernel32.CloseHandle.argtypes = [wintypes.HANDLE]
kernel32.CloseHandle.restype = wintypes.BOOL
# VirtualQueryEx
kernel32.VirtualQueryEx.argtypes = [
wintypes.HANDLE,
ctypes.c_void_p,
ctypes.POINTER(MEMORY_BASIC_INFORMATION),
ctypes.c_size_t
]
kernel32.VirtualQueryEx.restype = ctypes.c_size_t
# ReadProcessMemory
kernel32.ReadProcessMemory.argtypes = [
wintypes.HANDLE,
ctypes.c_void_p,
ctypes.c_void_p,
ctypes.c_size_t,
ctypes.POINTER(ctypes.c_size_t)
]
kernel32.ReadProcessMemory.restype = wintypes.BOOL
# CheckRemoteDebuggerPresent
kernel32.CheckRemoteDebuggerPresent.argtypes = [wintypes.HANDLE, ctypes.POINTER(wintypes.BOOL)]
kernel32.CheckRemoteDebuggerPresent.restype = wintypes.BOOL
# IsWow64Process — pra pular alvos 32-bit (WOW64) na leitura do PEB de 64-bit
kernel32.IsWow64Process.argtypes = [wintypes.HANDLE, ctypes.POINTER(wintypes.BOOL)]
kernel32.IsWow64Process.restype = wintypes.BOOL
except (AttributeError, OSError):
pass
try:
ntdll = ctypes.windll.ntdll
ntdll.NtQueryInformationProcess.argtypes = [
wintypes.HANDLE,
ctypes.c_int, # ProcessInformationClass
ctypes.c_void_p, # ProcessInformation
wintypes.ULONG, # ProcessInformationLength
ctypes.POINTER(wintypes.ULONG) # ReturnLength
]
ntdll.NtQueryInformationProcess.restype = ctypes.c_long # NTSTATUS
except (AttributeError, OSError):
pass
# ProcessBasicInformation (class 0) → dá o PebBaseAddress. Layout x64; o ctypes
# cuida do alinhamento do ponteiro depois do ExitStatus (LONG).
class PROCESS_BASIC_INFORMATION(ctypes.Structure):
_fields_ = [
("ExitStatus", ctypes.c_long), # NTSTATUS
("PebBaseAddress", ctypes.c_void_p),
("AffinityMask", ctypes.c_void_p), # ULONG_PTR
("BasePriority", ctypes.c_long), # KPRIORITY
("UniqueProcessId", ctypes.c_void_p), # ULONG_PTR
("InheritedFromUniqueProcessId", ctypes.c_void_p),
]
# ============================ WinVerifyTrust setup ============================
class GUID(ctypes.Structure):
_fields_ = [
("Data1", ctypes.c_ulong),
("Data2", ctypes.c_ushort),
("Data3", ctypes.c_ushort),
("Data4", ctypes.c_ubyte * 8),
]
class WINTRUST_FILE_INFO(ctypes.Structure):
_fields_ = [
("cbStruct", ctypes.c_ulong),
("pcwszFilePath", ctypes.c_wchar_p),
("hFile", wintypes.HANDLE),
("pgKnownSubject", ctypes.POINTER(GUID)),
]
class WINTRUST_DATA(ctypes.Structure):
_fields_ = [
("cbStruct", ctypes.c_ulong),
("pPolicyCallbackData", ctypes.c_void_p),
("pSIPClientData", ctypes.c_void_p),
("dwUIChoice", ctypes.c_ulong),
("fdwRevocationChecks", ctypes.c_ulong),
("dwUnionChoice", ctypes.c_ulong),
("pFile", ctypes.POINTER(WINTRUST_FILE_INFO)),
("dwStateAction", ctypes.c_ulong),
("hWVTStateData", wintypes.HANDLE),
("pwszURLReference", ctypes.c_wchar_p),
("dwProvFlags", ctypes.c_ulong),
("dwUIContext", ctypes.c_ulong),
("pSignatureSettings", ctypes.c_void_p),
]
WTD_UI_NONE = 2
WTD_REVOKE_NONE = 0
WTD_CHOICE_FILE = 1
WTD_STATEACTION_VERIFY = 1
WTD_STATEACTION_CLOSE = 2
# {00AAC56B-CD44-11d0-8CC2-00C04FC295EE} - WINTRUST_ACTION_GENERIC_VERIFY_V2
WINTRUST_ACTION_GENERIC_VERIFY_V2 = GUID(
0x00AAC56B, 0xCD44, 0x11d0,
(ctypes.c_ubyte * 8)(0x8C, 0xC2, 0x00, 0xC0, 0x4F, 0xC2, 0x95, 0xEE),
)
@functools.lru_cache(maxsize=1024)
def _is_dll_signed(path: str) -> bool | None:
"""
Retorna True se DLL é assinada e válida, False se inválida, None se erro.
"""
if not os.path.isfile(path):
return None
try:
wintrust = ctypes.windll.wintrust
except OSError:
return None
file_info = WINTRUST_FILE_INFO()
file_info.cbStruct = ctypes.sizeof(WINTRUST_FILE_INFO)
file_info.pcwszFilePath = path
file_info.hFile = None
file_info.pgKnownSubject = None
data = WINTRUST_DATA()
data.cbStruct = ctypes.sizeof(WINTRUST_DATA)
data.dwUIChoice = WTD_UI_NONE
data.fdwRevocationChecks = WTD_REVOKE_NONE
data.dwUnionChoice = WTD_CHOICE_FILE
data.pFile = ctypes.pointer(file_info)
data.dwStateAction = WTD_STATEACTION_VERIFY
data.dwProvFlags = 0
data.dwUIContext = 0
try:
result = wintrust.WinVerifyTrust(None,
ctypes.byref(WINTRUST_ACTION_GENERIC_VERIFY_V2),
ctypes.byref(data))
# Cleanup
data.dwStateAction = WTD_STATEACTION_CLOSE
wintrust.WinVerifyTrust(None,
ctypes.byref(WINTRUST_ACTION_GENERIC_VERIFY_V2),
ctypes.byref(data))
return result == 0
except (OSError, ctypes.ArgumentError):
return None
# ============================ Helpers ============================
def _match_keyword(text: str):
# Delega pro matching central (word-boundary, anti-FP).
import matching
return matching.match_keyword(text)
def _classify_dll_path(path: str) -> tuple[str, str]:
"""
Retorna (categoria, severity).
Categorias: trusted, suspicious-path, user-folder, normal.
"""
if not path:
return "unknown", "low"
lower = path.lower().replace("/", "\\")
# Path-based suspicious
for sus in SUSPICIOUS_DLL_PATHS:
if sus in lower:
return "suspicious-path", "high"
# Trusted system paths
for trust in TRUSTED_DLL_PATHS:
if lower.startswith(trust):
return "trusted", "low"
# Outside C:\Windows + outside Program Files = suspeito
if not lower.startswith(("c:\\windows", "c:\\program files",
"c:\\programdata\\microsoft",
"c:\\users\\all users\\microsoft")):
return "non-standard", "medium"
return "normal", "low"
# ============================ Main scanner ============================
def scan_roblox_dll_injection() -> dict:
"""
Lista todas as DLLs carregadas em cada processo do Roblox que estiver rodando.
Flag as não-assinadas, as de paths suspeitos, e as que matcham keyword.
Pega cheat INJETADO mesmo se rodando agora.
"""
if not HAS_PSUTIL:
return _result("DLL Injection (Roblox)", "Análise live do processo Roblox",
[], error="psutil não instalado")
items = []
target_pids = []
roblox_names_lower = {n.lower() for n in ROBLOX_PROCESS_NAMES}
# Acha processos do Roblox
for proc in psutil.process_iter(["pid", "name", "exe", "create_time"]):
try:
name = (proc.info.get("name") or "")
if name in ROBLOX_PROCESS_NAMES or name.lower() in roblox_names_lower:
target_pids.append((proc.info["pid"], name, proc.info.get("exe", ""),
proc.info.get("create_time", 0)))
except (psutil.NoSuchProcess, psutil.AccessDenied):
continue
if not target_pids:
return _result("DLL Injection (Roblox)",
"Análise live do processo Roblox",
[], error="Nenhum processo Roblox rodando agora — abra o jogo primeiro")
# Pra cada PID alvo, lista DLLs
for pid, name, exe, created in target_pids:
try:
proc = psutil.Process(pid)
mmaps = proc.memory_maps(grouped=True)
except (psutil.NoSuchProcess, psutil.AccessDenied) as e:
items.append(_item(
label=f"PID {pid} ({name})",
detail=f"Sem acesso ao processo (rode como admin): {e}",
severity="medium", matched="access-denied",
))
continue
ts_created = ""
try:
ts_created = datetime.fromtimestamp(created).strftime("%Y-%m-%d %H:%M:%S")
except (ValueError, OSError):
pass
# Header sobre o processo (informativo, não conta como DLL suspeita)
items.append(_item(
label=f"[PROCESSO] PID {pid} — {name}",
detail=f"Iniciado em {ts_created} | exe: {exe}",
severity="low", matched="roblox-running", timestamp=ts_created,
meta_only=True,
))
for m in mmaps:
path = getattr(m, "path", "") or ""
if not path:
continue
# Só DLLs (e .ocx, .acm — bibliotecas em geral)
if not path.lower().endswith((".dll", ".ocx", ".acm", ".drv", ".exe")):
continue
category, severity = _classify_dll_path(path)
matched = None
# Keyword match
kw, kw_sev = _match_keyword(path)
if kw:
matched = kw
severity = "high"
# Path suspeito mata o rolê
if category == "suspicious-path":
matched = matched or "path-suspeito"
# Trusted = pula
if category == "trusted" and not matched:
continue
# Verifica assinatura SE não é trusted nem matched
signed = None
if category not in ("trusted",):
signed = _is_dll_signed(path)
if signed is False:
if severity == "low":
severity = "medium"
matched = matched or "DLL não assinada"
elif signed is True and not matched:
# Assinada + não-trusted-path = ainda informativo
if category == "non-standard":
continue # Skip - signed, just outside normal paths
if not matched and category == "non-standard":
matched = "DLL fora de paths padrão"
if not matched:
continue
sig_tag = "✓ assinada" if signed is True else (
"✗ NÃO assinada" if signed is False else "? assinatura desconhecida")
items.append(_item(
label=f"DLL: {os.path.basename(path)}",
detail=f"{path}\n[{sig_tag} · cat: {category}]",
severity=severity, matched=matched, timestamp="",
))
return _result("DLL Injection (Roblox)",
"DLLs carregadas no processo do Roblox AGORA (pega cheat ativo)",
items)
# ============================ Process tree ============================
def scan_process_tree() -> dict:
"""
Lista processos com seu parent. Roblox spawnado por algo que NÃO é
explorer.exe / bloxstrap.exe / RobloxPlayerLauncher.exe = vermelho
(alguém pode tê-lo executado via injector).
"""
if not HAS_PSUTIL:
return _result("Process Tree", "Árvore de processos do Roblox", [],
error="psutil não instalado")
LEGIT_PARENTS = {
"explorer.exe", "bloxstrap.exe", "robloxplayerlauncher.exe",
"robloxplayerinstaller.exe", "microsoftedge.exe", "msedge.exe",
"chrome.exe", "firefox.exe", "brave.exe", "opera.exe",
"rundll32.exe", "shellexp.exe", "winlogon.exe", "services.exe",
"svchost.exe", "wininit.exe",
}
items = []
roblox_names_lower = {n.lower() for n in ROBLOX_PROCESS_NAMES}
for proc in psutil.process_iter(["pid", "name", "ppid"]):
try:
name = (proc.info.get("name") or "").lower()
if name not in roblox_names_lower:
continue
ppid = proc.info.get("ppid", 0)
parent_unknown = False
try:
parent = psutil.Process(ppid)
parent_name = parent.name()
try:
parent_exe = parent.exe()
except (psutil.AccessDenied, PermissionError):
parent_exe = "(sem acesso)"
except (psutil.NoSuchProcess, psutil.AccessDenied):
parent_unknown = True
parent_name = "?"
parent_exe = "?"
# Se não conseguiu ler o parent, NÃO flag (precisaria admin)
if parent_unknown:
continue
ok = parent_name.lower() in LEGIT_PARENTS
if ok:
continue
items.append(_item(
label=f"{proc.info['name']} spawnado por {parent_name}",
detail=f"Parent exe: {parent_exe} | PIDs: {ppid} → {proc.info['pid']}",
severity="high", matched=f"parent={parent_name}",
))
except (psutil.NoSuchProcess, psutil.AccessDenied):
continue
return _result("Process Tree (Roblox)",
"Verifica quem spawnou o Roblox (injection chain?)",
items)
# ============================ Overlay / ESP externo ============================
# Processos que legitimamente desenham overlay click-through (NÃO são cheat).
OVERLAY_WHITELIST = {
# Comunicação
"discord.exe", "discordcanary.exe", "discordptb.exe", "discorddevelopment.exe",
# NVIDIA / AMD / Intel
"nvcontainer.exe", "nvidia share.exe", "nvidia web helper.exe",
"nvidiaoverlay.exe", "amddvr.exe", "radeonsoftware.exe",
# Captura / streaming
"obs64.exe", "obs32.exe", "obs.exe", "streamlabs obs.exe",
"xsplit.core.exe", "action.exe",
"medal.exe", "medalencoder.exe", "medal-helper.exe",
"overwolf.exe", "overwolfbrowser.exe", "overwolfhelper.exe",
# Steam / launchers
"steam.exe", "gameoverlayui.exe", "steamwebhelper.exe",
"epicgameslauncher.exe", "galaxyclient.exe",
# Monitoramento / RGB / periferia
"rtss.exe", "msiafterburner.exe", "rivatunerstatisticsserver.exe",
"nahimicsvc.exe", "nahimic3.exe", "lghub.exe", "lghub_agent.exe",
"razer synapse.exe", "icue.exe", "wallpaper32.exe", "wallpaper64.exe",
"steelseriesgg.exe", "steelseriesengine.exe",
# Windows / shell (overlays nativos: Game Bar, IME, notificações, snip)
"explorer.exe", "textinputhost.exe", "applicationframehost.exe",
"shellexperiencehost.exe", "startmenuexperiencehost.exe",
"searchhost.exe", "searchapp.exe", "gamebar.exe", "gamebarft.exe",
"xboxgamebar.exe", "snippingtool.exe", "screenclippinghost.exe",
"lockapp.exe", "peopleexperiencehost.exe", "systemsettings.exe",
# Acessibilidade / utilidades comuns
"magnify.exe", "narrator.exe", "powertoys.exe", "powertoys.awake.exe",
"flow.launcher.exe", "translucenttb.exe", "f.lux.exe", "flux.exe",
"1password.exe", "bitwarden.exe", "everything.exe",
}
# Extended window styles (Win32)
GWL_EXSTYLE = -20
WS_EX_LAYERED = 0x00080000
WS_EX_TRANSPARENT = 0x00000020
WS_EX_TOPMOST = 0x00000008
def scan_overlay_windows() -> dict:
"""
Detecta janelas de OVERLAY click-through: LAYERED + TRANSPARENT + TOPMOST.
Essa combinação = janela invisível ao clique desenhada por cima de tudo —
assinatura clássica de ESP/radar/aimbot visual externo (que não injeta DLL).
Whitelist generosa cobre overlays legítimos (Discord, NVIDIA, Steam, OBS,
RTSS, Game Bar, etc.). O resto vira MEDIUM (pode haver overlay legítimo
desconhecido — não é prova, é pista pra revisar).
"""
if not HAS_PSUTIL:
return _result("Overlay / ESP externo", "Janelas overlay click-through", [],
error="psutil não instalado")
try:
user32 = ctypes.windll.user32
except (AttributeError, OSError):
return _result("Overlay / ESP externo", "Janelas overlay click-through", [],
error="user32 indisponível (não é Windows?)")
items = []
seen_pids = set()
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, wintypes.HWND, ctypes.c_void_p)
def callback(hwnd, _lparam):
try:
if not user32.IsWindowVisible(hwnd):
return True
ex = user32.GetWindowLongW(hwnd, GWL_EXSTYLE) & 0xFFFFFFFF
# Assinatura de overlay de cheat: invisível ao clique + por cima
if not (ex & WS_EX_LAYERED and ex & WS_EX_TRANSPARENT and ex & WS_EX_TOPMOST):
return True
pid = wintypes.DWORD()
user32.GetWindowThreadProcessId(hwnd, ctypes.byref(pid))
pid_val = pid.value
if pid_val in seen_pids:
return True
seen_pids.add(pid_val)
try:
pname = psutil.Process(pid_val).name().lower()
except (psutil.NoSuchProcess, psutil.AccessDenied):
pname = "?"
if pname in OVERLAY_WHITELIST:
return True
# Título da janela (contexto)
length = user32.GetWindowTextLengthW(hwnd)
title = ""
if length > 0:
buf = ctypes.create_unicode_buffer(length + 1)
user32.GetWindowTextW(hwnd, buf, length + 1)
title = buf.value or ""
items.append(_item(
label=f"Overlay click-through: {pname}",
detail=f"PID {pid_val} · janela invisível ao clique sobreposta "
f"(LAYERED+TRANSPARENT+TOPMOST)"
+ (f" · título: '{title}'" if title else " · sem título"),
severity="medium", matched=f"overlay:{pname}",
))
except Exception as e:
debug.dbg(f"overlay scan falhou em {pname}", e)
return True
try:
user32.EnumWindows(EnumWindowsProc(callback), 0)
except Exception as e:
return _result("Overlay / ESP externo", "Janelas overlay click-through", [],
error=str(e))
return _result("Overlay / ESP externo",
"Janelas overlay invisíveis ao clique sobre a tela (ESP/radar externo)",
items)
# ============================ Detecção estrutural (comportamental) ============================
# Locais onde o usuário pode escrever sem admin — onde executores se instalam.
_EXECUTOR_STRUCT_ROOTS = [
r"%LOCALAPPDATA%",
r"%APPDATA%",
r"%LOCALAPPDATA%\Programs",
r"%USERPROFILE%\Downloads",
]
# Pastas-marcador de runtime embutido que executores modernos (Solara, Wave,
# Velocity, etc.) carregam junto pra renderizar a UI. Apps legítimos com
# WebView2 deixam só DADOS no AppData e o .exe ASSINADO em Program Files —
# executores largam o .exe (não-assinado) NA MESMA pasta do runtime.
_EMBEDDED_RUNTIME_MARKERS = ("EBWebView", "msedgewebview2.exe", "cef", "libcef.dll")
# Pastas do próprio Windows/Microsoft que nunca devem ser flagadas mesmo se
# casarem o padrão (defesa extra contra FP).
_STRUCT_WHITELIST_SUBSTR = (
"\\microsoft\\", "\\windows\\", "\\packages\\microsoft",
"\\google\\", "\\discord", "\\microsoftedge",
)
def _has_embedded_runtime(folder: str, subdirs: list, files: list) -> bool:
"""A pasta tem um runtime web embutido (marca de UI de executor)?"""
lower_subs = {d.lower() for d in subdirs}
lower_files = {f.lower() for f in files}
for m in _EMBEDDED_RUNTIME_MARKERS:
ml = m.lower()
if ml in lower_subs or ml in lower_files:
return True
# EBWebView um nível abaixo (padrão comum: <exe> + <sub>/EBWebView)
for sub in subdirs:
try:
if os.path.isdir(os.path.join(folder, sub, "EBWebView")):
return True
except OSError:
pass
return False
def scan_executor_structure() -> dict:
"""
Detecção COMPORTAMENTAL de executor — pega mesmo renomeado.
Em vez de bater no NOME ('solara.exe'), bate na ESTRUTURA: um .exe
NÃO-ASSINADO na mesma pasta de um runtime web embutido (EBWebView/CEF),
em local gravável pelo usuário. Esse é o fingerprint de Solara/Wave/
Velocity/etc — e sobrevive a renomear o arquivo E a pasta.
Conservador de propósito (anti-FP):
- Exige runtime embutido + exe não-assinado JUNTOS (apps legítimos
com WebView2 deixam o exe assinado em Program Files).
- Severidade MEDIUM — sozinho vira no máximo SUSPECT no Confidence
Engine; só CONFIRMA se corroborado por outra fonte.
- Whitelist de pastas Microsoft/Windows/Google/Discord.
- Validado: 0 hits em PC limpo com Roblox + dezenas de apps WebView2.
"""
items = []
seen = set()
checked = 0
MAX_CHECK = 400 # teto de exes verificados (perf)
for raw_root in _EXECUTOR_STRUCT_ROOTS:
root = os.path.expandvars(raw_root)
if not os.path.isdir(root):
continue
for dirpath, dirnames, filenames in os.walk(root):
depth = dirpath[len(root):].count(os.sep)
if depth > 3:
dirnames[:] = []
continue
if dirpath in seen:
continue
seen.add(dirpath)
low_dir = dirpath.lower()
if any(w in low_dir for w in _STRUCT_WHITELIST_SUBSTR):
continue
exes = [f for f in filenames if f.lower().endswith(".exe")]
if not exes:
continue
if not _has_embedded_runtime(dirpath, dirnames, filenames):
continue
for exe in exes:
if checked >= MAX_CHECK:
break
exe_path = os.path.join(dirpath, exe)
checked += 1
signed = _is_dll_signed(exe_path) # WinVerifyTrust serve p/ exe
# Só flaga quando é COMPROVADAMENTE não-assinado (False).
# None = não deu pra determinar (WinVerifyTrust indisponível,
# erro, arquivo travado) → benefício da dúvida, NÃO flaga.
# Isso evita tempestade de FP se a verificação de assinatura
# falhar sistemicamente. Não perde detecção real: executor de
# verdade é um PE válido não-assinado, que retorna False.
if signed is not False:
continue
# comprovadamente não-assinado + runtime embutido = sinal
try:
mtime = _fmt_ts(os.path.getmtime(exe_path))
except OSError:
mtime = ""
folder_name = os.path.basename(dirpath)
items.append(_item(
label=f"Estrutura de executor: {exe}",
detail=f"{exe_path}\nExe NÃO-ASSINADO na mesma pasta de um runtime "
f"web embutido (EBWebView/CEF) — fingerprint de executor "
f"Roblox moderno (Solara/Wave/Velocity/etc). Pega mesmo "
f"se o arquivo foi renomeado.",
severity="medium",
matched=f"executor-struct:{folder_name.lower()}",
timestamp=mtime,
))
if checked >= MAX_CHECK:
break
return _result(
"Estrutura de executor (comportamental)",
"Exe não-assinado + runtime web embutido em pasta de usuário — pega executor renomeado",
items,
)
# ============================ Integridade do launcher do Roblox ============================
# Binários oficiais do Roblox rodados na execução do jogo — SEMPRE assinados
# pela Roblox Corporation. Um destes com assinatura QUEBRADA = adulterado
# (patcheado pra injetar).
#
# Installers (RobloxPlayerInstaller.exe / RobloxStudioInstaller.exe) NÃO estão
# aqui: eles vêm DISTRIBUÍDOS SEM ASSINATURA (verificado com Get-AuthenticodeSignature
# → NotSigned) porque servem como dropper leve — só rodam durante setup, não
# fazem parte do fluxo de execução. Testar assinatura deles gerava FP em toda
# máquina com Roblox instalado (v3.43.7 e anteriores).
_ROBLOX_OFFICIAL_BINARIES = {
"robloxplayerbeta.exe",
"robloxplayerlauncher.exe",
"robloxstudiobeta.exe",
"robloxstudiolauncherbeta.exe",
}
_ROBLOX_INSTALLERS = {
"robloxplayerinstaller.exe",
"robloxstudioinstaller.exe",
}
# Nomes que um dropper usaria pra se passar por launcher do Roblox.
# robloxcrashhandler.exe adicionado v3.49.0: Winter Bypass usa como disfarce
# (extraído do zip como `RobloxCrashHandler.exe` no Downloads).
_ROBLOX_MASQUERADE_NAMES = _ROBLOX_OFFICIAL_BINARIES | _ROBLOX_INSTALLERS | {
"roblox.exe", "robloxplayer.exe", "robloxlauncher.exe",
"roblox launcher.exe", "roblox player.exe",
"robloxcrashhandler.exe",
}
# Raiz oficial de instalação. Tudo com nome de launcher FORA daqui é suspeito.
def _roblox_official_root() -> str:
return os.path.expandvars(r"%LOCALAPPDATA%\Roblox").lower().replace("/", "\\")
# Pastas graváveis pelo usuário onde um launcher falso/dropper costuma cair.
_LAUNCHER_WRONG_LOCATIONS = [
r"%USERPROFILE%\Downloads",
r"%USERPROFILE%\Desktop",
r"%USERPROFILE%\Documents",
r"%TEMP%",
r"%APPDATA%",
r"%LOCALAPPDATA%\Temp",
]
def scan_roblox_launcher_integrity() -> dict:
"""
Detecta LAUNCHER DO ROBLOX MODIFICADO — o que a comunidade pediu.
Dois cenários:
1. Binário oficial do Roblox (RobloxPlayerBeta.exe etc) no path de
instalação, mas com ASSINATURA QUEBRADA → foi patcheado pra
injetar na inicialização. Sinal forte (HIGH): o Roblox SEMPRE
assina seus binários.
2. Arquivo com nome de launcher do Roblox numa pasta de usuário
(Downloads/Desktop/Temp) e NÃO-ASSINADO → dropper se passando
por launcher oficial. (Assinado em pasta de usuário = instalador
real baixado, não flaga.)
Anti-FP (validado: 9 binários oficiais nesta máquina, todos assinados):
- Só flaga assinatura COMPROVADAMENTE quebrada (False), nunca
indeterminada (None).
- Bloxstrap (bootstrapper open-source legítimo) usa RobloxPlayerBeta
oficial assinado — não cai aqui. Fishstrap NÃO — descoberto em
07/2026 como wrapper do Winter Bypass.
- Instalador oficial assinado em Downloads é ignorado.
"""
items = []
seen = set()
# --- Cenário 1: binário oficial adulterado (assinatura quebrada) ---
roblox_root = _roblox_official_root()
if os.path.isdir(roblox_root):
for dirpath, dirnames, filenames in os.walk(roblox_root):
if dirpath[len(roblox_root):].count(os.sep) > 5:
dirnames[:] = []
continue
for f in filenames:
if f.lower() not in _ROBLOX_OFFICIAL_BINARIES:
continue
p = os.path.join(dirpath, f)
if p.lower() in seen:
continue
seen.add(p.lower())
signed = _is_dll_signed(p)
if signed is False: # comprovadamente quebrada/ausente
try:
mtime = _fmt_ts(os.path.getmtime(p))
except OSError:
mtime = ""
items.append(_item(
label=f"Launcher do Roblox ADULTERADO: {f}",
detail=f"{p}\nBinário oficial do Roblox com assinatura digital "
f"QUEBRADA/INVÁLIDA. O Roblox sempre assina seus binários — "
f"assinatura quebrada = arquivo modificado (patcheado pra "
f"injetar na inicialização). Sinal forte de bypass.",
severity="high",
matched=f"launcher-tampered:{f.lower()}",
timestamp=mtime,
))
# --- Cenário 2: dropper se passando por launcher em pasta de usuário ---
for raw_loc in _LAUNCHER_WRONG_LOCATIONS:
loc = os.path.expandvars(raw_loc)
if not os.path.isdir(loc):
continue
try:
entries = os.listdir(loc)
except OSError:
continue
for name in entries:
if name.lower() not in _ROBLOX_MASQUERADE_NAMES:
continue
p = os.path.join(loc, name)
if not os.path.isfile(p) or p.lower() in seen:
continue
seen.add(p.lower())
# Já está fora do path oficial. Assinado = instalador real baixado
# (ignora). Não-assinado/quebrado = dropper disfarçado.
signed = _is_dll_signed(p)
if signed is False:
try:
mtime = _fmt_ts(os.path.getmtime(p))
except OSError:
mtime = ""
items.append(_item(
label=f"Launcher do Roblox FALSO: {name}",
detail=f"{p}\nArquivo com nome de launcher do Roblox numa pasta de "
f"usuário, NÃO-ASSINADO. O launcher oficial fica em "
f"%LOCALAPPDATA%\\Roblox\\Versions e é assinado. Um não-assinado "
f"aqui é um dropper/executor se passando por Roblox.",
severity="high",
matched=f"launcher-fake:{name.lower()}",
timestamp=mtime,
))
return _result(
"Integridade do launcher do Roblox",
"Launcher/player oficial adulterado (assinatura quebrada) ou dropper disfarçado de Roblox",
items,
)
# ============================ Processo suspenso (anti-bypass) ============================
# Apps que o Windows (ou o próprio app) legitimamente deixam em estado suspenso:
# UWP/Store em background, processos-filho de navegador, etc. Suspender esses é
# rotina do SO — não é sinal. Whitelist generosa pra não virar tempestade de FP.
_SUSPEND_WHITELIST = {
# Navegadores (suspendem abas/processos-filho)
"chrome.exe", "msedge.exe", "msedgewebview2.exe", "firefox.exe",
"brave.exe", "opera.exe", "opera_gx.exe", "iexplore.exe", "vivaldi.exe",
# Comunicação
"discord.exe", "discordcanary.exe", "discordptb.exe",
"slack.exe", "teams.exe", "msteams.exe", "whatsapp.exe", "telegram.exe",
# Plataformas / launchers
"steam.exe", "steamwebhelper.exe", "epicgameslauncher.exe",
# Shell / UWP comuns (o Windows suspende em background)
"explorer.exe", "searchhost.exe", "searchapp.exe", "searchindexer.exe",
"startmenuexperiencehost.exe", "shellexperiencehost.exe",
"textinputhost.exe", "applicationframehost.exe", "systemsettings.exe",
"widgets.exe", "widgetservice.exe", "phoneexperiencehost.exe",
"yourphone.exe", "gamebar.exe", "xboxgamebar.exe", "gamebarftserver.exe",
"lockapp.exe", "peopleexperiencehost.exe", "runtimebroker.exe",
}
# Processos suspensos vivendo em pasta de app empacotado (UWP/Store) ou system
# app são esperados — o Windows suspende esses em background. Não flaga.
_SUSPEND_SKIP_PATH_SUBSTR = (
"\\windowsapps\\", "\\appdata\\local\\packages\\",
"\\systemapps\\", "\\windows\\systemapps\\",
)
# Debuggers / IDEs: quando depuram um programa, o processo-FILHO fica em estado
# SUSPENSO no breakpoint. Um dev pausando o próprio .exe não-assinado (recém
# compilado em pasta de usuário) cairia no MEDIUM — FP. Se o PAI do suspenso é
# um destes, é sessão de debug, não cheat pausado. (Só afeta o MEDIUM; executor
# conhecido suspenso continua HIGH independentemente do pai.)
_DEBUGGER_PARENT_NAMES = {
"devenv.exe", "vsdbg.exe", "vshost.exe", "msvsmon.exe",
"windbg.exe", "windbgx.exe", "cdb.exe", "x64dbg.exe", "x32dbg.exe",
"ollydbg.exe", "dnspy.exe", "dnspy-x86.exe", "ida.exe", "ida64.exe",
"pycharm64.exe", "pycharm.exe", "idea64.exe", "idea.exe",
"clion64.exe", "rider64.exe", "webstorm64.exe", "goland64.exe",
"code.exe", "cursor.exe", "gdb.exe", "lldb.exe", "node.exe",
"_pydevd_bundle", "debugpy",
}
def _parent_is_debugger(proc) -> bool:
"""True se o processo-pai do suspenso é um debugger/IDE conhecido.
Defensivo: qualquer erro de acesso → False (não suprime na dúvida)."""
try:
parent = proc.parent()
if parent is None:
return False
pname = (parent.name() or "").lower()
return pname in _DEBUGGER_PARENT_NAMES
except Exception:
return False
def scan_suspended_processes() -> dict:
"""
Detecta processos em estado SUSPENSO (pausado) — método de anti-bypass.
Pausar o cheat durante a SS (Process Hacker → Suspend) faz ele parar de
aparecer como "rodando" e congela a atividade, mas o processo continua
carregado na memória. É um dos truques "anti-bypass" ensinados nos cursos
de telagem — e some quando o cara "reativa" o processo depois.
Conservador de propósito (anti-FP): o Windows suspende MUITO processo
legítimo (UWP em background, abas de navegador). Por isso só flaga quando,
ALÉM de suspenso, o processo é:
- de um executor conhecido (nome/exe casa keyword) -> HIGH; ou
- NÃO-ASSINADO rodando de pasta de usuário (Temp/Downloads/AppData) -> MEDIUM.
Whitelist cobre navegadores/Discord/shell e apps empacotados
(WindowsApps/Packages). Binário suspenso em system/Program Files é ignorado.
Sozinho, vira no máximo SUSPECT no Confidence Engine (medium) — só pesa de
verdade somado a outra fonte do mesmo alvo.
"""
if not HAS_PSUTIL:
return _result("Processos suspensos (anti-bypass)",
"Processos pausados/suspensos durante a SS",
[], error="psutil não instalado")
items = []
for proc in psutil.process_iter(["pid", "name", "exe", "status", "create_time"]):
try:
if proc.info.get("status") != psutil.STATUS_STOPPED:
continue
name = proc.info.get("name") or ""
exe = proc.info.get("exe") or ""
low_name = name.lower()
low_exe = exe.lower().replace("/", "\\")
# Suspensos legítimos: whitelist de app + paths de UWP/system app
if low_name in _SUSPEND_WHITELIST:
continue
if any(s in low_exe for s in _SUSPEND_SKIP_PATH_SUBSTR):
continue
category, _ = _classify_dll_path(exe)
# Suspenso em system/Program Files = raro mas benigno, ignora
if category == "trusted" or low_exe.startswith(
("c:\\windows", "c:\\program files")):
continue
ts = _fmt_ts(proc.info.get("create_time") or 0)
pid = proc.info.get("pid")
# Sinal 1: executor conhecido em estado suspenso -> forte
kw, _ = _match_keyword(name)
if not kw and exe:
kw, _ = _match_keyword(exe)
if kw:
items.append(_item(
label=f"Processo SUSPENSO: {name}",
detail=f"PID {pid} · {exe or '(exe desconhecido)'}\n"
f"Processo de executor conhecido em estado SUSPENSO (pausado). "
f"Pausar o cheat durante a SS pra ele parecer inativo é truque de "
f"anti-bypass — reative o processo pra inspecionar.",
severity="high", matched=kw, timestamp=ts,
))
continue
# Sinal 2: suspenso + não-assinado em pasta de usuário -> médio
if exe and category in ("suspicious-path", "non-standard"):
# FP de dev: processo pausado por debugger/IDE no breakpoint.
if _parent_is_debugger(proc):
continue
if _is_dll_signed(exe) is False:
items.append(_item(
label=f"Processo SUSPENSO não-assinado: {name}",
detail=f"PID {pid} · {exe}\n"
f"Processo NÃO-ASSINADO rodando de pasta de usuário e em estado "
f"SUSPENSO. Pode ser cheat pausado pra escapar da SS.",
severity="medium",
matched="processo-suspenso-nao-assinado", timestamp=ts,
))
except (psutil.NoSuchProcess, psutil.AccessDenied):
continue
except Exception:
continue
return _result(
"Processos suspensos (anti-bypass)",
"Processos pausados/suspensos — cheat pausado durante a SS pra parecer inativo",
items,
)
# ============================ Processo disfarçado de sistema (masquerading) ============================
# Nomes de processo do PRÓPRIO Windows que SÓ rodam de pasta do sistema. Renomear
# o cheat pra um destes e rodar de pasta de usuário é "process masquerading" —
# no Gerenciador de Tarefas/SS manual o cara vê "svchost.exe" e passa batido.
# FP ~zero: esses binários nunca rodam fora de System32/SysWOW64/WinSxS (e o
# explorer, de %WINDIR%). Os reais costumam ser protegidos (PPL) e nem expõem o
# path — esses a gente pula; o disfarçado em pasta de usuário expõe e é pego.
def _system_dirs():
win = os.environ.get("SystemRoot", r"C:\Windows").lower().replace("/", "\\").rstrip("\\")
sys32 = (f"{win}\\system32\\", f"{win}\\syswow64\\", f"{win}\\winsxs\\")