sendHex
// ==UserScript==
// @name sendHex
// @namespace https://bbs.tampermonkey.net.cn/
// @version 0.1.0
// @description try to take over the world!
// @author You
// @match https://weixin.qq.com/
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// ==/UserScript==
(async function () {
'use strict';
let anonymous = true;
function tls(d) {
return new Promise((resolve, reject) => {
GM_xmlhttpRequest({
url: 'http://szextshort.weixin.qq.com/mmtls/3755b7e7',
method: 'POST',
data: new Blob([d]),
anonymous: anonymous,
responseType: 'blob',
headers: {
'sec-ch-ua-platform': '',
'dnt': '',
'sec-ch-ua': '',
'sec-ch-ua-mobile': '',
'Sec-Fetch-Site': '',
'Sec-Fetch-Mode': '',
'Sec-Fetch-Dest': '',
'User-Agent': 'MicroMessenger Client',
'Accept-Encoding': '',
'Content-Type': 'application/octet-stream',
'Accept': '*/*',
'Accept-Language': '',
//'Content-Length': '',
'Cache-Control': 'no-cache',
'Host': 'szextshort.weixin.qq.com',
'Upgrade': 'mmtls',
'Referer': '',
'origin': '',
'Cookie': ''
},
onload: function (xhr) {
let blob = xhr.response;
var fr = new FileReader();
unsafeWindow.fr = fr;
fr.addEventListener("load", function (ev) {
var abb = ev.target.result;
var iAA = new Uint8Array(abb);
// console.log(iAA);
// console.info(fr);
console.log(unsafeWindow.iAA = iAA);
let t = '';
for (let i = 0, len = iAA.length; i < len; i++) {
t = t + iAA[i].toString(16);
}
console.log(t)
});
//把blob文件转化为arraybuffer;
fr.readAsArrayBuffer(blob);
resolve()
},
onerror() {
reject("same errors")
},
})
})
}
let data = '19f10400a10000009d0104f10100a8025673537bdac747ed5a33862dc0b17c1b669ae7cdb1d99e341dcc9c4d89aae46386d0ac0000006f010000006a000f01000000630100093a80000000000048000c7fc14e6523d35471e93f64fd004814d6def5ffb908b002c7c0ee8ccc182e161ee06ccf701db0f74a20ac18a141651341830b9849dd653e85d79940c5036748b2cb8e0b85cb4997e628e0a100d1018d73af281b69e79c19f10400249804a8cdabe5d1842dd7bcaa4ed8ad0ac132eac2ed7a771bfa3ccbc404f456fd0c446cd417f1040195bb17859e5a4b3bc7a86c154159cc7c2804f681f03a5f3437b3d9d500bc1cef57b2ad7c4aef8a9c160632a5e1b9de76ffcbc8b393d719bd2e6418f65ff257684ab7ada6c02ac3d63074d2508bc7002e44417577a0ede9d4765ef9938b9eff95e1a5356bea737c20db98f612d392563cee95d3d6cc6a43d3942ca4d1d5cd5ec12a4e48ce905ba334ac28e8732024f37d6bbe623a9247323ca15889d9b9435ab21702ba54a246955870ed2f5b4e7b63d73badee8d74daf86926559fa1b4c82721305f389b8c60d38ae0f9d553002b04230590c2818add7deeed131a625f054677a6c55d8518c5dc15099add0341bcb8b25550e30ae4495df7fd22949586c5ccf8e6e56a66d608a0259010de0cbcfd76dc416a33778533eda25b856c0f7ef476d4285c60ab5a31a4ce6b6afacee5c520fadd32247fd17189731fa7c54fba4844bd2e62d5038085f99bb78fe915a4558cb64ea259dbbb3c2b15c4dacf2773d8abd59d4b893bd54b59965faaa4f944b224abd4ffbb54d43d19b534672488cc52de9a8420dee99628f90ea45a815d8e96e6ff7925f986c40e15f1040017e6e3ae6c8a48c97704dbfde7bd0dbc186af534e1bbc654';
let bytesArray = []
for (let i = 0, len = data.length; i < len; i = i + 2) {
bytesArray.push(parseInt(data[i] + data[i + 1], 16))
}
let buffer = new Uint16Array(bytesArray)
await tls(buffer);
// Your code here...
})();