Jump to content
McKay Development

expl0it

Member
  • Posts

    11
  • Joined

  • Last visited

Posts posted by expl0it

  1. Hey.

     

    I just noticed there is pretty important bug in the steamstore module.

    SteamStore.prototype.hasPhone = function(callback) {
    	var self = this;
    	this.request.get("https://store.steampowered.com/account/", function(err, response, body) {
    		if(self._checkHttpError(err, response, callback)) {
    			return;
    		}
    
    		var $ = Cheerio.load(body);
    		var $phone = $('.phone_header_description .account_data_field');
    		var match;
    
    		if($phone && (match = $phone.text().match(/Ends in (\d+)/))) {
    			// Has phone number
    			callback(null, true, match[1]);
    			return;
    		}
    
    		// See if we have an add-number link
    		if($('a[href*="/phone/add"]').length) {
    			callback(null, false);
    			return;
    		}
    
    		callback(new Error("Malformed response: " + body));
    	});
    };
    

    I modified it a bit so it returns body when malformed response happens.

     

    The bug is that it is not matching account with language set not to english.

    Example:

    <div class="phone_header_description">
     								Telefon:
     								<img src="https://steamstore-a.akamaihd.net/public/images/mobile/icon_mobile.png" alt="" >
     								<span class="account_data_field">Kończy się na 01</span>
     							</div>
    
    

    steamstore fails and returns "Malformed response"

     

    easy fix: use /([0-9]{2})/ regex instead of this. 

     

    I hope it will be patched soon. I've just submitted GitHub poll request.

     

    Thank you!

    ~expl0it

  2. Hello. I am doing this in this way actually: 

    core.prototype.changeTradeToken = function (callback) {
    
      self.community._myProfile("/tradeoffers/newtradeurl", {
        "sessionid": self.community.getSessionID()
      }, (err, response, body) => {
          return callback(err/* || response.statusCode !== 200*/, body ? body.replace(/\"/g, '') : null);
      }, "tradeoffermanager");
    
    }
    

    Would be nice to see this feature in the node-steamcommunity module :)

  3. Hello.

     

    I was playing around with node-steam-user changePassword method, but it looks like it's not working.

     

    I tried:

    user.changePassword(oldpassword, mynewpassword, steamtotp.generateAuthCode(shared_secret), (err) => {
    
    	if (err)
    		return console.log(err);
    
    	debug.log(`Password has been successfully changed!`);
    
    });
    

    and it returned InvalidParam error object.

  4. Hello.

     

    I am working on site where users can dynamically add their accounts.

     

    So I am trying to login every account, and I need to get login response.

     

    Like node-steam module does it:

    steamClient.connect();
    steamClient.on('connected', function() 
    {
      steamUser.logOn({
        account_name: 'username',
        password: 'password'
      });
    });
    steamClient.on('logOnResponse', function() { /* ... */});
    
    steamClient.on('error', function(e) { /* ... */});

    The problem is that node-steam-user just throws InvalidPassword.

    I can only suppress it by using

    process.on('uncaughtException', function (err) {
      console.log(new Date() + ' Caught exception: ' + err);
    });
    

    Is it possible to get logOn response somehow instead of this?

     

    Regards.

×
×
  • Create New...