private RequestEnvelope.Types.PlatformRequest GenerateSignature(IEnumerable<IMessage> requests) { var ticketBytes = _authTicket.ToByteArray(); var sig = new SignalAgglomUpdates() { EpochTimestampMs = (ulong)Utils.GetTime(true), TimestampMsSinceStart = (ulong)(Utils.GetTime(true) - _startTime), LocationHashByTokenSeed = (uint)Utils.GenerateLocation1(ticketBytes, _latitude, _longitude, _accuracy), LocationHash = (uint)Utils.GenerateLocation2(_latitude, _longitude, _accuracy), SensorUpdates = new SignalAgglomUpdates.Types.SensorUpdate() { GravityX = GenRandom(-0.31110161542892456, 0.1681540310382843), GravityY = GenRandom(-0.6574847102165222, -0.07290205359458923), GravityZ = GenRandom(-0.9943905472755432, -0.7463029026985168), Timestamp = (ulong)(Utils.GetTime(true) - _startTime - RandomDevice.Next(100, 400)), AccelerationX = GenRandom(-0.139084026217, 0.138112977147), AccelerationY = GenRandom(-0.2, 0.19), AccelerationZ = GenRandom(-0.2, 0.4), MagneticFieldX = GenRandom(-47.149471283, 61.8397789001), MagneticFieldY = GenRandom(-47.149471283, 61.8397789001), MagneticFieldZ = GenRandom(-47.149471283, 5), AttitudePitch = GenRandom(0.0729667818829, 0.0729667818829), AttitudeYaw = GenRandom(-2.788630499244109, 3.0586791383810468), AttitudeRoll = GenRandom(-0.34825887123552773, 0.19347580173737935), RotationRateX = GenRandom(-0.9703824520111084, 0.8556089401245117), RotationRateY = GenRandom(-1.7470258474349976, 1.4218578338623047), RotationRateZ = GenRandom(-0.9681901931762695, 0.8396636843681335), Status = 3 }, DeviceInfo = new SignalAgglomUpdates.Types.DeviceInfo() { DeviceId = settings.DeviceId, AndroidBoardName = settings.AndroidBoardName, AndroidBootloader = settings.AndroidBootloader, DeviceBrand = settings.DeviceBrand, DeviceModel = settings.DeviceModel, DeviceModelIdentifier = settings.DeviceModelIdentifier, DeviceCommsModel = settings.DeviceModelBoot, HardwareManufacturer = settings.HardwareManufacturer, HardwareModel = settings.HardwareModel, FirmwareBrand = settings.FirmwareBrand, FirmwareTags = settings.FirmwareTags, FirmwareType = settings.FirmwareType, FirmwareFingerprint = settings.FirmwareFingerprint } }; if (settings.DeviceBrand == "APPLE") sig.LocationUpdates.Add(new SignalAgglomUpdates.Types.LocationUpdate() { Name = "fused", TimestampMs = (Utils.GetTime(true) - _startTime - RandomDevice.Next(100, 300)), Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (-(float)_altitude) - 13, DeviceSpeed = (float)_currentSpeed, DeviceCourse = -1, HorizontalAccuracy = (float)_accuracy, VerticalAccuracy = RandomDevice.Next(2, 5), ProviderStatus = 3, Floor = 0, LocationType = 1 }); else sig.LocationUpdates.Add(new SignalAgglomUpdates.Types.LocationUpdate() { Name = "fused", TimestampMs = (Utils.GetTime(true) - _startTime - RandomDevice.Next(100, 300)), Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (-(float)_altitude) - 13, HorizontalAccuracy = (float)_accuracy, VerticalAccuracy = RandomDevice.Next(2, 5), ProviderStatus = 3, Floor = 0, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_accuracy).Reverse()).ToArray(); sig.LocationHashByTokenSeed = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) sig.RequestHashes.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); sig.Field22 = SessionHash; //static for now sig.Field25 = 7363665268261373700; RequestEnvelope.Types.PlatformRequest val = new RequestEnvelope.Types.PlatformRequest(); val.Type = PlatformRequestType.SendEncryptedSignature; SendEncryptedSignatureRequest sigRequest = new SendEncryptedSignatureRequest(); sigRequest.EncryptedSignature = ByteString.CopyFrom(Encrypt(sig.ToByteArray())); val.RequestMessage = sigRequest.ToByteString(); return val; }
private RequestEnvelope.Types.PlatformRequest GenerateSignature(IEnumerable <IMessage> requests) { var sig = new POGOProtos.Networking.Envelopes.Signature(); sig.TimestampSinceStart = (ulong)_internalWatch.ElapsedMilliseconds; sig.Timestamp = (ulong)DateTime.UtcNow.ToUnixTime(); sig.SensorInfo = new POGOProtos.Networking.Envelopes.Signature.Types.SensorInfo() { GravityZ = GenRandom(9.8), GravityX = GenRandom(0.02), GravityY = GenRandom(0.3), TimestampSnapshot = (ulong)_internalWatch.ElapsedMilliseconds - 230, LinearAccelerationX = GenRandom(0.12271042913198471), LinearAccelerationY = GenRandom(-0.015570580959320068), LinearAccelerationZ = GenRandom(0.010850906372070313), MagneticFieldX = GenRandom(17.950439453125), MagneticFieldY = GenRandom(-23.36273193359375), MagneticFieldZ = GenRandom(-48.8250732421875), RotationVectorX = GenRandom(-0.0120010357350111), RotationVectorY = GenRandom(-0.04214850440621376), RotationVectorZ = GenRandom(0.94571763277053833), GyroscopeRawX = GenRandom(7.62939453125e-005), GyroscopeRawY = GenRandom(-0.00054931640625), GyroscopeRawZ = GenRandom(0.0024566650390625), AccelerometerAxes = 3 }; sig.DeviceInfo = new POGOProtos.Networking.Envelopes.Signature.Types.DeviceInfo() { DeviceId = this.DeviceId, AndroidBoardName = this.AndroidBoardName, // might al AndroidBootloader = this.AndroidBootloader, DeviceBrand = this.DeviceBrand, DeviceModel = this.DeviceModel, // might als DeviceModelIdentifier = this.DeviceModelIdentifier, DeviceModelBoot = this.DeviceModelBoot, HardwareManufacturer = this.HardwareManufacturer, HardwareModel = this.HardwareModel, FirmwareBrand = this.FirmwareBrand, FirmwareTags = this.FirmwareTags, FirmwareType = this.FirmwareType, FirmwareFingerprint = this.FirmwareFingerprint }; Random r = new Random(); int accuracy = r.Next(15, 50); sig.LocationFix.Add(new POGOProtos.Networking.Envelopes.Signature.Types.LocationFix() { Provider = "gps", //Unk4 = 120, TimestampSnapshot = (ulong)_internalWatch.ElapsedMilliseconds - 200, Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (float)_altitude, HorizontalAccuracy = accuracy, // Genauigkeit von GPS undso ProviderStatus = 3, Floor = 3, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_altitude).Reverse()).ToArray(); sig.LocationHash1 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash2 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) { sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); } // NEW Random Byte Array every session. if (sessionhash_array == null) { byte[] rByte = new byte[16]; r.NextBytes(rByte); sessionhash_array = rByte; } sig.SessionHash = ByteString.CopyFrom(sessionhash_array); sig.Unknown25 = -8537042734809897855; // Generated via xxHash64("\"b8fa9757195897aae92c53dbcf8a60fb3d86d745\"".ToByteArray(), 0x88533787) | 0.33 Version var iv = new byte[32]; new Random().NextBytes(iv); var platformRequest = new RequestEnvelope.Types.PlatformRequest() { Type = PlatformRequestType.SendEncryptedSignature, RequestMessage = new SendEncryptedSignatureRequest() { EncryptedSignature = ByteString.CopyFrom(EncryptionHelper.Encrypt(sig.ToByteArray(), iv)), }.ToByteString(), }; return(platformRequest); }
private Unknown6 GenerateSignature(IEnumerable <IMessage> requests) { var sig = new POGOProtos.Networking.Signature(); sig.TimestampSinceStart = (ulong)_internalWatch.ElapsedMilliseconds; sig.Timestamp = (ulong)DateTime.UtcNow.ToUnixTime(); sig.SensorInfo = new POGOProtos.Networking.Signature.Types.SensorInfo() { AccelNormalizedZ = GenRandom(9.8), AccelNormalizedX = GenRandom(0.02), AccelNormalizedY = GenRandom(0.3), TimestampSnapshot = (ulong)_internalWatch.ElapsedMilliseconds - 230, MagnetometerX = GenRandom(0.12271042913198471), MagnetometerY = GenRandom(-0.015570580959320068), MagnetometerZ = GenRandom(0.010850906372070313), AngleNormalizedX = GenRandom(17.950439453125), AngleNormalizedY = GenRandom(-23.36273193359375), AngleNormalizedZ = GenRandom(-48.8250732421875), AccelRawX = GenRandom(-0.0120010357350111), AccelRawY = GenRandom(-0.04214850440621376), AccelRawZ = GenRandom(0.94571763277053833), GyroscopeRawX = GenRandom(7.62939453125e-005), GyroscopeRawY = GenRandom(-0.00054931640625), GyroscopeRawZ = GenRandom(0.0024566650390625), AccelerometerAxes = 3 }; sig.DeviceInfo = new POGOProtos.Networking.Signature.Types.DeviceInfo() { DeviceId = settings.DeviceId, AndroidBoardName = settings.AndroidBoardName, AndroidBootloader = settings.AndroidBootloader, DeviceBrand = settings.DeviceBrand, DeviceModel = settings.DeviceModel, DeviceModelIdentifier = settings.DeviceModelIdentifier, DeviceModelBoot = settings.DeviceModelBoot, HardwareManufacturer = settings.HardwareManufacturer, HardwareModel = settings.HardwareModel, FirmwareBrand = settings.FirmwareBrand, FirmwareTags = settings.FirmwareTags, FirmwareType = settings.FirmwareType, FirmwareFingerprint = settings.FirmwareFingerprint }; float altitude = 0; long requestLength = 200; lock (RandomDevice) { altitude = (float)(RandomDevice.NextDouble() * (15 - 10) + 10); requestLength = (long)RandomDevice.Next(100, 300); } sig.LocationFix.Add(new POGOProtos.Networking.Signature.Types.LocationFix() { Provider = "network", //Unk4 = 120, Latitude = (float)_latitude, Longitude = (float)_longitude, //Altitude = (float)_altitude, Altitude = altitude, //Just random for now TimestampSinceStart = (ulong)(_internalWatch.ElapsedMilliseconds - requestLength), Floor = 3, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_altitude).Reverse()).ToArray(); sig.LocationHash1 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash2 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) { sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); } //static for now //sig.Unk22 = ByteString.CopyFrom(new byte[16] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }); byte[] buffer = new byte[16]; lock (RandomDevice) { RandomDevice.NextBytes(buffer); } sig.Unk22 = ByteString.CopyFrom(buffer); Unknown6 val = new Unknown6(); val.RequestType = 6; val.Unknown2 = new Unknown6.Types.Unknown2(); val.Unknown2.Unknown1 = ByteString.CopyFrom(Encrypt(sig.ToByteArray())); return(val); }
private Unknown6 GenerateSignature(IEnumerable <IMessage> requests) { var sig = new POGOProtos.Networking.Signature(); sig.TimestampSinceStart = (ulong)_internalWatch.ElapsedMilliseconds; sig.Timestamp = (ulong)DateTime.UtcNow.ToUnixTime(); sig.SensorInfo = new POGOProtos.Networking.Signature.Types.SensorInfo() { AccelNormalizedZ = GenRandom(9.8), AccelNormalizedX = GenRandom(0.02), AccelNormalizedY = GenRandom(0.3), TimestampSnapshot = (ulong)_internalWatch.ElapsedMilliseconds - 230, MagnetometerX = GenRandom(0.12271042913198471), MagnetometerY = GenRandom(-0.015570580959320068), MagnetometerZ = GenRandom(0.010850906372070313), AngleNormalizedX = GenRandom(17.950439453125), AngleNormalizedY = GenRandom(-23.36273193359375), AngleNormalizedZ = GenRandom(-48.8250732421875), AccelRawX = GenRandom(-0.0120010357350111), AccelRawY = GenRandom(-0.04214850440621376), AccelRawZ = GenRandom(0.94571763277053833), GyroscopeRawX = GenRandom(7.62939453125e-005), GyroscopeRawY = GenRandom(-0.00054931640625), GyroscopeRawZ = GenRandom(0.0024566650390625), AccelerometerAxes = 3 }; sig.DeviceInfo = new POGOProtos.Networking.Signature.Types.DeviceInfo() { DeviceId = GetDeviceId(), AndroidBoardName = "msm8994", // might al AndroidBootloader = "unknown", DeviceBrand = "OnePlus", DeviceModel = "OnePlus2", // might als DeviceModelIdentifier = "ONE A2003_24_160604", DeviceModelBoot = "qcom", HardwareManufacturer = "OnePlus", HardwareModel = "ONE A2003", FirmwareBrand = "OnePlus2", FirmwareTags = "dev-keys", FirmwareType = "user", FirmwareFingerprint = "OnePlus/OnePlus2/OnePlus2:6.0.1/MMB29M/1447840820:user/release-keys" }; sig.LocationFix.Add(new POGOProtos.Networking.Signature.Types.LocationFix() { Provider = "network", //Unk4 = 120, Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (float)_altitude, TimestampSinceStart = (ulong)_internalWatch.ElapsedMilliseconds - 200, Floor = 3, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_altitude).Reverse()).ToArray(); sig.LocationHash1 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash2 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) { sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); } //static for now sig.Unk22 = ByteString.CopyFrom(new byte[16] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }); Unknown6 val = new Unknown6(); val.RequestType = 6; val.Unknown2 = new Unknown6.Types.Unknown2(); val.Unknown2.Unknown1 = ByteString.CopyFrom(Encrypt(sig.ToByteArray())); return(val); }
private Unknown6 GenerateSignature(IEnumerable <IMessage> requests) { var accelNextZ = RandomDevice.NextInRange(5.8125, 10.125); //9,80665 var accelNextX = RandomDevice.NextInRange(-0.513123, 0.61231567); //Considering we handle phone only in 2 directions var accelNextY = Math.Sqrt(96.16744225D - accelNextZ * accelNextZ) * ((accelNextZ > 9.8) ? -1 : 1); var sig = new Signature { TimestampSinceStart = (ulong)InternalWatch.ElapsedMilliseconds, Timestamp = (ulong)DateTime.UtcNow.ToUnixTime(), SensorInfo = new Signature.Types.SensorInfo() { AccelNormalizedZ = accelNextZ, AccelNormalizedX = accelNextX, AccelNormalizedY = accelNextY, TimestampSnapshot = (ulong)InternalWatch.ElapsedMilliseconds - 230, MagnetometerX = accelNextX * 10, MagnetometerY = -20 + -20 * accelNextY / 9.8065, MagnetometerZ = -40 * accelNextZ / 9.8065, AngleNormalizedX = Math.Acos(accelNextX / 9.8065), AngleNormalizedY = Math.Acos(accelNextY / 9.8065), AngleNormalizedZ = Math.Acos(accelNextZ / 9.8065), AccelRawX = RandomDevice.NextInRange(-0.005, 0.005), AccelRawY = RandomDevice.NextInRange(0.5, 1), AccelRawZ = RandomDevice.NextInRange(-0.05, 0.05), GyroscopeRawX = RandomDevice.NextInRange(-0.0001, 0.0001), GyroscopeRawY = RandomDevice.NextInRange(-0.0005, 0.0005), GyroscopeRawZ = RandomDevice.NextInRange(-0.003, 0.003), AccelerometerAxes = 3 }, DeviceInfo = new Signature.Types.DeviceInfo() { DeviceId = _settings.DeviceId, AndroidBoardName = _settings.AndroidBoardName, AndroidBootloader = _settings.AndroidBootloader, DeviceBrand = _settings.DeviceBrand, DeviceModel = _settings.DeviceModel, DeviceModelIdentifier = _settings.DeviceModelIdentifier, DeviceModelBoot = _settings.DeviceModelBoot, HardwareManufacturer = _settings.HardwareManufacturer, HardwareModel = _settings.HardwareModel, FirmwareBrand = _settings.FirmwareBrand, FirmwareTags = _settings.FirmwareTags, FirmwareType = _settings.FirmwareType, FirmwareFingerprint = _settings.FirmwareFingerprint } }; sig.LocationFix.Add(new Signature.Types.LocationFix() { Provider = "fused", //Unk4 = 120, Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (float)_altitude, //TimestampSinceStart = (ulong)InternalWatch.ElapsedMilliseconds - 200, TimestampSnapshot = (ulong)InternalWatch.ElapsedMilliseconds - 200, Floor = 3, HorizontalAccuracy = (float)Math.Round(RandomDevice.NextInRange(4, 10), 6), VerticalAccuracy = RandomDevice.Next(3, 7), ProviderStatus = 3, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_altitude).Reverse()).ToArray(); sig.LocationHash1 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash2 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) { sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); } //static for now //sig.Unk22 = ByteString.CopyFrom(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F); sig.SessionHash = SessionHash; sig.Unknown25 = -7363665268261373700; //-8537042734809897855; var val = new Unknown6 { RequestType = 6, Unknown2 = new Unknown6.Types.Unknown2 { Unknown1 = ByteString.CopyFrom(Encrypt(sig.ToByteArray())) } }; return(val); }
private Unknown6 GenerateSignature(IEnumerable<IMessage> requests) { var sig = new POGOProtos.Networking.Signature(); sig.TimestampSinceStart = (ulong)_internalWatch.ElapsedMilliseconds; sig.Timestamp = (ulong)DateTime.UtcNow.ToUnixTime(); sig.SensorInfo = new POGOProtos.Networking.Signature.Types.SensorInfo() { AccelNormalizedZ = GenRandom(9.8), AccelNormalizedX = GenRandom(0.02), AccelNormalizedY = GenRandom(0.3), TimestampSnapshot = (ulong)_internalWatch.ElapsedMilliseconds - 230, MagnetometerX = GenRandom(0.12271042913198471), MagnetometerY = GenRandom(-0.015570580959320068), MagnetometerZ = GenRandom(0.010850906372070313), AngleNormalizedX = GenRandom(17.950439453125), AngleNormalizedY = GenRandom(-23.36273193359375), AngleNormalizedZ = GenRandom(-48.8250732421875), AccelRawX = GenRandom(-0.0120010357350111), AccelRawY = GenRandom(-0.04214850440621376), AccelRawZ = GenRandom(0.94571763277053833), GyroscopeRawX = GenRandom(7.62939453125e-005), GyroscopeRawY = GenRandom(-0.00054931640625), GyroscopeRawZ = GenRandom(0.0024566650390625), AccelerometerAxes = 3 }; sig.DeviceInfo = new POGOProtos.Networking.Signature.Types.DeviceInfo() { DeviceId = GetDeviceId(), AndroidBoardName = "msm8994", // might al AndroidBootloader = "unknown", DeviceBrand = "OnePlus", DeviceModel = "OnePlus2", // might als DeviceModelIdentifier = "ONE A2003_24_160604", DeviceModelBoot = "qcom", HardwareManufacturer = "OnePlus", HardwareModel = "ONE A2003", FirmwareBrand = "OnePlus2", FirmwareTags = "dev-keys", FirmwareType = "user", FirmwareFingerprint = "OnePlus/OnePlus2/OnePlus2:6.0.1/MMB29M/1447840820:user/release-keys" }; sig.LocationFix.Add(new POGOProtos.Networking.Signature.Types.LocationFix() { Provider = "network", //Unk4 = 120, Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (float)_altitude, TimestampSinceStart = (ulong)_internalWatch.ElapsedMilliseconds - 200, Floor = 3, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_altitude).Reverse()).ToArray(); sig.LocationHash1 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash2 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); //static for now sig.Unk22 = ByteString.CopyFrom(new byte[16] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }); Unknown6 val = new Unknown6(); val.RequestType = 6; val.Unknown2 = new Unknown6.Types.Unknown2(); val.Unknown2.Unknown1 = ByteString.CopyFrom(Encrypt(sig.ToByteArray())); return val; }
private Unknown6 GenerateSignature(IEnumerable <IMessage> requests) { var sig = new Signature(); sig.TimestampSinceStart = (ulong)(Utils.GetTime(true) - _startTime); sig.Timestamp = (ulong)DateTime.UtcNow.ToUnixTime(); sig.SensorInfo = new Signature.Types.SensorInfo() { AccelNormalizedX = GenRandom(-0.31110161542892456, 0.1681540310382843), AccelNormalizedY = GenRandom(-0.6574847102165222, -0.07290205359458923), AccelNormalizedZ = GenRandom(-0.9943905472755432, -0.7463029026985168), TimestampSnapshot = (ulong)(Utils.GetTime(true) - _startTime - RandomDevice.Next(100, 400)), MagnetometerX = GenRandom(-0.139084026217, 0.138112977147), MagnetometerY = GenRandom(-0.2, 0.19), MagnetometerZ = GenRandom(-0.2, 0.4), AngleNormalizedX = GenRandom(-47.149471283, 61.8397789001), AngleNormalizedY = GenRandom(-47.149471283, 61.8397789001), AngleNormalizedZ = GenRandom(-47.149471283, 5), AccelRawX = GenRandom(0.0729667818829, 0.0729667818829), AccelRawY = GenRandom(-2.788630499244109, 3.0586791383810468), AccelRawZ = GenRandom(-0.34825887123552773, 0.19347580173737935), GyroscopeRawX = GenRandom(-0.9703824520111084, 0.8556089401245117), GyroscopeRawY = GenRandom(-1.7470258474349976, 1.4218578338623047), GyroscopeRawZ = GenRandom(-0.9681901931762695, 0.8396636843681335), AccelerometerAxes = 3 }; sig.DeviceInfo = new POGOProtos.Networking.Signature.Types.DeviceInfo(); if (settings.DeviceId != null) { sig.DeviceInfo.DeviceId = settings.DeviceId; } if (settings.AndroidBoardName != null) { sig.DeviceInfo.AndroidBoardName = settings.AndroidBoardName; } if (settings.AndroidBootloader != null) { sig.DeviceInfo.AndroidBootloader = settings.AndroidBootloader; } if (settings.DeviceBrand != null) { sig.DeviceInfo.DeviceBrand = settings.DeviceBrand; } if (settings.DeviceModel != null) { sig.DeviceInfo.DeviceModel = settings.DeviceModel; } if (settings.DeviceModelIdentifier != null) { sig.DeviceInfo.DeviceModelIdentifier = settings.DeviceModelIdentifier; } if (settings.DeviceModelBoot != null) { sig.DeviceInfo.DeviceModelBoot = settings.DeviceModelBoot; } if (settings.HardwareManufacturer != null) { sig.DeviceInfo.HardwareManufacturer = settings.HardwareManufacturer; } if (settings.HardwareModel != null) { sig.DeviceInfo.HardwareModel = settings.HardwareModel; } if (settings.FirmwareBrand != null) { sig.DeviceInfo.FirmwareBrand = settings.FirmwareBrand; } if (settings.FirmwareTags != null) { sig.DeviceInfo.FirmwareTags = settings.FirmwareTags; } if (settings.FirmwareType != null) { sig.DeviceInfo.FirmwareType = settings.FirmwareType; } if (settings.FirmwareFingerprint != null) { sig.DeviceInfo.FirmwareFingerprint = settings.FirmwareFingerprint; } sig.LocationFix.Add(new POGOProtos.Networking.Signature.Types.LocationFix() { Provider = "fused", Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (float)_altitude, HorizontalAccuracy = (float)Math.Round(GenRandom(50, 250), 7), VerticalAccuracy = RandomDevice.Next(2, 5), //TimestampSnapshot = (ulong)(Utils.GetTime(true) - _startTime - RandomDevice.Next(100, 300)), ProviderStatus = 3, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_altitude).Reverse()).ToArray(); sig.LocationHash1 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash2 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) { sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); } //static for now sig.Unk22 = ByteString.CopyFrom(new byte[16] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }); Unknown6 val = new Unknown6(); val.RequestType = 6; val.Unknown2 = new Unknown6.Types.Unknown2(); val.Unknown2.Unknown1 = ByteString.CopyFrom(Encrypt(sig.ToByteArray())); return(val); }
public byte[] ComputeHash(Stream stream) { return(algorithm.ComputeHash(stream)); }
private Unknown6 GenerateSignature(IEnumerable <IMessage> requests) { var ticketBytes = _authTicket.ToByteArray(); //Added var sig = new Signature() { LocationHash1 = Utils.GenerateLocation1(ticketBytes, _latitude, _longitude, _altitude), LocationHash2 = Utils.GenerateLocation2(_latitude, _longitude, _altitude), SensorInfo = new Signature.Types.SensorInfo() { AccelNormalizedZ = GenRandom(9.8), AccelNormalizedX = GenRandom(0.02), AccelNormalizedY = GenRandom(0.3), TimestampSnapshot = (ulong)_internalWatch.ElapsedMilliseconds - 230, MagnetometerX = GenRandom(0.12271042913198471), MagnetometerY = GenRandom(-0.015570580959320068), MagnetometerZ = GenRandom(0.010850906372070313), AngleNormalizedX = GenRandom(17.950439453125), AngleNormalizedY = GenRandom(-23.36273193359375), AngleNormalizedZ = GenRandom(-48.8250732421875), AccelRawX = GenRandom(-0.0120010357350111), AccelRawY = GenRandom(-0.04214850440621376), AccelRawZ = GenRandom(0.94571763277053833), GyroscopeRawX = GenRandom(7.62939453125e-005), GyroscopeRawY = GenRandom(-0.00054931640625), GyroscopeRawZ = GenRandom(0.0024566650390625), AccelerometerAxes = 3 }, DeviceInfo = new Signature.Types.DeviceInfo() { DeviceId = Client.DeviceId, AndroidBoardName = Client.AndroidBoardName, AndroidBootloader = Client.AndroidBootloader, DeviceBrand = Client.DeviceBrand, DeviceModel = Client.DeviceModel, DeviceModelIdentifier = Client.DeviceModelIdentifier, DeviceModelBoot = Client.DeviceModelBoot, HardwareManufacturer = Client.HardwareManufacturer, HardwareModel = Client.HardwareModel, FirmwareBrand = Client.FirmwareBrand, FirmwareTags = Client.FirmwareTags, FirmwareType = Client.FirmwareType, FirmwareFingerprint = Client.FirmwareFingerprint } }; sig.LocationFix.Add(new Signature.Types.LocationFix() { Provider = "network", //Unk4 = 120, Latitude = (float)_latitude, Longitude = (float)_longitude, Altitude = (float)_altitude, TimestampSinceStart = (ulong)_internalWatch.ElapsedMilliseconds - 200, Floor = 3, LocationType = 1 }); //Compute 10 var x = new System.Data.HashFunction.xxHash(32, 0x1B845238); var firstHash = BitConverter.ToUInt32(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(32, firstHash); var locationBytes = BitConverter.GetBytes(_latitude).Reverse() .Concat(BitConverter.GetBytes(_longitude).Reverse()) .Concat(BitConverter.GetBytes(_altitude).Reverse()).ToArray(); sig.LocationHash1 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 20 x = new System.Data.HashFunction.xxHash(32, 0x1B845238); sig.LocationHash2 = BitConverter.ToUInt32(x.ComputeHash(locationBytes), 0); //Compute 24 x = new System.Data.HashFunction.xxHash(64, 0x1B845238); var seed = BitConverter.ToUInt64(x.ComputeHash(_authTicket.ToByteArray()), 0); x = new System.Data.HashFunction.xxHash(64, seed); foreach (var req in requests) { sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(req.ToByteArray()), 0)); } Unknown6 val = new Unknown6(); val.RequestType = 6; val.Unknown2 = new Unknown6.Types.Unknown2(); val.Unknown2.Unknown1 = ByteString.CopyFrom(Encrypt(sig.ToByteArray())); foreach (var request in requests) { sig.RequestHash.Add(BitConverter.ToUInt64(x.ComputeHash(request.ToByteArray()), 0)); } sig.Unk22 = ByteString.CopyFrom(new byte[16] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }); sig.Unk25 = BitConverter.ToUInt32(new System.Data.HashFunction.xxHash(64, 0x88533787).ComputeHash(System.Text.Encoding.ASCII.GetBytes("\"0f15301fe1d0e824738ef5d93355e56a6fb910d4\"")), 0); return(val); }