├── requirements.txt ├── README.md ├── sapphire.py └── .gitignore /requirements.txt: -------------------------------------------------------------------------------- 1 | Pymem==1.0 2 | keyboard==0.13.2 3 | #pywin32api -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sapphire 2 | Trigger bot for CS:GO. 3 | 4 | ## Get Started 5 | 1. Clone the repository 6 | ``` 7 | git clone https://github.com/Snaacky/Sapphire.git 8 | ``` 9 | 10 | 2. Install the prerequisites 11 | ``` 12 | pip install -r requirements.txt 13 | ``` 14 | 15 | 3. Execute the script in a terminal with elevated privileges 16 | ``` 17 | python sapphire.py 18 | ``` 19 | 20 | ## Warning 21 | Sapphire comes as is with no guarantees regarding its standing with VAC. This is a cheat and will get you banned if you attempt to use it on any cheat protected servers. 22 | 23 | ## Common Issues 24 | * Issue: The token does not have the specified privilege. 25 | * Fix: The terminal or interpreter must be ran with administrator privileges. 26 | 27 | * Issue: `AttributeError: 'NoneType' object has no attribute` or any other Python error. 28 | * Fix: Make sure you are running at least Python 3.5 (future versions may have breaking issues), have installed the correct versions of the required modules from requirements.txt, and have updated the offsets to the latest version of CS:GO. 29 | 30 | ## Requirements 31 | * Windows (minimum Vista, recommended 7/8.1/10) 32 | * [Python 3.5](https://www.python.org/downloads/) 33 | * [Python for Windows Extensions](https://github.com/mhammond/pywin32) 34 | * [Pymem](https://github.com/srounet/Pymem) 35 | * [keyboard](https://github.com/boppreh/keyboard) 36 | -------------------------------------------------------------------------------- /sapphire.py: -------------------------------------------------------------------------------- 1 | import keyboard 2 | import pymem 3 | import pymem.process 4 | import time 5 | from win32gui import GetWindowText, GetForegroundWindow 6 | 7 | dwEntityList = (0x4D4B104) 8 | dwForceAttack = (0x317C6EC) 9 | dwLocalPlayer = (0xD36B94) 10 | m_fFlags = (0x104) 11 | m_iCrosshairId = (0xB3D4) 12 | m_iTeamNum = (0xF4) 13 | 14 | trigger_key = "shift" 15 | 16 | 17 | def main(): 18 | print("Sapphire has launched.") 19 | pm = pymem.Pymem("csgo.exe") 20 | client = pymem.process.module_from_name(pm.process_handle, "client.dll").lpBaseOfDll 21 | 22 | while True: 23 | if not keyboard.is_pressed(trigger_key): 24 | time.sleep(0.1) 25 | 26 | if not GetWindowText(GetForegroundWindow()) == "Counter-Strike: Global Offensive": 27 | continue 28 | 29 | if keyboard.is_pressed(trigger_key): 30 | player = pm.read_int(client + dwLocalPlayer) 31 | entity_id = pm.read_int(player + m_iCrosshairId) 32 | entity = pm.read_int(client + dwEntityList + (entity_id - 1) * 0x10) 33 | 34 | entity_team = pm.read_int(entity + m_iTeamNum) 35 | player_team = pm.read_int(player + m_iTeamNum) 36 | 37 | if entity_id > 0 and entity_id <= 64 and player_team != entity_team: 38 | pm.write_int(client + dwForceAttack, 6) 39 | 40 | time.sleep(0.006) 41 | 42 | 43 | if __name__ == '__main__': 44 | main() 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | --------------------------------------------------------------------------------