Skip to content

Instantly share code, notes, and snippets.

@hanbule
Forked from Frago9876543210/DumpTransferPacket.js
Created June 13, 2021 00:08
Show Gist options
  • Save hanbule/0d27655d7252cffa962d7fd71a3e8bcd to your computer and use it in GitHub Desktop.
Save hanbule/0d27655d7252cffa962d7fd71a3e8bcd to your computer and use it in GitHub Desktop.
//frida-trace -U -i "_ZN14TransferPacket4readER12BinaryStream" com.mojang.minecraftpe
//Tested on MCPE 1.1.4
{
onEnter: function(log, args, state) {
this.ptr = args[0];
},
onLeave: function(log, retval, state) {
realAddr = Memory.readPointer(this.ptr.add(12));
rlen = Memory.readU32(realAddr.sub(12));
uint8arr = new Uint8Array(Memory.readByteArray(realAddr, rlen));
var string = String.fromCharCode.apply(null, uint8arr),
host = decodeURIComponent(escape(string));
console.log(host + ':' + Memory.readU16(this.ptr.add(16)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment