代码拉取完成,页面将自动刷新
private static String numToIP(int addr) {
return (addr & 0x000000FF) + "."
+ ((addr & 0x0000FFFF) >>> 8) + "."
+ ((addr & 0x00FFFFFF) >>> 16) + "."
+ (addr >>> 24);
}
private static void upload(long uin, byte[] ukey, byte[] pic, byte[] md5, String addr, int port, int appid) throws IOException {
PbPack pbPack = new PbPack();
pbPack.setVarint("1.1", 1);
pbPack.setString("1.2", String.valueOf(uin));
pbPack.setString("1.3", "PicUp.DataUp");
pbPack.setVarint("1.4", new Random().nextInt(9999) + 10000);
pbPack.setVarint("1.5", 0);
pbPack.setVarint("1.6", appid);
pbPack.setVarint("1.7", 4096);
pbPack.setVarint("1.8", 1);
pbPack.setVarint("2.2", pic.length);
pbPack.setVarint("2.3", 0);
pbPack.setVarint("2.4", pic.length);
pbPack.setBytes("2.6", ukey);
pbPack.setBytes("2.8", md5);
pbPack.setBytes("2.9", md5);
byte[] array = pbPack.array();
Packet packet = new Packet();
packet.setByte(0x28);
packet.setInt(array.length);
packet.setInt(pic.length);
packet.setBytes(array);
packet.setBytes(pic);
packet.setByte(0x29);
byte[] body = packet.array();
Socket socket = new Socket(addr, port);
OutputStream os = socket.getOutputStream();
os.write(body);
os.flush();
InputStream is = socket.getInputStream();
byte[] buf = new byte[1024];
int len = 0;
while ((len = is.read(buf)) != -1) {
System.out.println(HexUtil.bin2hex(buf, 0, len));
}
socket.close();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。