This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Hitmarker | ||
|
||
![](example.gif) | ||
|
||
Changes the crosshair color when you hit an enemy, even through walls. It works by checking `soundinfo` for hit sounds. | ||
|
||
When you run the script, the following is executed: | ||
|
||
``` | ||
alias +hitmarker_attack "+attack; echo hitmarker_on"; | ||
alias -hitmarker_attack "-attack; echo hitmarker_off"; | ||
bind mouse1 +hitmarker_attack; | ||
con_filter_enable 2; | ||
con_filter_text Hit! | ||
con_filter_text_out "" | ||
cl_hud_color 0 | ||
``` | ||
|
||
The script will read the `echo` message, so it will have effect only when it's toggled on. | ||
|
||
### Caveats | ||
|
||
1. Works only **close-range**. | ||
2. Detects only **headshots**, **helmet hits** and **kevlar hits**. Legs doesn't matter here. | ||
|
||
### Requirements | ||
|
||
* [Node.js 14+](https://nodejs.org/en/download/current/) | ||
|
||
### Usage | ||
|
||
Start CS:GO with `-netconport 2121` and then run `node hitmarker.js 2121`. Works offline and online. | ||
|
||
### Credits | ||
|
||
* [DepoSit](https://youtu.be/T7ShZxNGr5E?t=226) for discovering this exploit. | ||
* [@szmarczak](https://github.com/szmarczak) for improving this exploit. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
'use strict'; | ||
const net = require('net'); | ||
const readline = require('readline'); | ||
const path = require('path'); | ||
|
||
const port = Number(process.argv[2] || 0); | ||
if (process.argv.length !== 3 || !port) { | ||
console.error(`Usage: node ${path.basename(process.argv[1])} [port]`); | ||
return; | ||
} | ||
|
||
let ticksLeft = 0; | ||
let timeout; | ||
|
||
const sendOnConnect = `alias +hitmarker_attack "+attack; echo hitmarker_on"; | ||
alias -hitmarker_attack "-attack; echo hitmarker_off"; | ||
bind mouse1 +hitmarker_attack; | ||
con_filter_enable 2; | ||
con_filter_text Hit! | ||
con_filter_text_out "" | ||
cl_hud_color 0 | ||
`; | ||
|
||
const resetCrosshair = `clear; cl_hud_color 0; cl_crosshaircolor 5; cl_crosshaircolor_r 0; cl_crosshaircolor_g 255; cl_crosshaircolor_b 0\n`; | ||
|
||
const hits = [ | ||
': ~)player\\headshot', | ||
': ~player\\kevlar', | ||
': ~)player\\bhit_helmet' | ||
]; | ||
|
||
const socket = net.connect(port, '127.0.0.1', async () => { | ||
console.log('Connected! Press CTRL+C to abort.'); | ||
|
||
socket.write(sendOnConnect); | ||
|
||
setInterval(() => { | ||
if (ticksLeft) { | ||
socket.write(`soundinfo\n`); | ||
|
||
ticksLeft--; | ||
} | ||
}, 75); | ||
|
||
const reader = readline.createInterface({ | ||
input: socket, | ||
crlfDelay: Infinity | ||
}); | ||
|
||
for await (let line of reader) { | ||
line = line.trim(); | ||
if (line === 'hitmarker_on') { | ||
clearTimeout(timeout); | ||
ticksLeft = Infinity; | ||
|
||
socket.write(resetCrosshair); | ||
} else if (line === 'hitmarker_off') { | ||
ticksLeft = 5; | ||
} else if (hits.map(x => line.includes(x)).indexOf(true) !== -1) { | ||
clearTimeout(timeout); | ||
|
||
socket.write(`cl_hud_color 10; cl_crosshaircolor 5; cl_crosshaircolor_r 255; cl_crosshaircolor_g 0; cl_crosshaircolor_b 0; echo Hit!\n`); | ||
|
||
timeout = setTimeout(() => { | ||
socket.write(resetCrosshair); | ||
}, 400); | ||
} | ||
} | ||
}); | ||
|
||
socket.setEncoding('utf8'); |