Skip to content

Commit

Permalink
is it the payload
Browse files Browse the repository at this point in the history
  • Loading branch information
TPVallancourt committed Jan 23, 2025
1 parent ef04a45 commit 4793d3f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/login7-payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,15 @@ class Login7Payload {
}

// (ibUnused / ibExtension): 2-byte
const extensionOffsetHeaderOffset = offset;
offset = fixedData.writeUInt16LE(0, offset);

offset = fixedData.writeUInt16LE(dataOffset, offset);

// (cchUnused / cbExtension): 2-byte
const extensions = this.buildFeatureExt();
offset = fixedData.writeUInt16LE(4, offset);
const extensionOffset = Buffer.alloc(4);
extensionOffset.writeUInt32LE(dataOffset += 4, 0);
dataOffset += extensions.length;
buffers.push(extensionOffset, extensions);

// ibCltIntName: 2-byte
offset = fixedData.writeUInt16LE(dataOffset, offset);
Expand Down Expand Up @@ -362,13 +365,6 @@ class Login7Payload {
fixedData.writeUInt32LE(0, offset);
}

fixedData.writeUInt16LE(dataOffset, extensionOffsetHeaderOffset);

const extensions = this.buildFeatureExt();
const extensionOffset = Buffer.alloc(4);
extensionOffset.writeUInt32LE(dataOffset + 4, 0);
buffers.push(extensionOffset, extensions);

const data = Buffer.concat(buffers);
data.writeUInt32LE(data.length, 0);
return data;
Expand Down

0 comments on commit 4793d3f

Please sign in to comment.