sys-botbase icon indicating copy to clipboard operation
sys-botbase copied to clipboard

Can't get pixelPeek working

Open Lucasthoelke opened this issue 3 years ago • 3 comments

I can't seem te get pixelPeek working. Am i doing something wrong?

import socket
import sys
import time
import binascii


def sendCommand(s, content):
    print(content)
    content += '\r\n' #important for the parser on the switch side
    s.sendall(content.encode())

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.178.75", 6000))

sendCommand(s, 'pixelPeek')
res = s.recv(512000)

print(sys.getsizeof(res))

f = open('test.jpeg', 'wb')
f.write(res)
f.close()

Lucasthoelke avatar Nov 23 '21 17:11 Lucasthoelke

Have you solved it? I have the same problem.

CheukBinLi avatar Feb 17 '23 06:02 CheukBinLi

//File corruption public byte[] pixelPeek() throws IOException, InterruptedException, DecoderException { String command = "pixelPeek"; getSocketChannel().write(ByteBuffer.wrap(encode(command))); // ByteBuffer byteBuffer = borrowResource(); ByteBuffer byteBuffer = ByteBuffer.allocate(0x7D000); int len = getSocketChannel().read(byteBuffer); if (null == byteBuffer) { return null; } byte[] result = new byte[len]; byteBuffer.get(0, result); System.out.println(new String(result)); return Hex.decodeHex(new String(result)); // return result; } FileOutputStream out = new FileOutputStream(new File("/Users/cheukbinli/Downloads/11111.gif")); out.write(imageByte1); out.close();

CheukBinLi avatar Feb 17 '23 06:02 CheukBinLi

the java code image

CheukBinLi avatar Feb 17 '23 06:02 CheukBinLi