Jump to content
McKay Development

Acorn Eyes

Member
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Acorn Eyes

  1. Nevermind I'm incredibly dumb. Flipping hexadecimal takes each 'pair' and reverses the order. So 3B000000 is actually 0000003B. The decimal version of which is 59. 59 is the def_index of the Terrorist knife, as expected.

    The correct function would be

    /**
     * Rename a stock item in your inventory using a name tag.
     * @param {int} nameTagId
     * @param {int} def_index
     * @param {string} name
     */
    GlobalOffensive.prototype.nameBaseItem = function(nameTagId, def_index, name) {
    	let buffer = new ByteBuffer(14 + Buffer.byteLength(name), ByteBuffer.LITTLE_ENDIAN);
    	buffer.writeUint64(nameTagId);
    	buffer.writeUint32(def_index);
    	buffer.writeByte(0x00); // unknown
    	buffer.writeCString(name);
    	this._send(Language.NameBaseItem, null, buffer);
    };

    This has been tested and confirmed working.

  2. I hate to ask this because it seems like a pretty simple thing to figure out but I've been banging my head here.

    Trying to figure out the proper payload to send to

    k_EMsgGCNameBaseItem 

    using this as a starting point

    k_EMsgGCNameItem 

    I've used NetHook2 to capture the payload sent when naming a base item, as well as when naming a storage casket.

    NameItem was 0100FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000B873BC9706000000003F00 and NameBaseItem was 0100FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD63BD97060000003B000000003F00

    I was able to extract the part of the payload that's the ID of the base item (3B000000) thing is I have no earthly idea what that is as a unsigned 64 int.

    the base item ID is 17293822569102704699, which is longer than the typical item id (12345678901). There's no way that's what's being sent to GC because the id being sent is shorter: 8 bytes instead of 16.

    The beginning of the id is also irrelevant honestly, it was the exact same on a different account (172938225691)

    my latest attempt has been:

    GlobalOffensive.prototype.nameBaseItem = function(nameTagId, baseItemId, name) {
        let buffer = new ByteBuffer(14 + Buffer.byteLength(name), ByteBuffer.LITTLE_ENDIAN);
        buffer.writeUint64(nameTagId);
        buffer.writeUint64(baseItemId);
        buffer.writeByte(0x00); // unknown
        buffer.writeCString(name);
        this._send(Language.NameBaseItem, null, buffer);
    };

    I've tried: 17293822569102704699, 02704699, 4699, and 4001 (the def_index) as the baseItemId.

     

    Appreciate any help!

  3. If it's empty then you're probably sending the request too quickly.

    I figured, I'm just  wondering why the callback only handles if there is one.

    if (callback) {
    	this.once('inspectItemInfo#' + assetid, callback);
    }
    

    I would have expected a failed response if there isn't one. 

    callback ? this.once('inspectItemInfo#' + assetid, callback) : return Null
    

    something like that.

  4. That's a good point. 

     

     

    So it's probably a lost cause to try and decipher that?

     

    Regardless, I'm still not entirely sure what is causing both functions (specifically NameItem which I know works in previous versions) to go through but not do anything.

     

    Does it have something to do with protobuf v6? 

     

    As a sidenote: 

     

    I really appreciate all the help you've given. I don't know how much people donate to you, but I doubt it's enough. 

  5. It turns out I was confusing myself with all the files open. I was changing values in a config for the forked older version when I thought I was editing v2

     

    Long story short, the error is irrelevant and I already fixed it.

     

    However with both nameBaseItem and nameItem, the request goes through but nothing happens.

     

    Sending GC message NameBaseItem
    Got unhandled GC message NameBaseItemResponse

    Is there a way to callback NameBaseItemResponse?

  6. Yeah I just opted to not include writing all those variables into a buffer for readability

     

    I'm getting an error 

    Illegal value: "+value+" (not an integer)
    

    However its setup nearly identically to the last function:

    GlobalOffensive.prototype.nameBaseItem = function(nameTagID, defIndex, customName) {
    	let buffer = new ByteBuffer(12 + Buffer.byteLength(customName) + 1);
    	buffer.writeUint64(nameTagID);
    	buffer.writeUint32(defIndex);
    	buffer.writeUint8(0);
    	buffer.writeCString(customName);
    	this._send(Language.NameBaseItem, null, buffer);
    };
    

    So I'm not sure why it wouldn't accept 

    Buffer.byteLength(customName)
    

    Despite being unchanged.

  7. I see. 

     

    So I see there's a 

    k_EMsgGCNameBaseItemResponse

    Would this help me in any way understand what it expects?

     

    So if I for example send 

    this._send(Language.NameBaseItem, null, nameTagID+WEAPON_TASER+0+customName);
    

    I'd like to know why it doesn't like that.

     

    There's only so many nametags I can get, I don't want to burn through them blindly guessing.

  8. I'm confused. When does it work and when doesn't it?

    It does not work in the latest version, version 2.0.1

     

    It does still work in version 1.3.2, the one from where you originally helped create the function

     

    Which leads me to believe that there was a change in module, not the game coordinator, that prevents it from working.

  9. I just cloned the forked repository after merging my own pull request to see if it was the module or CSGO itself that broke the function, it still works with version 1.3.2

     

    I don't wish to take up your time, but I'm at a complete loss as to why that is.

  10. I revisted the whole function you helped me make a while ago, 

    GlobalOffensive.prototype.nameItem = function(nameTagID, itemID, customName) {
        let buffer = new ByteBuffer(16 + Buffer.byteLength(customName) + 1);
        buffer.writeUint64(coerceToLong(nameTagID));
        buffer.writeUint64(coerceToLong(itemID));
        buffer.writeUint8(0);
        buffer.writeCString(customName);
        this._send(Language.NameItem, null, buffer);
    };
    

    And it no longer seems to work.

     

    I'd also like to apologize for not submitting the pull request, I never got notified you responded so I wasn't aware that I submitted it against my own fork. Too late for that now since like I said, it no longer seems to work. 

  11. 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.

  12. 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. 

  13. 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)

  14. 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.

×
×
  • Create New...