What Comes Around Posted May 19, 2023 Report Posted May 19, 2023 (edited) 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 May 19, 2023 by What Comes Around better explanation Quote
What Comes Around Posted May 19, 2023 Author Report Posted May 19, 2023 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: Quote
Dr. McKay Posted May 20, 2023 Report Posted May 20, 2023 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. Quote
What Comes Around Posted May 20, 2023 Author Report Posted May 20, 2023 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! Quote
What Comes Around Posted May 26, 2023 Author Report Posted May 26, 2023 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? Quote
What Comes Around Posted May 26, 2023 Author Report Posted May 26, 2023 (edited) 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: So these are the params needed. Edited May 26, 2023 by What Comes Around I was mistaken about a thing Quote
What Comes Around Posted May 26, 2023 Author Report Posted May 26, 2023 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; 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. Quote
Dr. McKay Posted May 27, 2023 Report Posted May 27, 2023 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 }); } Â Quote
What Comes Around Posted May 29, 2023 Author Report Posted May 29, 2023 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:Â 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! Quote
Dr. McKay Posted May 29, 2023 Report Posted May 29, 2023 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. Quote
What Comes Around Posted June 18, 2023 Author Report Posted June 18, 2023 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! 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.