Jump to content
McKay Development

How to scrape sticker using CSGO coordinator?


What Comes Around

Recommended Posts

Good day,

I know it might sound stupid. But I want to automate scraping stickers. I would like to know how I can intercept game coordinator messages so I can recreate scraping stickers or if anyone knows what the messages need to look like that would cut that be a helpful shortcut for me!

Edited by What Comes Around
better explanation
Link to comment
Share on other sites

3 hours ago, What Comes Around said:

Good day,

I know it might sound stupid. But I want to automate scraping stickers. I would like to know how I can intercept game coordinator messages so I can recreate scraping stickers or if anyone knows what the messages need to look like that would cut that be a helpful shortcut for me!

Update, I found the csgo docs. So it looks like it's outlined there. I believe I need to use the enum 1053 (RemoveSticker). And I can use this to find out what gc wants to see:

image.png

Link to comment
Share on other sites

11 hours ago, Dr. McKay said:

You can intercept and inspect Steam traffic using NetHook to see what the game is sending to the GC.

I didn't see any RemoveSticker protobuf definitions in the files, so my guess would be that it's using CMsgApplySticker for removals, but not setting sticker_item_id or baseitem_defidx.

Thank you very much! Being self taught and not very experienced it's a little tough trying to navigating things like this on my own. So I really appreciate the help/advice!

Link to comment
Share on other sites

On 5/20/2023 at 5:21 AM, Dr. McKay said:

You can intercept and inspect Steam traffic using NetHook to see what the game is sending to the GC.

I didn't see any RemoveSticker protobuf definitions in the files, so my guess would be that it's using CMsgApplySticker for removals, but not setting sticker_item_id or baseitem_defidx.

Unfortunately it didn't work. I am trying to get NetHook working right now but having trouble with that as well. Here is what I have so far. 

This is index.js:

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const SteamCommunity = require('steamcommunity');
const GlobalOffensive = require('globaloffensive')
const Request = require('request');
 
var proxy = 'x'
 
var Steam_User = new SteamUser({
    httpProxy: proxy
});
var Steam_Community = new SteamCommunity({
    request: Request.defaults({proxy: proxy, timeout: 100000})
    //old request: Request.defaults({proxy: proxy})
})
 
Steam_User.logOn({
    accountName: 'x',
    password: 'x',
    rememberPassword: true,
    twoFactorCode: SteamTotp.generateAuthCode('x'),
});
 
Steam_User.on('loggedOn', ()=> {
    console.log('Client logged on')
    const csgo = new GlobalOffensive(Steam_User);
    Steam_User.gamesPlayed([730],true);
    csgo.on('connectedToGC', () =>{
        console.log('Connected to CSGO')
        console.log(csgo.inventory[0])
        console.log(csgo.inventory[0].stickers)
        csgo.scrapeSticker(30509013742, 2)
        console.log(csgo.inventory[0].stickers)
    })
})
Steam_User.on('webSession', (sid, cookies) => {
    console.log('Client web logged on')
})
 
Steam_User.on('steamGuard', function(domain, callback) {
    var code = SteamTotp.generateAuthCode('x')
    callback(code);
});

As basic as it gets. 

Here is an addition I made to the index of globaloffensive npm:

/**
 * Scrape sticker
 * @param {int} itemId
 * @param {int} sticker_slot
 */
 
GlobalOffensive.prototype.scrapeSticker = function(itemId, sticker_slot) {
    let buffer = new ByteBuffer(8 + 4, ByteBuffer.LITTLE_ENDIAN);
    buffer.writeUint64(itemId);
    buffer.writeUint32(sticker_slot)
    this._send(Language.ApplySticker, null, buffer)
}

Here is the output it gives:

