Acorn Eyes Posted August 22, 2018 Report Posted August 22, 2018 I'm trying to programmatically rename my weapons in CS:GO, mostly because I'm under the impression that inputs are only sanitized in the client. Now there's one sure-fire way to do this, and that's to disassemble the program itself, but not only is that pretty difficult to do, I run the risk of being VAC banned (even though I'm not trying to do anything the game doesn't intend me to do). So for me its a last resort option. The other way, the way I'm trying to do, is packet sniffing to find the request CS:GO sends. Here's the issue, I'm completely new to packet sniffing and I'm worried I won't be capturing the right data. I know I can save the data I collect, but I'm worried that after I use up the $2 to rename a weapon, I'd have collected the wrong packets. So before I start sniffing packets I need to be 100% sure I will collect the relevant packets, and that I'll be able to use them to find the request sent. I'm wondering if anyone could help me with this endeavor or at least point me in the right direction. TL;DR- How do I find the request CS:GO sends to rename a weapon. Quote
Dr. McKay Posted August 22, 2018 Report Posted August 22, 2018 If you want my guess, fork node-globaloffensive and add this to index.js: GlobalOffensive.prototype.nameItem = function(nameTagID, itemID, customName) { var buffer = new ByteBuffer(16 + Buffer.byteLength(customName) + 1); buffer.writeUint64(coerceToLong(nameTagID)); buffer.writeUint64(coerceToLong(itemID)); buffer.writeCString(customName); this._send(Language.NameItem, null, buffer); }; If that doesn't work try swapping nameTagID and itemID. And if that doesn't work, you'd want to use something like NetHook2. Quote
Acorn Eyes Posted August 23, 2018 Author Report Posted August 23, 2018 (edited) If you want my guess, fork node-globaloffensive and add this to index.js: GlobalOffensive.prototype.nameItem = function(nameTagID, itemID, customName) { var buffer = new ByteBuffer(16 + Buffer.byteLength(customName) + 1); buffer.writeUint64(coerceToLong(nameTagID)); buffer.writeUint64(coerceToLong(itemID)); buffer.writeCString(customName); this._send(Language.NameItem, null, buffer); }; If that doesn't work try swapping nameTagID and itemID. And if that doesn't work, you'd want to use something like NetHook2. I tried it out, and it works, however I don't really understand bytebuffer. Can you break down to me what happens when I pass "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" to the nameItem function? The reason I ask is because it writes "- " to the item name. Also I tried to debug it and tried the "﷽" it looks like the function adds a dash before string and then a space. You can see my attempts here: https://goo.gl/CmD6m5 (I can't post my steam inventory link because it gets autoformatted to emojis. So its a google shortlink instead.) The revolver was named 20 ﷽ The M4 was named 10 \n (20 characters) The CZ was named 25 \n (50 characters) Edited August 23, 2018 by Acorn Eyes Quote
Dr. McKay Posted August 23, 2018 Report Posted August 23, 2018 (edited) ByteBuffer is a layer over Node's regular Buffer which adds some nice things. Basically what's happening here is that you're allocating 16 bytes + however many bytes you need to represent your name string + 1 more byte, then you're filling in those bytes with the values shown (the name tag ID in 64 bits, the item ID in 64 bits, the name as a string, and a 0 byte at the end to represent the end of the string). I'm unsure why that dash is being added. We might have missed a field, maybe. Try adding buffer.writeUint8(0); before the writeCString. Edited August 23, 2018 by Dr. McKay Quote
Acorn Eyes Posted August 27, 2018 Author Report Posted August 27, 2018 ByteBuffer is a layer over Node's regular Buffer which adds some nice things. Basically what's happening here is that you're allocating 16 bytes + however many bytes you need to represent your name string + 1 more byte, then you're filling in those bytes with the values shown (the name tag ID in 64 bits, the item ID in 64 bits, the name as a string, and a 0 byte at the end to represent the end of the string). I'm unsure why that dash is being added. We might have missed a field, maybe. Try adding buffer.writeUint8(0); before the writeCString. I don't know if you want updates or not, let me know if you don't. But I haven't tried it so far, buying nametags everytime gets expensive so I'm running low for now. That's why I haven't really responded in several days. Quote
Acorn Eyes Posted September 1, 2018 Author Report Posted September 1, 2018 ByteBuffer is a layer over Node's regular Buffer which adds some nice things. Basically what's happening here is that you're allocating 16 bytes + however many bytes you need to represent your name string + 1 more byte, then you're filling in those bytes with the values shown (the name tag ID in 64 bits, the item ID in 64 bits, the name as a string, and a 0 byte at the end to represent the end of the string). I'm unsure why that dash is being added. We might have missed a field, maybe. Try adding buffer.writeUint8(0); before the writeCString. I just tried it, and it works flawlessly, I submitted a pull request. Dr. McKay 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.