Пример #1
0
        void OnUpdateMachineAuthCallback(SteamUser.UpdateMachineAuthCallback machineAuth, JobID jobId)
        {
            byte[] hash = SHAHash(machineAuth.Data);

            File.WriteAllBytes(String.Format("{0}.sentryfile", logOnDetails.Username), machineAuth.Data);

            var authResponse = new SteamUser.MachineAuthDetails
            {
                BytesWritten = machineAuth.BytesToWrite,
                FileName     = machineAuth.FileName,
                FileSize     = machineAuth.BytesToWrite,
                Offset       = machineAuth.Offset,

                SentryFileHash = hash,                         // should be the sha1 hash of the sentry file we just wrote

                OneTimePassword = machineAuth.OneTimePassword, // not sure on this one yet, since we've had no examples of steam using OTPs

                LastError = 0,                                 // result from win32 GetLastError
                Result    = EResult.OK,                        // if everything went okay, otherwise ~who knows~

                JobID = jobId,                                 // so we respond to the correct server job
            };

            // send off our response
            SteamUser.SendMachineAuthResponse(authResponse);
        }
Пример #2
0
        private void UpdateMachineAuthCallback(SteamUser.UpdateMachineAuthCallback machineAuth)
        {
            byte[] hash = Util.SHAHash(machineAuth.Data);
            Log.Info("Got Machine Auth: {0} {1} {2} {3}", machineAuth.FileName, machineAuth.Offset, machineAuth.BytesToWrite, machineAuth.Data.Length, hash);

            AccountSettingsStore.Instance.SentryData[logonDetails.Username] = machineAuth.Data;
            AccountSettingsStore.Save();

            var authResponse = new SteamUser.MachineAuthDetails
            {
                BytesWritten = machineAuth.BytesToWrite,
                FileName     = machineAuth.FileName,
                FileSize     = machineAuth.BytesToWrite,
                Offset       = machineAuth.Offset,

                SentryFileHash = hash,                         // should be the sha1 hash of the sentry file we just wrote

                OneTimePassword = machineAuth.OneTimePassword, // not sure on this one yet, since we've had no examples of steam using OTPs

                LastError = 0,                                 // result from win32 GetLastError
                Result    = EResult.OK,                        // if everything went okay, otherwise ~who knows~

                JobID = machineAuth.JobID,                     // so we respond to the correct server job
            };

            // send off our response
            steamUser.SendMachineAuthResponse(authResponse);
        }
Пример #3
0
        private void _onUpdateMachineAuthCallback(SteamUser.UpdateMachineAuthCallback machineAuth)
        {
            byte[] hash = _sec_SHAHash(machineAuth.Data);

            Directory.CreateDirectory(Path.Combine(Application.StartupPath, "sentryfiles"));

            File.WriteAllBytes(Path.Combine("sentryfiles", string.Format(
                                                "{0}.sentryfile", logOnDetails.Username)), machineAuth.Data);

            var authResponse = new SteamUser.MachineAuthDetails
            {
                BytesWritten = machineAuth.BytesToWrite,
                FileName     = machineAuth.FileName,
                FileSize     = machineAuth.BytesToWrite,
                Offset       = machineAuth.Offset,

                SentryFileHash = hash,                         // should be the sha1 hash of the sentry file we just wrote

                OneTimePassword = machineAuth.OneTimePassword, // not sure on this one yet, since we've had no examples of steam using OTPs

                LastError = 0,                                 // result from win32 GetLastError
                Result    = EResult.OK,                        // if everything went okay, otherwise ~who knows~
                JobID     = machineAuth.JobID,                 // so we respond to the correct server job
            };

            // send off our response
            SteamUser.SendMachineAuthResponse(authResponse);
            Log.Debug("Sent Machine AUTH response.");
        }
Пример #4
0
        void OnUpdateMachineAuthCallback(SteamUser.UpdateMachineAuthCallback machineAuth)
        {
            byte[] hash = SHAHash(machineAuth.Data);

            Directory.CreateDirectory(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "sentryfiles"));

            File.WriteAllBytes(System.IO.Path.Combine("sentryfiles", String.Format("{0}.sentryfile", logon.Username)), machineAuth.Data);

            var authResponse = new SteamUser.MachineAuthDetails
            {
                BytesWritten = machineAuth.BytesToWrite,
                FileName     = machineAuth.FileName,
                FileSize     = machineAuth.BytesToWrite,
                Offset       = machineAuth.Offset,

                SentryFileHash  = hash,
                OneTimePassword = machineAuth.OneTimePassword,
                LastError       = 0,
                Result          = EResult.OK,
                JobID           = machineAuth.JobID,
            };

            // send off our response
            user.SendMachineAuthResponse(authResponse);
        }
Пример #5
0
        void OnUpdateMachineAuthCallback(SteamUser.UpdateMachineAuthCallback machineAuth, JobID jobId)
        {
            byte[] hash = SHAHash(machineAuth.Data);

            StringBuilder sb = new StringBuilder();

            for (int count = 0; count < hash.Length; count++)
            {
                sb.Append(hash[count]);
            }

            MachineAuthData = sb.ToString();

            Directory.CreateDirectory(Application.StartupPath + "/sentryfiles/");
            File.WriteAllBytes(String.Format("{0}/sentryfiles/{1}.sentryfile", Application.StartupPath, logOnDetails.Username), machineAuth.Data);

            var authResponse = new SteamUser.MachineAuthDetails
            {
                BytesWritten = machineAuth.BytesToWrite,
                FileName     = machineAuth.FileName,
                FileSize     = machineAuth.BytesToWrite,
                Offset       = machineAuth.Offset,

                SentryFileHash = hash,                         // should be the sha1 hash of the sentry file we just wrote

                OneTimePassword = machineAuth.OneTimePassword, // not sure on this one yet, since we've had no examples of steam using OTPs

                LastError = 0,                                 // result from win32 GetLastError
                Result    = EResult.OK,                        // if everything went okay, otherwise ~who knows~

                JobID = jobId,                                 // so we respond to the correct server job
            };

            // send off our response
            SteamUser.SendMachineAuthResponse(authResponse);
        }
Пример #6
0
 public void SendMachineAuthResponse(SteamUser.MachineAuthDetails details)
 => user.SendMachineAuthResponse(details);