a1987zz

Untitled

Sep 24th, 2021 (edited)
1,652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2.  
  3. Process = csgo.exe
  4. DLLName = client.dll
  5.  
  6. dwLocalPlayer = 0xD8C2CC
  7. dwEntityList = 0x4DA541C
  8.  
  9. dw_bSpotted = 0x93D
  10. dw_iTeamNum = 0xF4
  11. dw_bDormant = 0xED
  12.  
  13. Num = 0
  14.  
  15. Process, Exist, %Process%
  16. ProcessID = %ErrorLevel%
  17.  
  18. if (!ProcessID)
  19. {
  20. MsgBox, [!] CS:GO is not running!
  21. ExitApp
  22. }
  23.  
  24. ProcessHandle := GetProcessHandle("Counter-Strike: Global Offensive")
  25.  
  26. if (!ProcessHandle)
  27. {
  28. MsgBox, [!] Failed to get handle!
  29. ExitApp
  30. }
  31.  
  32. Client := GetDllBase(DLLName, ProcessID)
  33.  
  34. if (!Client)
  35. {
  36. MsgBox, [!] Failed to get %DLLName% from %Process%!
  37. ExitApp
  38. }
  39.  
  40. LocalPlayer := ReadMemory(Client + dwLocalPlayer, ProcessHandle)
  41. LocalTeam := ReadMemory(LocalPlayer + dw_iTeam, ProcessHandle)
  42. Loop
  43. {
  44. if (Num <= 64)
  45. Num++
  46. else
  47. Num = 1
  48.  
  49. BaseEntity := ReadMemory(Client + dwEntityList + ((Num - 1) * 0x10), ProcessHandle)
  50. if (BaseEntity)
  51. {
  52. EntityTeam := ReadMemory(BaseEntity + dw_iTeamNum, ProcessHandle)
  53. EntityDormant := ReadMemory(BaseEntity + dw_bDormant, ProcessHandle)
  54. if (EntityTeam != LocalTeam and !EntityDormant)
  55. WriteMemory(BaseEntity + dw_bSpotted, 1, ProcessHandle)
  56. }
  57. Sleep, 10
  58. }
  59.  
  60. ExitApp
  61.  
  62. ; needed functions - dont touch unless you know what youre doing
  63.  
  64. GetProcessHandle(name)
  65. {
  66. winget, pid, PID, %name%
  67. h := DllCall("OpenProcess", "int", 2035711, "char", 0, "UInt", pid, "UInt")
  68. return, h
  69. }
  70.  
  71. WriteMemory(address, newval, processhandle)
  72. {
  73. return DllCall("WriteProcessMemory", "UInt", processhandle, "UInt", address, "UInt*", newval, "UInt", 4, "UInt *", 0)
  74. }
  75.  
  76. ReadMemory(address, processhandle)
  77. {
  78. VarSetCapacity(addr,4,0)
  79. DllCall("ReadProcessMemory", "UInt", processhandle, "UInt", address, "Str", addr, "UInt", 4, "UInt *", 0)
  80. Loop 4
  81. result += *(&addr + A_Index-1) « 8*(A_Index-1)
  82. return, result
  83. }
  84.  
  85. GetDllBase(DllName, PID = 0)
  86. {
  87. TH32CS_SNAPMODULE := 0x00000008
  88. INVALID_HANDLE_VALUE = -1
  89. VarSetCapacity(me32, 548, 0)
  90. NumPut(548, me32)
  91. snapMod := DllCall("CreateToolhelp32Snapshot", "Uint", TH32CS_SNAPMODULE
  92. , "Uint", PID)
  93. If (snapMod = INVALID_HANDLE_VALUE) {
  94. Return 0
  95. }
  96.  
  97. If (DllCall("Module32First", "Uint", snapMod, "Uint", &me32)){
  98. while(DllCall("Module32Next", "Uint", snapMod, "UInt", &me32)) {
  99. If !DllCall("lstrcmpi", "Str", DllName, "UInt", &me32 + 32) {
  100. DllCall("CloseHandle", "UInt", snapMod)
  101. Return NumGet(&me32 + 20)
  102. }
  103. }
  104. }
  105. DllCall("CloseHandle", "Uint", snapMod)
  106. Return 0
  107. }
Add Comment
Please, Sign In to add comment