2018-08-11 00:15:04 +02:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
Copyright 2018 UUP dump API authors
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function uupDevice() {
|
2018-12-13 21:19:51 +01:00
|
|
|
$tValue = base64_encode(hex2bin(randStr(60)));
|
|
|
|
$data = 't='.$tValue.'&p=';
|
|
|
|
return base64_encode(chunk_split($data, 1, "\0"));
|
2018-08-11 00:15:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function uupEncryptedData() {
|
|
|
|
$cookieInfo = @file_get_contents(dirname(__FILE__).'/cookie.json');
|
|
|
|
$cookieInfo = json_decode($cookieInfo, 1);
|
|
|
|
|
2018-12-13 21:19:51 +01:00
|
|
|
if(empty($cookieInfo)) {
|
|
|
|
$postData = composeGetCookieRequest(uupDevice());
|
|
|
|
sendWuPostRequest('https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx', $postData);
|
|
|
|
|
|
|
|
$encData = uupEncryptedData();
|
|
|
|
} else {
|
2018-08-11 00:15:04 +02:00
|
|
|
$encData = $cookieInfo['encryptedData'];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $encData;
|
|
|
|
}
|
|
|
|
?>
|