Ejemplo n.º 1
0
        public static byte[] GetMachineID(string userId)
        {
            var machineId = new MachineID();

            machineId.SetBB3(GetHexString(Encoding.UTF8.GetBytes(userId + "Machine")));
            machineId.SetFF2(GetHexString(Encoding.UTF8.GetBytes(userId + "Mac")));
            machineId.Set3B3(GetHexString(Encoding.UTF8.GetBytes(userId + "Disk")));

            using (MemoryStream ms = new MemoryStream())
            {
                machineId.WriteToStream(ms);

                return(ms.ToArray());
            }
        }
Ejemplo n.º 2
0
        static MachineID GenerateMachineID()
        {
            // the aug 25th 2015 CM update made well-formed machine MessageObjects required for logon
            // this was flipped off shortly after the update rolled out, likely due to linux steamclients running on distros without a way to build a machineid
            // so while a valid MO isn't currently (as of aug 25th) required, they could be in the future and we'll abide by The Valve Law now

            var machineId = new MachineID();

            MachineInfoProvider provider = MachineInfoProvider.GetProvider();

            machineId.SetBB3(GetHexString(provider.GetMachineGuid()));
            machineId.SetFF2(GetHexString(provider.GetMacAddress()));
            machineId.Set3B3(GetHexString(provider.GetDiskId()));

            // 333 is some sort of user supplied data and is currently unused

            return(machineId);
        }
Ejemplo n.º 3
0
        static MachineID GenerateMachineID(object?state)
        {
            // the aug 25th 2015 CM update made well-formed machine MessageObjects required for logon
            // this was flipped off shortly after the update rolled out, likely due to linux steamclients running on distros without a way to build a machineid
            // so while a valid MO isn't currently (as of aug 25th) required, they could be in the future and we'll abide by The Valve Law now

            var provider = (IMachineInfoProvider)state !;

            var machineId = new MachineID();

            // Custom implementations can fail for any particular field, in which case we fall back to DefaultMachineInfoProvider.
            machineId.SetBB3(GetHexString(provider.GetMachineGuid() ?? DefaultMachineInfoProvider.Instance.GetMachineGuid()));
            machineId.SetFF2(GetHexString(provider.GetMacAddress() ?? DefaultMachineInfoProvider.Instance.GetMacAddress()));
            machineId.Set3B3(GetHexString(provider.GetDiskId() ?? DefaultMachineInfoProvider.Instance.GetDiskId()));

            // 333 is some sort of user supplied data and is currently unused

            return(machineId);
        }
Ejemplo n.º 4
0
        public static string GenerateRandomMachineID()
        {
            var machineId = new MachineID();

            MachineInfoProvider provider = new RandomInfoProvider();



            machineId.SetBB3(GetHexString(provider.GetMachineGuid()));
            machineId.SetFF2(GetHexString(provider.GetMacAddress()));
            machineId.Set3B3(GetHexString(provider.GetDiskId()));

            // 333 is some sort of user supplied data and is currently unused

            byte[] buffer;
            using (MemoryStream ms = new MemoryStream())
            {
                machineId.WriteToStream(ms);

                buffer = ms.ToArray();
            }

            return(Convert.ToBase64String(buffer));
        }
Ejemplo n.º 5
0
        static MachineID GenerateMachineID()
        {
            // the aug 25th 2015 CM update made well-formed machine MessageObjects required for logon
            // this was flipped off shortly after the update rolled out, likely due to linux steamclients running on distros without a way to build a machineid
            // so while a valid MO isn't currently (as of aug 25th) required, they could be in the future and we'll abide by The Valve Law now

            var machineId = new MachineID();

            MachineInfoProvider provider = MachineInfoProvider.GetProvider();

            machineId.SetBB3( GetHexString( provider.GetMachineGuid() ) );
            machineId.SetFF2( GetHexString( provider.GetMacAddress() ) );
            machineId.Set3B3( GetHexString( provider.GetDiskId() ) );

            // 333 is some sort of user supplied data and is currently unused

            return machineId;
        }