import pymem
from pymem import process
import keyboard
import time
from offsets import *
import configparser
pm = pymem.Pymem("csgo.exe")
client = pymem.process.module_from_name(pm.process_handle, "client.dll").lpBaseOfDll
COLOR_RAINBOW = [
[1, 0, 0, 1],
[1, 0.5, 0, 1],
[1, 1, 0, 1],
[0, 1, 0, 1],
[0, 0, 1, 1],
[0.5, 0, 1, 1],
]
current_color_index = 0
config = configparser.ConfigParser()
config.read('config.ini')
if 'Glow' not in config:
config['Glow'] = {}
config['Glow']['ColorIndex'] = '0'
def save_config():
config['Glow']['ColorIndex'] = str(current_color_index)
with open('config.ini', 'w') as configfile:
config.write(configfile)
def load_config():
global current_color_index
current_color_index = int(config['Glow']['ColorIndex'])
def change_color():
global current_color_index
current_color_index = (current_color_index + 1) % len(COLOR_RAINBOW)
save_config()
def glow_module():
time.sleep(2)
while True:
glow_manager = pm.read_int(client + dwGlowObjectManager)
local_player = pm.read_int(client + dwLocalPlayer)
local_player_team = pm.read_int(local_player + m_iTeamNum)
for i in range(64):
entity = pm.read_int(client + dwEntityList + i * 0x10)
if entity:
team = pm.read_int(entity + m_iTeamNum)
if team != local_player_team:
glow_index = pm.read_int(entity + m_iGlowIndex)
if glow_index:
color = COLOR_RAINBOW[current_color_index]
pm.write_float(glow_manager + glow_index * 0x38 + 0x8, float(color[0]))
pm.write_float(glow_manager + glow_index * 0x38 + 0xC, float(color[1]))
pm.write_float(glow_manager + glow_index * 0x38 + 0x10, float(color[2]))
pm.write_float(glow_manager + glow_index * 0x38 + 0x14, float(color[3]))
pm.write_int(glow_manager + glow_index * 0x38 + 0x28, 1)
def main():
keyboard.add_hotkey('Home', change_color)
load_config()
glow_module()
if __name__ == '__main__':
main()