async def chaos_setup(self, ctx): if ctx.author.is_mod: try: self.toggles = '' p = Pymem('Game.exe') base = p.process_base.lpBaseOfDll pointer = base + 0x2F9464 val = p.read_int(pointer) for i in (0x54, 0x688, 0x4, 0x44): val = p.read_int(val + i) reactions = p.read_float(val + 0x658) / 0.7 aggressivity = p.read_float(val + 0x660) / 0.6 intelligence = p.read_float(val + 0x664) / 0.8 sight = p.read_float(val + 0x66C) for i in (reactions, aggressivity, intelligence, sight): self.toggles += bin(int(round(i)))[2:].zfill(16)[::-1] hearing = p.read_float(val + 0x670) self.cooldown = floor(hearing / 1000) self.duration = hearing - self.cooldown * 1000 - 100 if self.duration < 0: print( f'[ERROR] Chaos mod is disabled in-game, turn it on and run !csetup again' ) else: print(f'[INFO] Toggles set to: {self.toggles}') print(f'[INFO] Cooldown set to: {self.cooldown}') print(f'[INFO] Base duration set to: {self.duration}') except ProcessNotFound: print('[ERROR] Game is not running') return
async def chaos_start(self, ctx): if ctx.author.is_mod: self.stopped = False await ctx.send('Started Chaos Mod.') print('[INFO] Started Chaos Mod') try: p = Pymem('Game.exe') except ProcessNotFound: print('[ERROR] Game is not running') return base = p.process_base.lpBaseOfDll pointer = base + 0x2F9464 while not self.stopped: if not self.queue: effect = self.random_effects(1)[0] else: effect = self.queue[0] self.queue.pop(0) effect_id = float(effect['id'] * 0.008) while not self.stopped: await asyncio.sleep(0.25) try: inGame = p.read_int(base + 0x2F94BC) if not inGame: val = p.read_int(pointer) for i in (0x54, 0x688, 0x4, 0x44): val = p.read_int(val + i) p.write_float(val + 0x674, effect_id) if self.shared: await ctx.send(f'Using effect: {effect_id}') self.blocked.append( (effect, datetime.now() + timedelta(seconds=effect['duration'] * self.duration * 15))) self.new_poll = True self.sleep_task = asyncio.create_task( self.effect_cooldown(self.cooldown)) await asyncio.wait({self.sleep_task}) break except: print( '[WARN] Couldn\'t inject. If your game crashed, use !cend, restart game, wait for "Ended Chaos" message, then !cstart' ) await ctx.send('Ended Chaos.') print('[INFO] Ended Chaos Mod')
def __init__(self, process: pymem.Pymem): self.process = process self.base_address: int = process.base_address self.player_position = process.read_int(self.base_address + 0xE9482C) self.module = pymem.process.module_from_name(process.process_handle, "S4_Main.exe") character_pattern = b".\x00\x00" pymem.pattern.pattern_scan_module(process.process_handle, self.module, character_pattern) print("player_position: %s" % self.player_position)
async def event_ready(self): print(f'[INFO] Reading from channel {self.channel}') print(f'[INFO] Reacting to bot {self.bot_name}') print(f'[INFO] Toggles: {self.toggles}') print(f'[INFO] Duration: {self.duration}') print(f'[INFO] Cooldown: {self.cooldown}') print('[INFO] Started Chaos Mod') print( f'[WARN] Go to Vincenzo in the options map and set it to {self.duration}!' ) try: p = Pymem('Game.exe') except ProcessNotFound: print('[ERROR] Game is not running') return base = p.process_base.lpBaseOfDll pointer = base + 0x2F9464 while True: while not self.effect_id: await asyncio.sleep(0.25) while True: await asyncio.sleep(0.25) try: inGame = p.read_int(base + 0x2F94BC) if not inGame: val = p.read_int(pointer) for i in (0x54, 0x688, 0x4, 0x44): val = p.read_int(val + i) p.write_float(val + 0x674, self.effect_id) self.effect_id = None self.sleep_task = asyncio.create_task( self.effect_cooldown(self.cooldown)) await asyncio.wait({self.sleep_task}) break except: print( '[WARN] Couldn\'t inject. If your game crashed, use !cend, restart game, wait for "Ended Chaos" message, then !cstart' ) print('[INFO] Ended Chaos Mod')
float(position[0]) / map_width), 1.0) * minimap_width) - 1, minimap_top + (min(max(0.0, float(position[1]) / map_height), 1.0) * minimap_height) - 1)) # -12, -6 # 4 place_building('house', (5 + 9, 5 + 6)) exit() while True: # TODO: Input from game current_population = np.array(( process.read_int(base_address + population_offset), process.read_int(base_address + population_offset + 4), process.read_int(base_address + population_offset + 8), process.read_int(base_address + population_offset + 16), process.read_int(base_address + population_offset + 20), )) # TODO: Incorporate available resources (read them from memory, see Cheat Engine file) population_group = 'aristocrats' print('population group', population_group) number_of_population = 1000 print('number of population', number_of_population) population = np.zeros((len(population_groups), )) population[population_groups.index( population_group)] = number_of_population print('population', population)
def SMIO_read(): try: SHAR = Pymem('Simpsons.exe') except: return SHAR = Pymem('Simpsons.exe') SMIO_info = {} SMIO_info['Version'] = Version = Versions_dict[SHAR.read_int(0x593FFF)] def VersionSelect(ReleaseEnglishAddress, DemoAddress, ReleaseInternationalAddress, BestSellerSeriesAddress): if Version == "ReleaseEnglish": return ReleaseEnglishAddress if Version == "Demo": return DemoAddress if Version == "ReleaseInternational": return ReleaseInternationalAddress if Version == "BestSellerSeries": return BestSellerSeriesAddress def GameFlow(): return SHAR.read_int( VersionSelect(0x6C9014, 0x6C8FD4, 0x6C8FD4, 0x6C900C)) GameStates = [ "PreLicence", "Licence", "MainMenu", "DemoLoading", "DemoInGame", "BonusSetup", "BonusLoading", "BonusInGame", "NormalLoading", "NormalInGame", "NormalPaused", "Exit" ] def GameState(GameFlow): if GameFlow == 0: return 0 else: return GameStates[SHAR.read_int(GameFlow + 0xC)] SMIO_info['GameState'] = GameState = GameState(GameFlow()) def CharacterPosition(Character): Offset = Character + 100 v = Vector((SHAR.read_float(Offset), SHAR.read_float(Offset + 4), SHAR.read_float(Offset + 8))) v.y, v.z = v.z, v.y return v def CharacterManager(): return SHAR.read_int(VersionSelect(7111792, 7111728, 7111728, 7111784)) def Characters(CharacterManager, Index): return SHAR.read_int(CharacterManager + 192 + Index * 4) def CharacterRotation(Character): return SHAR.read_float(Character + 272) def CharacterInCar(Character): return SHAR.read_int(Character + 348) != 0 def CharacterName(CharacterManager, Index): return SHAR.read_string(CharacterManager + 448 + Index * 64, 64) def CharacterCar(Character): return SHAR.read_int(Character + 348) def CarPosRot(Car): Offset = Car + 184 # m = [ # [SHAR.read_float(Offset), SHAR.read_float(Offset + 4), SHAR.read_float(Offset + 8), SHAR.read_float(Offset + 12)], # [SHAR.read_float(Offset + 16), SHAR.read_float(Offset + 20), SHAR.read_float(Offset + 24), SHAR.read_float(Offset + 28)], # [SHAR.read_float(Offset + 32), SHAR.read_float(Offset + 36), SHAR.read_float(Offset + 40), SHAR.read_float(Offset + 44)], # [SHAR.read_float(Offset + 48), SHAR.read_float(Offset + 52), SHAR.read_float(Offset + 56), SHAR.read_float(Offset + 60)] # ] rot = [ [ SHAR.read_float(Offset), SHAR.read_float(Offset + 4), SHAR.read_float(Offset + 8) ], [ SHAR.read_float(Offset + 16), SHAR.read_float(Offset + 20), SHAR.read_float(Offset + 24) ], [ SHAR.read_float(Offset + 32), SHAR.read_float(Offset + 36), SHAR.read_float(Offset + 40) ], ] rot = Matrix(rot).to_quaternion() rot.y, rot.z = rot.z, rot.y rot = rot.to_euler() pos = Vector( (SHAR.read_float(Offset + 48), SHAR.read_float(Offset + 52), SHAR.read_float(Offset + 56))) pos.y, pos.z = pos.z, pos.y return pos, rot if GameState in ['NormalInGame', 'NormalPaused']: CharManager = CharacterManager() SMIO_info["Character"] = CharacterName(CharManager, 0) Player = Characters(CharManager, 0) InCar = CharacterInCar(Player) SMIO_info['Player In Car'] = InCar SMIO_info['Player_Position'] = CharacterPosition(Player) SMIO_info['Player_Rotation'] = round(CharacterRotation(Player), 2) if InCar: PlayerCar = CharacterCar(Player) SMIO_info['Car_Position'], SMIO_info['Car_Rotation'] = CarPosRot( PlayerCar) return SMIO_info
entity_glow = pm.read_int(entity + m_iGlowIndex) gM_y_56_eG = 56 * entity_glow + glow_manager valores = [8, 12, 16, 20] colores = [[], [], [1.0, 0.0, 0.0, 1.0],\ [0.0, 0.0, 1.0, 1.0]] for i in range(4): pm.write_float(gM_y_56_eG + valores[i],\ colores[entity_team_id][i]) pm.write_int(gM_y_56_eG + 40, 1) # Enable glow d = get("https://raw.githubusercontent.com/frk1/hazedumper/master/csgo.json") d = d.json() dwEntityList, dwGlowObjectManager, m_iGlowIndex, m_iTeamNum =\ d['signatures']['dwEntityList'],\ d['signatures']['dwGlowObjectManager'],\ d['netvars']['m_iGlowIndex'],\ d['netvars']['m_iTeamNum'] pm = Pymem("csgo.exe") client = module_from_name(pm.process_handle, "client.dll") client = client.lpBaseOfDll glow_manager = pm.read_int(client + dwGlowObjectManager) while True: glow()
def __init__(self, client_address: int, process: Pymem): self._process = process self._pointer: int = process.read_int(client_address + offsets.dwGlowObjectManager)
from pymem import process, Pymem, exception dwEntityList = (0x4D04B04) dwGlowObject = (0x5245018) m_iGlowIndex = (0xA40C) pm = Pymem("csgo.exe") client = process.module_from_name(pm.process_handle, "client_panorama.dll").lpBaseOfDll while True: try: for i in range(0, 11): glow_player_glow_index = pm.read_int( pm.read_int(client + dwEntityList + i * 0x10) + m_iGlowIndex) pm.write_float((pm.read_int(client + dwGlowObject) + ((glow_player_glow_index * 0x38) + 0x8)), float(1)) pm.write_float((pm.read_int(client + dwGlowObject) + ((glow_player_glow_index * 0x38) + 0x10)), float(1)) pm.write_int((pm.read_int(client + dwGlowObject) + ((glow_player_glow_index * 0x38) + 0x24)), 1) except exception.MemoryReadError: pass