Package streamer

Examples of streamer.ByteBuffer


        byte[] expected = new byte[] {(byte)0x8e, (byte)0x0f, (byte)0xdd, (byte)0x12, (byte)0x4c, (byte)0x3b, (byte)0x11, (byte)0x7f, (byte)0x22,
                (byte)0xb9, (byte)0x4b, (byte)0x59, (byte)0x52, (byte)0xbc, (byte)0xa7, (byte)0x18,};
        byte[] actual = computeSessionBaseKey(ntlm_v2_hash, nt_proof_str);
        if (!Arrays.equals(expected, actual))
            throw new RuntimeException("Incorrect result.\nExpected:\n" + new ByteBuffer(expected).toPlainHexString() + "\n  actual:\n"
                    + new ByteBuffer(actual).toPlainHexString() + ".");
    }
View Full Code Here


            writeAVPair(buf, avPairType, value.getBytes(RdpConstants.CHARSET_16));
        }
    }

    public byte[] ntlm_construct_authenticate_target_info() {
        ByteBuffer buf = new ByteBuffer(4096);

        writeAVPair(buf, MSV_AV_NETBIOS_DOMAIN_NAME, serverNetbiosDomainName);

        writeAVPair(buf, MSV_AV_NETBIOS_COMPUTER_NAME, serverNetbiosComputerName);

        writeAVPair(buf, MSV_AV_DNS_DOMAIN_NAME, serverDnsDomainName);

        writeAVPair(buf, MSV_AV_DNS_COMPUTER_NAME, serverDnsComputerName);

        writeAVPair(buf, MSV_AV_DNS_TREE_NAME, serverDnsTreeName);

        writeAVPair(buf, MSV_AV_TIMESTAMP, serverTimestamp);

        byte[] flags = new byte[] {(byte)MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK, 0, 0, 0};
        writeAVPair(buf, MSV_AV_FLAGS, flags);

        writeAVPair(buf, MSV_AV_CHANNEL_BINDINGS, channelBindingsHash);

        writeAVPair(buf, MSV_AV_TARGET_NAME, servicePrincipalName);

        writeAVPair(buf, MSV_AV_EOL, "");
        // DEBUG: put EOL 4 times, for compatibility with FreeRDP output
        //*DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");
        //*DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");
        //*DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");
        buf.trimAtCursor();

        authenticateTargetInfo = buf.toByteArray();
        buf.unref();

        return authenticateTargetInfo;
    }
View Full Code Here

                (byte)0x00, (byte)0x38, (byte)0x00, (byte)0x2e, (byte)0x00, (byte)0x31, (byte)0x00, (byte)0x2e, (byte)0x00, (byte)0x33, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,};
        byte[] actual = ntlm_construct_authenticate_target_info();
        if (!Arrays.equals(expected, actual))
            throw new RuntimeException("Incorrect result.\nExpected:\n" + new ByteBuffer(expected).toPlainHexString() + "\n  actual:\n"
                    + new ByteBuffer(actual).toPlainHexString() + ".");
    }
View Full Code Here

            throw new RuntimeException("Incorrect result.\nExpected:\n" + new ByteBuffer(expected).toPlainHexString() + "\n  actual:\n"
                    + new ByteBuffer(actual).toPlainHexString() + ".");
    }

    public byte[] ntlm_compute_ntlm_v2_response() {
        ByteBuffer buf = new ByteBuffer(4096);

        byte[] ntlm_v2_hash = ntlm_compute_ntlm_v2_hash();

        buf.writeByte(0x1); // RespType
        buf.writeByte(0x1); // HighRespType
        buf.writeShort(0); // reserved
        buf.writeInt(0); // reserved
        buf.writeBytes(clientChallengeTimestamp); // Timestamp, 8 bytes
        buf.writeBytes(clientChallenge); // Client nonce, 8 bytes
        buf.writeInt(0); // reserved
        buf.writeBytes(authenticateTargetInfo); // Target Info block
        buf.trimAtCursor();
        byte[] bufBytes = buf.toByteArray();
        buf.unref();

        ntProofStr2 = computeNtProofStr(ntlm_v2_hash, CryptoAlgos.concatenationOf(serverChallenge, bufBytes));

        ntChallengeResponse = CryptoAlgos.concatenationOf(ntProofStr2, bufBytes);
View Full Code Here

                (byte)0x00, (byte)0x38, (byte)0x00, (byte)0x2e, (byte)0x00, (byte)0x31, (byte)0x00, (byte)0x2e, (byte)0x00, (byte)0x33, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,};
        byte[] actual = ntlm_compute_ntlm_v2_response();
        if (!Arrays.equals(expected, actual))
            throw new RuntimeException("Incorrect result.\nExpected:\n" + new ByteBuffer(expected).toPlainHexString() + "\n  actual:\n"
                    + new ByteBuffer(actual).toPlainHexString() + ".");
    }
View Full Code Here

    public void keyReleased(KeyEvent e) {
        sendEvent(e, false);
    }

    private void sendEvent(KeyEvent e, boolean pressed) {
        ByteBuffer buf = new ByteBuffer(new KeyOrder(e, pressed));

        pushDataToAllOuts(buf);
    }
View Full Code Here

                6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};

        int[] pixelsLE = new int[] {0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605,
                0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d};

        ByteBuffer buf = new ByteBuffer(pixels);
        buf.putMetadata(TARGET_X, 0);
        buf.putMetadata(TARGET_Y, 0);
        buf.putMetadata(WIDTH, 4);
        buf.putMetadata(HEIGHT, 4);
        buf.putMetadata(PIXEL_FORMAT, RGB888LE32);

        renderer.handleData(buf, null);

        String actualData = Arrays.toString(((DataBufferInt)canvas.getOfflineImage().getRaster().getDataBuffer()).getData());
        String expectedData = Arrays.toString(pixelsLE);
View Full Code Here

    @Override
    public void mousePressed(MouseEvent e) {
        MouseOrder order = new MouseOrder(e);
        order.pressed = true;
        pushDataToAllOuts(new ByteBuffer(order));
    }
View Full Code Here

    @Override
    public void mouseReleased(MouseEvent e) {
        MouseOrder order = new MouseOrder(e);
        order.released = true;
        pushDataToAllOuts(new ByteBuffer(order));
    }
View Full Code Here

        // Nothing to do
    }

    @Override
    public void mouseDragged(MouseEvent e) {
        pushDataToAllOuts(new ByteBuffer(new MouseOrder(e)));
    }
View Full Code Here

TOP

Related Classes of streamer.ByteBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.