Code Monkey home page Code Monkey logo

christians-steam-framework's Introduction

WARNING

This IS heavily work-in-progress. Chances are there's nothing to see for you here.

GOALS

This project, more or less, started with me having some gripes with a much more famous idling bot based on SteamKit, so I figured I'd just make my own.

Currently, the main goals are to make a framework to "deal with Steam" in various way, particularly stuff that I want to automate for myself. Currently, higher level features include (this list might not be up to date):

  • card farming
  • stream "viewing" (to get drops; but it doesn't stop automatically)
  • sale queues
  • daily sale stickers
  • trading the entire (tradable) inventory to another account
  • accepting trades
  • listing owned games
  • listing inventory

There's low level stuff, of course:

  • making and using a client connection (i.e. protobufs)
  • logins
  • making authenticated https queries

so in theory you can make your own features if you wanted to.

This is a one-man spare-time project, so progress is slow and mostly based on what I want to do.

Note that a bot is in a separate repository: https://github.com/Christian-Stieber/Christians-Steam-Bot

PLATFORMS

If, for whatever reaason, you are stupid enough to want to try this: while the code is meant to be portable, there are a couple of platform-specific items such as getting information about the current machine. Code might not exist yet for all platforms, and if it does exist then it certainly hasn't been tested.

Linux

Currently, I'm developing this on a Debian Linux box.

This list of required packages might be incomplete:

  • g++ (at least version 12)
  • libboost-all-dev (at least 1.81)
  • cmake
  • libprotobuf-dev
  • protobuf-compiler
  • libssl-dev
  • libsystemd-dev
  • libzstd-dev
  • libbz2-dev
  • liblzma-dev

Windows

Visual Studio 2022 Community Edition should be able to build things out of the box.

Building

I'm not actively supporting standalone builds of just the framework; please refer to Christians-Steam-Bot.

DATA FILES

The bot stores data in %LOCALAPPDATA%\Christian-Stieber\Steam-framework or ~/.Christians-Steam-Framework. For now, these are unencrypted, but I'll change that eventually.

You'll find a logfile there as well -- but I'm not sure whether it's properly flushed on Windows.

3RD PARTY CODE

In addition to libraries that are used through packages, the framework includes some other 3rd party code in its source tree:

INSPIRATIONS

"Inspirations" on how the Steam stuff works was taken from
https://github.com/SteamRE/SteamKit
https://github.com/JustArchiNET/ArchiSteamFarm

SteamKit in particular has also provided me with lists of enum values to copy-paste.

christians-steam-framework's People

Contributors

christian-stieber avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

eve-player

christians-steam-framework's Issues

The interactive login is a mess

Both on password and Steamguard phases, timeouts can happen which appear to screw up the logic; I'll need to take a closer look at how this is supposed to work, and how we can make it work.

Module function calls?

Add an API to make a blocking function call on a module?

Like for WebSession::getAccessToken()

Revamp the "send-inventory"

send-inventory will only be able to send to other bot accounts.

If an account has a "recipient" variable set, send-inventory will create a trade to that account. Otherwise, send-inventory will be a no-op.

Login crash on 2FA "timeout"

There appears to be a timeout and crash if you need "too long" to enter the 2FA code:

... [2024-06-07 10:54:09]: Please enter account password: ...
... [2024-06-07 10:54:18]: obtaining login key
... [2024-06-07 10:54:19]: Please enter steamguard-code (email): ChristiansSteamBot: /home/stieber/Christians-Steam-Bot/Christians-Steam-Framework/Sources/Client/Client.cpp:163: static void SteamBot::Client::launch(SteamBot::ClientInfo&)::Launcher::launch(SteamBot::ClientInfo&): Assertion `clientInfo.isActive()' failed.
Aborted

Maintain booster pack eligibility

  • track last login/approximate logoff times
  • make sure it gets stored on exit command and ctrl-c
  • add a mechanism to auto-login to maintain booster pack eligibility
  • only consider accounts that are marked appropriately

Encrypt the account data files

As it says. These files contain secrets, so they need to be encrypted.

The way this will work is that the user has to enter the password at the start of the application. Or maybe through some less secure way as well, not sure yet.

We'll just that one key for all files.

On Windows, we also have a CryptProtectData() function, and/or a "credentials manager". Look at whether these can be used.

Websessions

Turns out, SteamKit says that WebNonces are no longer used, and that a system called "SteamAuthentication" is the way to go now.

SteamRE/SteamKit@c3f37c0


It seems we can no longer create web sessions with the current code:

[2023-10-19 20:09:20.869296]: sending message: SteamBot::Connection::Message::Message<(SteamBot::Connection::Message::Type)5585, SteamBot::Connection::Message::Header::ProtoBuf, CMsgClientRequestWebAPIAuthenticateUserNonce>
[2023-10-19 20:09:20.869441]: serializing protobuf message CMsgProtoBufHeader into 20 bytes: {"steamid":"76561198124253465","client_sessionid":-182248}
[2023-10-19 20:09:20.869480]: serializing protobuf message CMsgClientRequestWebAPIAuthenticateUserNonce into 0 bytes: {}

After that, nothing happens.

Somehow remove secrets from logs

In particular, filter them out of packet data logs...

We'll probably have turn packet data into JSON first, then blacklist/edit secret items before logging the result.

Sounds like a mess, but not much else I can see right now.

auto-accept trades

Bots will auto-accept incoming trades from other bots, IF the trade is a gift

add license via package-id

We definitely need to be able to add licenses via package-id, to get the "Limited Free Promotional Package" deals.

New client management

The Client/ClientInfo stuff needs some major revamp.

Points that I remember encountering:

  • we need a way for clients to terminate automatically when they are not needed anymore. Probably some kind of work-counter that gets increased when something works on the client, and decreased when its done
  • we need a simple, proper way to launch a client or use the already running one, and do something on it. Make sure we actually know WHEN we can start doing things!
  • think about whether the Executor module is still the way to go to make things happen on the client
  • the ClientInfo feels like a random pile of things that were just stuffed in there because they didn't fit into the client and there was no other place

More thoughts:

  • each "activity" should probably have a defined, recognizable completion. Ideally, all activities should have blocking APIs, at least optionally.

UnifiedMessageClient: got a "busy" (eresult 10) response

... which just throws an error. How should I handle these? Retry?

"target_job_name":"SteamNotification.GetSteamNotifications#1","eresult":10,"transport_error":1,"seq_num":1

There was also a 0-byte payload, but I couldn't demangle the typename.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.