<div>Thanks Richard,</div>
<div>&nbsp;</div>
<div>I know MS-SQL (2000) use&nbsp;TDS protocol, I found a document&nbsp;say about this (i dont know if this is correct or not) if someone has other document about tds packet or and a&nbsp;sample code to reassembly packet (thank a lot), please share it.&nbsp;Hopefully,&nbsp;I can&nbsp;do my task. I&nbsp;post here the document of&nbsp;tds packet&nbsp;if someone need it.</div>

<div>&nbsp;</div>
<div><span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">..............&nbsp;we know MS SQL 2000 uses TDS 8.0 in its package. The packet format is list as following:<br>
--------------------------------------------------------<br>| TDS package header(8bytes) |&nbsp;&nbsp;&nbsp;&nbsp;TDS payload&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>------------------------------------------------------<br>TDS package header:<br>-------------------------------------------------------------------<br>
| TOKEN | STATUS | LENGTH | SIGNED NUM | PACKET NUM | WINDOW SIZE |<br>-------------------------------------------------------------------<br>The field TOKEN is one byte, which shows packet type. In this article, it is 0x12, which shows the request of ConnectionPreLogin to get some values, such as the version of SQL Server. When SQL Server receives these kinds of package, it will pass the package to function in SSlibnet.dll. </span></div>

<div><span style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">The STATUS field has one byte, 0x01 means it is last packet in the TDS session.<br>
The LENGTH field has two bytes, which is the length of TDS package include the length of TDS header.<br>The SIGNED NUM field has two bytes, which is reserved now.<br>The PACKET NUM filed has one byte, which shows the sequence number in the current TDS operation. <br>
The WINDOW SIZE filed has one byte,which is reserved now.<br>When the TOKEN filed is 0x12, the format is:<br>----------------------------------------------------------------<br>| TDS package Header (8bytes) |Field Indicator Header| Information |<br>
----------------------------------------------------------------<br>Field indicator Header is a table whose length is not fixed, each item indicate the information of offset or length. General there are four filed in MS SQL 2000, the structure of Field Indicator Header is list as following: <br>
{<br>&nbsp;&nbsp;&nbsp;&nbsp;BYTE CNETLIBVERNO;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD CNETLIBVEROFFSET;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD CNETLIBVERLEN;<br>&nbsp;&nbsp;&nbsp;&nbsp;BYTE CENYFLAGNO;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD CENYFLAGOFFSET;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD CENYFLAGLEN;<br>&nbsp;&nbsp;&nbsp;&nbsp;BYTE SINSTNAMENO;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD SINSTNAMEOFFSET;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD SINSTNAMELEN;<br>
&nbsp;&nbsp;&nbsp;&nbsp;BYTE CTHREADIDNO;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD CTHREADIDOFFSET;<br>&nbsp;&nbsp;&nbsp;&nbsp;WORD CTHREADIDLEN;<br>&nbsp;&nbsp;&nbsp;&nbsp;BYTE FILEDEND;<br>}<br>The structure of information is list as following: <br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;BYTE CNETLIBVER[CNETLIBVERLEN]<br>&nbsp;&nbsp;&nbsp;&nbsp;BYTE CENYFLAG[CENYFLAGLEN];<br>
&nbsp;&nbsp;&nbsp;&nbsp;BYTE SINSTNAME[SINSTNAMELEN]<br>&nbsp;&nbsp;&nbsp;&nbsp;DWORD CTHREADID[CTHREADIDLEN];<br>}<br>Field:<br>CNETLIBVERNO<br>Offset:0<br>Length: 1<br>Meanings: The number about Version of NETLIB in client<br>Description:None <br>Remark:The value is 0x00 fixed<br>
<br>CNETLIBVEROFFSET<br>Offset:1<br>Length:2<br>Meanings:The Offset of NETLIB Version in client<br>Description:Network Byte Order<br>Remark:<br><br>CNETLIBVERLEN<br>Offset:3 <br>Length:2<br>Meanings:The length of information about the version of NETLIB in client <br>
Description:Network Byte Order<br>Remark:The value is 0x06 fixed<br><br>CENYFLAGNO&nbsp;&nbsp;&nbsp;&nbsp;<br>Offset:5<br>Length:1<br>Meanings:The number about flag of client encryption.<br>Description: <br>Remark:The value is 0x01 fixed<br>
<br>CENYFLAGOFFSET<br>Offset:6<br>Length:2<br>Meanings:The offset of flag of client encryption.<br>Description:Network Byte Order<br>Remark: <br><br>CENYFLAGLEN<br>Offset:8<br>Length:2<br>Meanings:The length of flag of client encryption.<br>
Description:Network Byte Order<br>Remark:The value is 0x01 fixed<br><br>SINSTNAMENO<br>Offset:0XA<br>Length:1<br>Meanings:The number of server&#39;s instance name.<br>Description: <br>Remark: The value is 2 fixed.<br><br>
SINSTNAMEOFFSET<br>Offset:0XB<br>Length:2<br>Meanings:The offset of of server&#39;s instance name.<br>Description:Network Byte Order<br>Remark: <br><br>SINSTNAMELEN<br>Offset:0XD<br>Length:2<br>Meanings: The length of server&#39;s instance name.<br>
Description: Network Byte Order<br>Remark: <br><br>CTHREADIDNO <br>Offset:0XF<br>Length:1<br>Meanings:The number of the client&#39;s process.<br>Description: <br>Remark: The value is 3 Fixed<br><br>CTHREADIDOFFSET <br>Offset:0X10<br>
Length: 2<br>Meanings: The offset of the client&#39;s process.<br>Description:Network Byte Order<br>Remark: <br><br>CTHREADIDLEN<br>Offset:0X12<br>Length:2<br>Meanings: The length of the client&#39;s process.<br>Description: Network Byte Order<br>
Remark: The value is 4 fixed.<br><br>FILEDEND<br>Offset:0X14 <br>Length:1<br>Meanings: This show that the Field Indicator Header is over,and the next is the information <br>Description:The sign is 0XFF<br>Remark:<br><br>CNETLIBVER <br>
Offset:0X15<br>Length:6<br>Meanings: The version of NETLIB <br>Description: The version of DBNETLIB.DLL<br>Remark: The format is Network Byte Order,For example,if the version is 80.528.00,then the fild is<br>&nbsp;&nbsp;&nbsp;&nbsp;08 00 02 10 00 00<br>
<br>CENYFLAG<br>Offset:0X1B<br>Length:1<br>Meanings: The flag of Client encryption.<br>Description:0 encrypt ,1 don&#39;t&nbsp;&nbsp;encrypt<br>Remark:<br><br>SINSTNAME<br>Offset:0X1C<br>Length:SINSTNAMELEN<br>Meanings: The instance name asked by client.<br>
Description:<br>Remark:default is MSSQLserver<br><br>CTHREADID<br>Offset:0X1C+SINSTNAMELEN<br>Length:4<br>Meanings:The ID of client&#39;s process<br>Description: host Byte Order<br style="mso-special-character: line-break">
<br style="mso-special-character: line-break"></span>............</div>
<div>&nbsp;</div>
<div>Thanks</div>
<div>Bac&nbsp;<br>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>