Client logged on
debug Sending GC message ClientHello
Client web logged on
Connected to CSGO
{
  attribute: [
    { def_index: 6, value: null, value_bytes: <Buffer 00 00 90 42> },
    { def_index: 7, value: null, value_bytes: <Buffer 45 d4 25 44> },
    { def_index: 8, value: null, value_bytes: <Buffer 1f 77 49 3e> },
    { def_index: 75, value: null, value_bytes: <Buffer f0 41 78 64> },
    { def_index: 113, value: null, value_bytes: <Buffer ba 13 00 00> },
    { def_index: 121, value: null, value_bytes: <Buffer 61 12 00 00> },
    { def_index: 122, value: null, value_bytes: <Buffer ac 26 5b 3f> },
    { def_index: 125, value: null, value_bytes: <Buffer ba 13 00 00> }
  ],
  equipped_state: [],
  id: 'x',
  account_id: x,
  inventory: x,
  def_index: 9,
  quantity: 1,
  level: 1,
  quality: 4,
  flags: 0,
  origin: 24,
  custom_name: null,
  custom_desc: null,
  interior_item: null,
  in_use: false,
  style: null,
  original_id: null,
  rarity: 2,
  position: 0,
  paint_index: 72,
  paint_seed: 663,
  paint_wear: 0.19674347341060638,
  tradable_after: 2023-06-01T07:00:00.000Z,
  stickers: [
    {
      slot: 0,
      sticker_id: 5050,
      wear: null,
      scale: null,
      rotation: null
    },
    {
      slot: 2,
      sticker_id: 4705,
      wear: 0.8560588359832764,
      scale: null,
      rotation: null
    },
    {
      slot: 3,
      sticker_id: 5050,
      wear: null,
      scale: null,
      rotation: null
    }
  ]
}
[
  {
    slot: 0,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  },
  {
    slot: 2,
    sticker_id: 4705,
    wear: 0.8560588359832764,
    scale: null,
    rotation: null
  },
  {
    slot: 3,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  }
]
debug Sending GC message ApplySticker
[
  {
    slot: 0,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  },
  {
    slot: 2,
    sticker_id: 4705,
    wear: 0.8560588359832764,
    scale: null,
    rotation: null
  },
  {
    slot: 3,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  }
]

I am now trying to get NetHook installed but I am having issues with that. I can't seem to build the dll, I either get a build tool error and can't choose to Retarget solution like it tells me to. Any ideas on changes to the request that might get it to work?

Link to comment
Share on other sites

2 hours ago, What Comes Around said:

Unfortunately it didn't work. I am trying to get NetHook working right now but having trouble with that as well. Here is what I have so far. 

This is index.js:

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const SteamCommunity = require('steamcommunity');
const GlobalOffensive = require('globaloffensive')
const Request = require('request');
 
var proxy = 'x'
 
var Steam_User = new SteamUser({
    httpProxy: proxy
});
var Steam_Community = new SteamCommunity({
    request: Request.defaults({proxy: proxy, timeout: 100000})
    //old request: Request.defaults({proxy: proxy})
})
 
Steam_User.logOn({
    accountName: 'x',
    password: 'x',
    rememberPassword: true,
    twoFactorCode: SteamTotp.generateAuthCode('x'),
});
 
Steam_User.on('loggedOn', ()=> {
    console.log('Client logged on')
    const csgo = new GlobalOffensive(Steam_User);
    Steam_User.gamesPlayed([730],true);
    csgo.on('connectedToGC', () =>{
        console.log('Connected to CSGO')
        console.log(csgo.inventory[0])
        console.log(csgo.inventory[0].stickers)
        csgo.scrapeSticker(30509013742, 2)
        console.log(csgo.inventory[0].stickers)
    })
})
Steam_User.on('webSession', (sid, cookies) => {
    console.log('Client web logged on')
})
 
Steam_User.on('steamGuard', function(domain, callback) {
    var code = SteamTotp.generateAuthCode('x')
    callback(code);
});

As basic as it gets. 

Here is an addition I made to the index of globaloffensive npm:

/**
 * Scrape sticker
 * @param {int} itemId
 * @param {int} sticker_slot
 */
 
GlobalOffensive.prototype.scrapeSticker = function(itemId, sticker_slot) {
    let buffer = new ByteBuffer(8 + 4, ByteBuffer.LITTLE_ENDIAN);
    buffer.writeUint64(itemId);
    buffer.writeUint32(sticker_slot)
    this._send(Language.ApplySticker, null, buffer)
}

Here is the output it gives:

Client logged on
debug Sending GC message ClientHello
Client web logged on
Connected to CSGO
{
  attribute: [
    { def_index: 6, value: null, value_bytes: <Buffer 00 00 90 42> },
    { def_index: 7, value: null, value_bytes: <Buffer 45 d4 25 44> },
    { def_index: 8, value: null, value_bytes: <Buffer 1f 77 49 3e> },
    { def_index: 75, value: null, value_bytes: <Buffer f0 41 78 64> },
    { def_index: 113, value: null, value_bytes: <Buffer ba 13 00 00> },
    { def_index: 121, value: null, value_bytes: <Buffer 61 12 00 00> },
    { def_index: 122, value: null, value_bytes: <Buffer ac 26 5b 3f> },
    { def_index: 125, value: null, value_bytes: <Buffer ba 13 00 00> }
  ],
  equipped_state: [],
  id: 'x',
  account_id: x,
  inventory: x,
  def_index: 9,
  quantity: 1,
  level: 1,
  quality: 4,
  flags: 0,
  origin: 24,
  custom_name: null,
  custom_desc: null,
  interior_item: null,
  in_use: false,
  style: null,
  original_id: null,
  rarity: 2,
  position: 0,
  paint_index: 72,
  paint_seed: 663,
  paint_wear: 0.19674347341060638,
  tradable_after: 2023-06-01T07:00:00.000Z,
  stickers: [
    {
      slot: 0,
      sticker_id: 5050,
      wear: null,
      scale: null,
      rotation: null
    },
    {
      slot: 2,
      sticker_id: 4705,
      wear: 0.8560588359832764,
      scale: null,
      rotation: null
    },
    {
      slot: 3,
      sticker_id: 5050,
      wear: null,
      scale: null,
      rotation: null
    }
  ]
}
[
  {
    slot: 0,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  },
  {
    slot: 2,
    sticker_id: 4705,
    wear: 0.8560588359832764,
    scale: null,
    rotation: null
  },
  {
    slot: 3,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  }
]
debug Sending GC message ApplySticker
[
  {
    slot: 0,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  },
  {
    slot: 2,
    sticker_id: 4705,
    wear: 0.8560588359832764,
    scale: null,
    rotation: null
  },
  {
    slot: 3,
    sticker_id: 5050,
    wear: null,
    scale: null,
    rotation: null
  }
]

