forked from Snaacky/diamond
-
Notifications
You must be signed in to change notification settings - Fork 1
/
diamond.py
42 lines (31 loc) · 1.76 KB
/
diamond.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
import pymem
import pymem.process
dwEntityList = (0x4CCDBFC)
dwGlowObjectManager = (0x520DA28)
m_iGlowIndex = (0xA3F8)
m_iTeamNum = (0xF4)
pm = pymem.Pymem("csgo.exe")
client = pymem.process.module_from_name(pm.process_handle, "client_panorama.dll").lpBaseOfDll
def main():
print("Diamond has launched.")
while True:
glow_manager = pm.read_int(client + dwGlowObjectManager)
for i in range(1, 32): # Entities 1-32 are reserved for players.
entity = pm.read_int(client + dwEntityList + i * 0x10)
if entity:
entity_team_id = pm.read_int(entity + m_iTeamNum)
entity_glow = pm.read_int(entity + m_iGlowIndex)
if entity_team_id == 2: # Terrorist
pm.write_float(glow_manager + entity_glow * 0x38 + 0x4, float(1)) # R
pm.write_float(glow_manager + entity_glow * 0x38 + 0x8, float(0)) # G
pm.write_float(glow_manager + entity_glow * 0x38 + 0xC, float(0)) # B
pm.write_float(glow_manager + entity_glow * 0x38 + 0x10, float(1)) # Alpha
pm.write_int(glow_manager + entity_glow * 0x38 + 0x24, 1) # Enable glow
elif entity_team_id == 3: # Counter-terrorist
pm.write_float(glow_manager + entity_glow * 0x38 + 0x4, float(0)) # R
pm.write_float(glow_manager + entity_glow * 0x38 + 0x8, float(0)) # G
pm.write_float(glow_manager + entity_glow * 0x38 + 0xC, float(1)) # B
pm.write_float(glow_manager + entity_glow * 0x38 + 0x10, float(1)) # Alpha
pm.write_int(glow_manager + entity_glow * 0x38 + 0x24, 1) # Enable glow
if __name__ == '__main__':
main()