daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Dec 29th, 2016 164 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var fs = require("fs"),
  2.     Steam = require("steam"),
  3.     SteamID = require("steamid"),
  4.     IntervalIntArray = {},
  5.     readlineSync = require("readline-sync"),
  6.     Protos = require("./protos/protos.js"),
  7.     CountReports = 0,
  8.     Long = require("long"),
  9.     SteamClients = {},
  10.     SteamUsers = {},
  11.     SteamGCs = {},
  12.     SteamFriends = {},
  13.     process = require("process"),
  14.     steamID = readlineSync.question("SteamID64 which will be reported: "),
  15.     ClientHello = 4006,
  16.     ClientWelcome = 4004;
  17.  
  18. var accounts = [];
  19.  
  20. var arrayAccountsTxt = fs.readFileSync("accounts.txt").toString().split("\n");
  21. for (i in arrayAccountsTxt) {
  22.     var accInfo = arrayAccountsTxt[i].toString().trim().split(":");
  23.     var username = accInfo[0];
  24.     var password = accInfo[1];
  25.     accounts[i] = [];
  26.     accounts[i].push({
  27.         username: username,
  28.         password: password
  29.     });
  30. }
  31.  
  32. arrayAccountsTxt.forEach(processSteamReport);
  33.  
  34. function processSteamReport(element, indexElement, array) {
  35.     if (element != "") {
  36.         var account = element.toString().trim().split(":");
  37.         var account_name = account[0];
  38.         var password = account[1];
  39.         SteamClients[indexElement] = new Steam.SteamClient();
  40.         SteamUsers[indexElement] = new Steam.SteamUser(SteamClients[indexElement]);
  41.         SteamGCs[indexElement] = new Steam.SteamGameCoordinator(SteamClients[indexElement], 730);
  42.         SteamFriends[indexElement] = new Steam.SteamFriends(SteamClients[indexElement]);
  43.  
  44.         SteamClients[indexElement].connect();
  45.         if(fs.existsSync('sentryfile.'+account_name)) {
  46.             sentryfile = fs.readFileSync('sentryfile.'+account_name);
  47.            
  48.             SteamClients[indexElement].on("connected", function() {
  49.             SteamUsers[indexElement].logOn({
  50.                 account_name: account_name,
  51.                 password: password,
  52.                 sha_sentryfile: sentryfile
  53.                 });
  54.             });
  55.         }
  56.         else{
  57.             console.log('sentryfile.'+account_name +' not found')
  58.         }
  59.        
  60.  
  61.         SteamClients[indexElement].on("logOnResponse", function(res) {
  62.             if (res.eresult !== Steam.EResult.OK) {
  63.                 if (res.eresult == Steam.EResult.ServiceUnavailable) {
  64.                     console.log("\n[STEAM CLIENT - " + account_name + "] Login failed - STEAM IS DOWN!");
  65.                     console.log(res);
  66.                     SteamClients[indexElement].disconnect();
  67.                     process.exit();
  68.                 } else {
  69.                     console.log("\n[STEAM CLIENT - " + account_name + "] Login failed!");
  70.                     console.log(res);
  71.                     SteamClients[indexElement].disconnect();
  72.                     SteamClients.splice(indexElement, 1);
  73.                     SteamFriends.splice(indexElement, 1);
  74.                     SteamGCs.splice(indexElement, 1);
  75.                     SteamUsers.splice(indexElement, 1);
  76.                     IntervalIntArray.splice(indexElement, 1);
  77.                 }
  78.             } else {
  79.                 SteamFriends[indexElement].setPersonaState(Steam.EPersonaState.Offline);
  80.  
  81.                 SteamUsers[indexElement].gamesPlayed({
  82.                     games_played: [{
  83.                         game_id: 730
  84.                     }]
  85.                 });
  86.  
  87.                 if (SteamGCs[indexElement]) {
  88.                     IntervalIntArray[indexElement] = setInterval(function() {
  89.                         SteamGCs[indexElement].send({
  90.                             msg: ClientHello,
  91.                             proto: {}
  92.                         }, new Protos.CMsgClientHello({}).toBuffer());
  93.                     }, 2000);
  94.                 } else {
  95.                     SteamClients[indexElement].disconnect();
  96.                     SteamClients.splice(indexElement, 1);
  97.                     SteamFriends.splice(indexElement, 1);
  98.                     SteamGCs.splice(indexElement, 1);
  99.                     SteamUsers.splice(indexElement, 1);
  100.                     IntervalIntArray.splice(indexElement, 1);
  101.                 }
  102.             }
  103.         });
  104.  
  105.         SteamClients[indexElement].on("error", function(err) {
  106.             console.log("[STEAM CLIENT - " + account_name + "] Account is probably ingame! Logged out!");
  107.             SteamClients[indexElement].disconnect();
  108.             SteamClients.splice(indexElement, 1);
  109.             SteamFriends.splice(indexElement, 1);
  110.             SteamGCs.splice(indexElement, 1);
  111.             SteamUsers.splice(indexElement, 1);
  112.             IntervalIntArray.splice(indexElement, 1);
  113.         });
  114.  
  115.         SteamGCs[indexElement].on("message", function(header, buffer, callback) {
  116.             switch (header.msg) {
  117.                 case ClientWelcome:
  118.                     clearInterval(IntervalIntArray[indexElement]);
  119.                     sendReport(SteamGCs[indexElement], SteamClients[indexElement], account_name, steamID);
  120.                     break;
  121.                 case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello:
  122.                     break;
  123.                 case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse:
  124.                     CountReports++;
  125.                     console.log("[GC - " + account_name + "] (" + CountReports + ") Report with confirmation ID: " + Protos.CMsgGCCStrike15_v2_ClientReportResponse.decode(buffer).confirmationId.toString() + " sent!");
  126.                     SteamClients[indexElement].disconnect();
  127.                     SteamClients.splice(indexElement, 1);
  128.                     SteamFriends.splice(indexElement, 1);
  129.                     SteamGCs.splice(indexElement, 1);
  130.                     SteamUsers.splice(indexElement, 1);
  131.                     IntervalIntArray.splice(indexElement, 1);
  132.                     break;
  133.                 default:
  134.                     console.log(header);
  135.                     break;
  136.             }
  137.         });
  138.     }
  139. }
  140.  
  141. function sendReport(GC, Client, account_name) {
  142.     var account_id = new SteamID(steamID).accountid;
  143.     GC.send({
  144.         msg: Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer,
  145.         proto: {}
  146.     }, new Protos.CMsgGCCStrike15_v2_ClientReportPlayer({
  147.         accountId: account_id,
  148.         matchId: 8,
  149.         rptAimbot: 2,
  150.         rptWallhack: 3,
  151.         rptSpeedhack: 4,
  152.         rptTeamharm: 5,
  153.         rptTextabuse: 6,
  154.         rptVoiceabuse: 7
  155.     }).toBuffer());
  156. }
  157.  
  158. process.on("uncaughtException", function(err) {});
  159.  
  160. console.log("Initializing ReportBot by askwrite...\nCredits: Trololo - Idea");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top