From c4a54a1665e8551eb5c161eacdd695dcc396856c Mon Sep 17 00:00:00 2001 From: davidgfb Date: Sat, 28 Nov 2020 23:58:29 +0100 Subject: [PATCH 1/3] add exception management to avoid errors when process is not launched --- OneByteWallhack.py | 26 ++++++++++++++++---------- README.md | 11 +++++++++-- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/OneByteWallhack.py b/OneByteWallhack.py index 46bd332..b7203bb 100644 --- a/OneByteWallhack.py +++ b/OneByteWallhack.py @@ -1,13 +1,19 @@ -import pymem -import re +from pymem import Pymem,process +from re import search -pm = pymem.Pymem('csgo.exe') -client = pymem.process.module_from_name(pm.process_handle, - 'client.dll') +try: + processName='csgo.exe' + pm = Pymem(processName) + client = process.module_from_name(pm.process_handle,'client.dll') -clientModule = pm.read_bytes(client.lpBaseOfDll, client.SizeOfImage) -address = client.lpBaseOfDll + re.search(rb'\x83\xF8.\x8B\x45\x08\x0F', - clientModule).start() + 2 + clientModule = pm.read_bytes(client.lpBaseOfDll, client.SizeOfImage) + address = client.lpBaseOfDll + search(rb'\x83\xF8.\x8B\x45\x08\x0F', + clientModule).start() + 2 -pm.write_uchar(address, 2 if pm.read_uchar(address) == 1 else 1) -pm.close_process() + pm.write_uchar(address, 2 if pm.read_uchar(address) == 1 else 1) + pm.close_process() + + print("hack completed") + +except: + print("error: couldn't find process",processName) diff --git a/README.md b/README.md index 7f43c2e..cec4ea2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # OneByteWallhack -CS:GO wallhack achieved by patching one byte of game memory. Written in Python 3. +CS:GO wallhack achieved by patching one byte of game process memory. Written in Python 3.9 This does the same as **r_drawothermodels 2** command but without touching the cvar, so it's VAC - safe. @@ -13,4 +13,11 @@ if ( r_drawothermodels.GetInt() == 2 ) } ``` -The **r_drawothermodels** check is modified to make the `if` expression evaluate to **true** when **r_drawothermodels** cvar is set to default value (1). \ No newline at end of file +The **r_drawothermodels** check is modified to make the `if` expression evaluate to **true** when **r_drawothermodels** cvar is set to default value (1). + +𝗜𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁! : +Download python 3.9 or newer if you hadn't: https://www.python.org/downloads/ +You may need to head to "C:\Users\ username \AppData\Local\Programs\Python\Python39\Scripts" press Win+R write "cmd" and "pip install pymem" and or "pip install pywin32" and restart your pc. + +Usage: +Run CSGO before this script. You will also need to run this script as administrator From 66055cfae04011c3d0d17656ab7d90c01c656b76 Mon Sep 17 00:00:00 2001 From: davidgfb Date: Sun, 29 Nov 2020 12:06:17 +0100 Subject: [PATCH 2/3] add specific exception to exception management --- OneByteWallhack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OneByteWallhack.py b/OneByteWallhack.py index b7203bb..93c81c2 100644 --- a/OneByteWallhack.py +++ b/OneByteWallhack.py @@ -1,4 +1,4 @@ -from pymem import Pymem,process +from pymem import Pymem,process,exception from re import search try: @@ -15,5 +15,5 @@ print("hack completed") -except: +except exception.ProcessNotFound: print("error: couldn't find process",processName) From c95e34f4c22935724ffb70702158b54e42af7f78 Mon Sep 17 00:00:00 2001 From: davidgfb Date: Mon, 30 Nov 2020 16:44:33 +0100 Subject: [PATCH 3/3] Add files via upload --- OneByteWallhack.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OneByteWallhack.py b/OneByteWallhack.py index 93c81c2..e28fd62 100644 --- a/OneByteWallhack.py +++ b/OneByteWallhack.py @@ -1,13 +1,16 @@ -from pymem import Pymem,process,exception +from pymem import Pymem from re import search +from pymem.process import module_from_name +from pymem.exception import ProcessNotFound try: processName='csgo.exe' pm = Pymem(processName) - client = process.module_from_name(pm.process_handle,'client.dll') + client = module_from_name(pm.process_handle,'client.dll') - clientModule = pm.read_bytes(client.lpBaseOfDll, client.SizeOfImage) - address = client.lpBaseOfDll + search(rb'\x83\xF8.\x8B\x45\x08\x0F', + clientLpBaseOfDll=client.lpBaseOfDll + clientModule = pm.read_bytes(clientLpBaseOfDll, client.SizeOfImage) + address = clientLpBaseOfDll + search(rb'\x83\xF8.\x8B\x45\x08\x0F', clientModule).start() + 2 pm.write_uchar(address, 2 if pm.read_uchar(address) == 1 else 1) @@ -15,5 +18,5 @@ print("hack completed") -except exception.ProcessNotFound: +except ProcessNotFound: print("error: couldn't find process",processName)