I am now trying to get NetHook installed but I am having issues with that. I can't seem to build the dll, I either get a build tool error and can't choose to Retarget solution like it tells me to. Any ideas on changes to the request that might get it to work?

Update; After downloading 20 different .NET versions and getting everything working with regards to SteamKit. I have NetHook2 working, and I analyzed the messages. Here is what it looks like when you fully remove a sticker: 

image.png.88ada1c85e3e958406308ceb379c3f74.png

So these are the params needed.

Edited by What Comes Around
I was mistaken about a thing
Link to comment
Share on other sites

On 5/20/2023 at 5:21 AM, Dr. McKay said:

You can intercept and inspect Steam traffic using NetHook to see what the game is sending to the GC.

I didn't see any RemoveSticker protobuf definitions in the files, so my guess would be that it's using CMsgApplySticker for removals, but not setting sticker_item_id or baseitem_defidx.

I have tried a lot of combinations but still can't seem to get it to work. I hope you can maybe spot a mistake that I might have made. I tried two ways to send the message. Here is the first:

GlobalOffensive.prototype.scrapeSticker = function(item_item_id, sticker_slot) {
    let buffer = new ByteBuffer(8 + 8 + 4 + 4 + 2, ByteBuffer.LITTLE_ENDIAN);
    buffer.writeUint64(0);
    buffer.writeUint64(item_item_id);
    buffer.writeUint32(sticker_slot);
    buffer.writeUint32(0)
    buffer.writeFloat(1)
    this._send(Language.ApplySticker, null, buffer)
}

And here is the second way I tried sending the message:

GlobalOffensive.prototype.scrapeSticker = function(item_id, stickerslot) {
    this._send(Language.ApplySticker, Protos.CMsgApplySticker, {
        sticker_item_id: 0,
        item_item_id: item_id,
        sticker_slot: stickerslot,
        baseitem_defidx:0,
        sticker_wear: 1
    })
}

Neither worked to remove the sticker. Here is what the message I am trying to replicate looks like, from NetHook2Analyzer;

image.png.67e7fcb320b5f55cd1d9282d4821c804.png

image.png.9d96845f74d4fd5040382b69f18169b6.png

image.png.817d3b478fdd88a1607106a13c30f328.png

I must be making a mistake somewhere. The only other thing I can think of is that stickers can only be removed bit by bit and not straight to wear 1. But I would be very surprised if that's the case.

Link to comment
Share on other sites

On 5/27/2023 at 7:43 PM, Dr. McKay said:

Try this:

GlobalOffensive.prototype.scrapeSticker = function(item_id, stickerslot) {
    this._send(Language.RemoveSticker, Protos.CMsgApplySticker, {
        item_item_id: item_id,
        sticker_slot: stickerslot,
        sticker_wear: 1
    });
}

 

Unfortunately that didn't work as Language.RemoveSticker is undefined. Also looking at the messages sent when using ApplySticker: image.png.d19b933164824846827c58c7109d0199.png

It shows that the msg code 1086 is used. Which is correct, like with the actual NetHook2Analyzer message. What I will try next is deleting items to see how it looks in NetHook to try to maybe find a pattern and maybe that way find my mistake. Let me know if you can think of anything else!

Link to comment
Share on other sites

  • 3 weeks later...
On 5/29/2023 at 8:05 PM, Dr. McKay said:

My bad, I'd thought you said above that RemoveSticker did exist.

Try using Language.ApplySticker instead. It may be that including the extra properties broke things for you.

Sorry for the late reply. I was away from the PC I use for coding. Anyways, it unfortunately didn't work. I will learn more about how you replicate GC messages in your module and see what I can do to get the sticker scraping message to work. If you can think of anything else, any advice, it would be much appreciated! And thank you for your help thus far!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...