2 files changed, 29 insertions, 0 deletions
diff --git a/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDataLog.html b/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDataLog.html
new file mode 100644
index 0000000..ef16e72
--- /dev/null
+++ b/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDataLog.html
@@ -0,0 +1,7 @@
+<script>
+ window.toHexString = function (byteArray) {
+ return byteArray.reduce((output, elem) =>
+ (output + (elem.toString(16).padStart(2, '0').toUpperCase() + ' ')),
+ '');
+ }
+</script>
\ No newline at end of file
diff --git a/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html b/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html
new file mode 100644
index 0000000..14dc989
--- /dev/null
+++ b/ReferenceClientProxyImplementation/Resources/Private/Injections/WebSocketDumper.html
@@ -0,0 +1,22 @@
+<script>
+ window.sockets = [];
+ var lastBuff = '';
+ const nativeWebSocket = window.WebSocket;
+ window.WebSocket = function (...args) {
+ console.log("Starting new websocket");
+ const socket = new nativeWebSocket(...args);
+ window.sockets.push(socket);
+ if (!args[0].includes('spotify'))
+ socket.addEventListener("message", ev => {
+ console.log("Dumping message...");
+ lastBuff = ev.data;
+ var dat = new Uint8Array(lastBuff);
+ if (window.toHexString) console.log(window.toHexString(dat));
+ var xhr = new XMLHttpRequest;
+ xhr.open("POST", "http://localhost:2001/dump/cs", false);
+ xhr.send(ev.data);
+ });
+ console.log("Websocket hooked!", socket);
+ return socket;
+ };
+</script>
\ No newline at end of file
|