diff --git a/daemon/src/main.rs b/daemon/src/main.rs index 3f4624e..ae8e1eb 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -1,4 +1,5 @@ use color_eyre::eyre; +use connection::CMSession; use message::CMProtoBufMessage; use rand::RngCore; 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, // but for now let's make them random // 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"); for key in [b"BB3", b"FF2", b"3B3"] { let mut data = [0u8; 20]; @@ -93,10 +94,10 @@ pub async fn main() -> eyre::Result<()> { response.body.interval(), )); - let (access_token, account_name) = loop { + let (refresh_token, account_name) = loop { interval.tick().await; 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(), ..Default::default() }; @@ -109,7 +110,7 @@ pub async fn main() -> eyre::Result<()> { 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(); break (access_token, account_name); } @@ -126,7 +127,7 @@ pub async fn main() -> eyre::Result<()> { log::debug!( "Got account name {}, access token {}", account_name, - access_token + refresh_token ); // normal user, desktop instance, public universe @@ -136,20 +137,20 @@ pub async fn main() -> eyre::Result<()> { EMsg::k_EMsgClientLogon, CMsgClientLogon { account_name: Some(account_name), - access_token: Some(access_token), + access_token: Some(refresh_token), 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), - client_package_version: Some(1721173382), + client_package_version: Some(1771), supports_rate_limit_response: Some(true), should_remember_password: Some(true), 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() }), - deprecated_obfustucated_private_ip: Some(0xc8a8_0002 ^ 0xbaad_f00d), + deprecated_obfustucated_private_ip: Some(0xc0a8_0102 ^ 0xbaad_f00d), ..Default::default() }, )?; @@ -164,3 +165,22 @@ pub async fn main() -> eyre::Result<()> { Ok(()) } + +fn login_anonymous(session: &mut CMSession, machine_id: Vec) -> 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(()) +}