... wait so the access token is useless?

This commit is contained in:
Artemis Tosini 2024-08-28 01:25:49 +00:00
parent de54c1d0f6
commit a02ce7a0f5
Signed by: artemist
GPG key ID: EE5227935FE3FF18

View file

@ -1,4 +1,5 @@
use color_eyre::eyre; use color_eyre::eyre;
use connection::CMSession;
use message::CMProtoBufMessage; use message::CMProtoBufMessage;
use rand::RngCore; use rand::RngCore;
use vapore_proto::{ use vapore_proto::{
@ -45,7 +46,7 @@ pub async fn main() -> eyre::Result<()> {
// We should probably make these consistent so Valve doesn't get suspicious, // We should probably make these consistent so Valve doesn't get suspicious,
// but for now let's make them random // but for now let's make them random
// TODO: Find a more generic way to make this // TODO: Find a more generic way to make this
let mut machine_id = Vec::with_capacity(161); let mut machine_id = Vec::with_capacity(155);
machine_id.extend_from_slice(b"\x00MessageObject\x00"); machine_id.extend_from_slice(b"\x00MessageObject\x00");
for key in [b"BB3", b"FF2", b"3B3"] { for key in [b"BB3", b"FF2", b"3B3"] {
let mut data = [0u8; 20]; let mut data = [0u8; 20];
@ -93,10 +94,10 @@ pub async fn main() -> eyre::Result<()> {
response.body.interval(), response.body.interval(),
)); ));
let (access_token, account_name) = loop { let (refresh_token, account_name) = loop {
interval.tick().await; interval.tick().await;
let request = CAuthentication_PollAuthSessionStatus_Request { let request = CAuthentication_PollAuthSessionStatus_Request {
client_id: response.body.client_id.clone(), client_id: response.body.client_id,
request_id: response.body.request_id.clone(), request_id: response.body.request_id.clone(),
..Default::default() ..Default::default()
}; };
@ -109,7 +110,7 @@ pub async fn main() -> eyre::Result<()> {
log::debug!("Got auth poll status {:#?}", response.body); log::debug!("Got auth poll status {:#?}", response.body);
if let Some(access_token) = response.body.access_token { if let Some(access_token) = response.body.refresh_token {
let account_name = response.body.account_name.unwrap_or_default(); let account_name = response.body.account_name.unwrap_or_default();
break (access_token, account_name); break (access_token, account_name);
} }
@ -126,7 +127,7 @@ pub async fn main() -> eyre::Result<()> {
log::debug!( log::debug!(
"Got account name {}, access token {}", "Got account name {}, access token {}",
account_name, account_name,
access_token refresh_token
); );
// normal user, desktop instance, public universe // normal user, desktop instance, public universe
@ -136,20 +137,20 @@ pub async fn main() -> eyre::Result<()> {
EMsg::k_EMsgClientLogon, EMsg::k_EMsgClientLogon,
CMsgClientLogon { CMsgClientLogon {
account_name: Some(account_name), account_name: Some(account_name),
access_token: Some(access_token), access_token: Some(refresh_token),
machine_name: Some("vapore".to_string()), machine_name: Some("vapore".to_string()),
machine_id: Some(machine_id), machine_id: Some(machine_id),
client_language: Some("english".to_string()), client_language: Some("english".to_string()),
protocol_version: Some(0x1002c), protocol_version: Some(0x1002c),
client_os_type: Some(20), client_os_type: Some(20),
client_package_version: Some(1721173382), client_package_version: Some(1771),
supports_rate_limit_response: Some(true), supports_rate_limit_response: Some(true),
should_remember_password: Some(true), should_remember_password: Some(true),
obfuscated_private_ip: protobuf::MessageField::some(CMsgIPAddress { obfuscated_private_ip: protobuf::MessageField::some(CMsgIPAddress {
ip: Some(cmsg_ipaddress::Ip::V4(0xc8a8_0002 ^ 0xbaad_f00d)), ip: Some(cmsg_ipaddress::Ip::V4(0xc0a8_0102 ^ 0xbaad_f00d)),
..Default::default() ..Default::default()
}), }),
deprecated_obfustucated_private_ip: Some(0xc8a8_0002 ^ 0xbaad_f00d), deprecated_obfustucated_private_ip: Some(0xc0a8_0102 ^ 0xbaad_f00d),
..Default::default() ..Default::default()
}, },
)?; )?;
@ -164,3 +165,22 @@ pub async fn main() -> eyre::Result<()> {
Ok(()) Ok(())
} }
fn login_anonymous(session: &mut CMSession, machine_id: Vec<u8>) -> eyre::Result<()> {
// Anonymous user
session.set_steam_id(0x01a0_0000_0000_0000);
session.send_notification(
EMsg::k_EMsgClientLogon,
CMsgClientLogon {
machine_name: Some("vapore".to_string()),
machine_id: Some(machine_id),
client_language: Some("english".to_string()),
protocol_version: Some(0x1002c),
client_os_type: Some(20),
..Default::default()
},
)?;
Ok(())
}