Package streamer

Examples of streamer.ByteBuffer.writeBytes()


        // NegotiateFlags (4 bytes): In connection-oriented mode, a NEGOTIATE
        // structure that contains the set of bit flags (section 2.2.2.5) negotiated
        // in the previous messages.
        buf.writeIntLE(/*ntlmState.negotiatedFlags.value*/0xe288b235); // FIXME: remove hardcoded value

        buf.writeBytes(generateVersion());

        // If the CHALLENGE_MESSAGE TargetInfo field (section 2.2.1.2) has an
        // MsvAvTimestamp present, the client SHOULD provide a MIC(Message Integrity
        // Check)

View Full Code Here


        // MsvAvTimestamp present, the client SHOULD provide a MIC(Message Integrity
        // Check)

        int savedCursorForMIC = buf.cursor; // Save cursor position to write MIC
        // later
        buf.writeBytes(new byte[16]); // Write 16 zeroes

        if (BLOCKS_OFFSET != buf.cursor)
            throw new RuntimeException("BUG: Actual offset of first byte of allocated blocks is not equal hardcoded offset. Hardcoded offset: " + BLOCKS_OFFSET
                    + ", actual offset: " + buf.cursor + ". Update hardcoded offset to match actual offset.");
View Full Code Here

        ntlmState.authenticateMessage = buf.toByteArray();

        // Calculate and write MIC to reserved position
        ntlmState.ntlm_compute_message_integrity_check();
        buf.cursor = savedCursorForMIC;
        buf.writeBytes(ntlmState.messageIntegrityCheck);
        buf.rewindCursor();

        return buf;
    }
View Full Code Here

        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();
View Full Code Here

        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();
View Full Code Here

        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));
View Full Code Here

        buf.writeShortLE(0); // Length
        buf.writeShortLE(0); // Allocated space
        buf.writeIntLE(0); // Offset

        // OS Version: 6.1 (Build 7601); NTLM Current Revision 15
        buf.writeBytes(new byte[] {(byte)0x06, (byte)0x01, (byte)0xb1, (byte)0x1d, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0f});

        // Trim buffer to actual length of data written
        buf.trimAtCursor();

        return buf;
View Full Code Here

    protected void sendPreConnectionBlobData(String data) {
        // Length of packet
        ByteBuffer buf = new ByteBuffer(1024, true);

        // Header
        buf.writeBytes(new byte[] {(byte)0x5e, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,});

        // Length of string in wide characters + two wide \0 (LE)
        buf.writeShortLE(data.length() + 2);
View Full Code Here

        int length = 1024; // Large enough
        ByteBuffer buf = new ByteBuffer(length, true);

        /* @formatter:off */
    buf.writeBytes(new byte[] {
        // MCS send data request
        (byte)0x64,
        // Initiator: 1004 (1001+3)
        (byte)0x00, (byte)0x03,
        // Channel ID: 1003 (I/O Channel)
View Full Code Here

        //
        // Values
        //

        // Domain: (UCS2), see cbDomain
        buf.writeBytes(domain);
        buf.writeShort(0);

        // User name: (UCS2), see cbUserName
        buf.writeBytes(userName);
        buf.writeShort(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.