📄 smb.h
字号:
typedef struct _SmbCore_NegotiateProtocolResp /* smb_wct = 1 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint16_t smb_idx; /* index */ uint16_t smb_bcc; /* must be 0 */} SmbCore_NegotiateProtocolResp;/* This is the Lanman 1.0 response */typedef struct _SmbLm10_NegotiateProtocolResp /* smb_wct = 13 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint16_t smb_index; /* index identifying dialect selected */ uint16_t smb_secmode; /* security mode: bit 0, 1 = User level, 0 = Share level bit 1, 1 = encrypt passwords, 0 = do not encrypt passwords */ uint16_t smb_maxxmt; /* max transmit buffer size server supports, 1K min */ uint16_t smb_maxmux; /* max pending multiplexed requests server supports */ uint16_t smb_maxvcs; /* max VCs per server/consumer session supported */ uint16_t smb_blkmode; /* block read/write mode support: bit 0, Read Block Raw supported (65535 bytes max) bit 1, Write Block Raw supported (65535 bytes max) */ uint32_t smb_sesskey; /* Session Key (unique token identifying session) */ uint16_t smb_srv_time; /* server's current time (hhhhh mmmmmm xxxxx) */ uint16_t smb_srv_tzone; /* server's current data (yyyyyyy mmmm ddddd) */ uint32_t smb_rsvd; /* reserved */ uint16_t smb_bcc; /* value = (size of smb_cryptkey) */#if 0 uint8_t smb_cryptkey[]; /* Key used for password encryption */#endif} SmbLm10_NegotiateProtocolResp;/* This is the Lanman 2.1 response */typedef struct _SmbLm21_NegotiateProtocolResp /* smb_wct = 13 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint16_t smb_index; /* index identifying dialect selected */ uint16_t smb_secmode; /* security mode: bit 0, 1 = User level, 0 = Share level bit 1, 1 = encrypt passwords, 0 = do not encrypt passwords */ uint16_t smb_maxxmt; /* max transmit buffer size server supports, 1K min */ uint16_t smb_maxmux; /* max pending multiplexed requests server supports */ uint16_t smb_maxvcs; /* max VCs per server/consumer session supported */ uint16_t smb_blkmode; /* block read/write mode support: bit 0, Read Block Raw supported (65535 bytes max) bit 1, Write Block Raw supported (65535 bytes max) */ uint32_t smb_sesskey; /* Session Key (unique token identifying session) */ uint16_t smb_srv_time; /* server's current time (hhhhh mmmmmm xxxxx) */ uint16_t smb_srv_tzone; /* server's current data (yyyyyyy mmmm ddddd) */ uint16_t smb_cryptkeylen; /* length of smb_cryptkey */ uint16_t smb_rsvd; /* reserved */ uint16_t smb_bcc; /* value = (size of smb_cryptkey) */#if 0 uint8_t smb_cryptkey[]; /* Key used for password encryption */ uint8_t smb_domain[] /* Null terminated server domain */#endif} SmbLm21_NegotiateProtocolResp;/* This is the NT Lanman 1.0 response */typedef struct _SmbNt10_NegotiateProtocolResp /* smb_wct = 17 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint16_t smb_index; /* index identifying dialect selected */ uint8_t smb_secmode; /* security mode: bit 0, 1 = User level, 0 = Share level bit 1, 1 = encrypt passwords, 0 = do not encrypt passwords */ uint16_t smb_maxmux; /* max pending multiplexed requests server supports */ uint16_t smb_maxvcs; /* max VCs per server/consumer session supported */ uint32_t smb_maxbuf; /* maximum buffer size supported */ uint32_t smb_maxraw; /* maximum raw buffer size supported */ uint32_t smb_sesskey; /* Session Key (unique token identifying session) */ uint32_t smb_cap; /* capabilities */ struct { uint32_t low_time; int32_t high_time; } smb_srv_time; /* server time */ uint16_t smb_srv_tzone; /* server's current data (yyyyyyy mmmm ddddd) */ uint8_t smb_rsvd; /* reserved */ uint16_t smb_bcc; /* value = (size of smb_cryptkey) */#if 0 uint8_t smb_cryptkey[]; /* Key used for password encryption */#endif} SmbNt10_NegotiateProtocolResp;/******************************************************************** * Session Setup AndX :: smb_com = SMB_COM_SESS_SETUP_ANDX * ********************************************************************/typedef struct _SmbLm10_SessionSetupAndXReq /* smb_wct = 10 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_reh2; /* reserved (must be zero) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_bufsize; /* the consumers max buffer size */ uint16_t smb_mpxmax; /* actual maximum multiplexed pending requests */ uint16_t smb_vc_num; /* 0 = first (only), non zero - additional VC number */ uint32_t smb_sesskey; /* Session Key (valid only if smb_vc_num != 0) */ uint16_t smb_apasslen; /* size of account password (smb_apasswd) */ uint32_t smb_rsvd; /* reserved */ uint16_t smb_bcc; /* minimum value = 0 */#if 0 uint8_t smb_apasswd[*]; /* account password (* = smb_apasslen value) */ uint8_t smb_aname[]; /* account name string */#endif} SmbLm10_SessionSetupAndXReq;typedef struct _SmbLm10_SessionSetupAndXResp /* smb_wct = 3 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_res2; /* reserved (pad to word) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_action; /* request mode: bit0 = Logged in successfully - BUT as GUEST */ uint16_t smb_bcc; /* value = 0 */} SmbLm10_SessionSetupAndXResp;/* Extended request as defined in LM 2.0 document */typedef struct _SmbLm20_SessionSetupAndXReq /* smb_wct = 10 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_reh2; /* reserved (must be zero) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_bufsize; /* the consumers max buffer size */ uint16_t smb_mpxmax; /* actual maximum multiplexed pending requests */ uint16_t smb_vc_num; /* 0 = first (only), non zero - additional VC number */ uint32_t smb_sesskey; /* Session Key (valid only if smb_vc_num != 0) */ uint16_t smb_apasslen; /* size of account password (smb_apasswd) */ uint16_t smb_encryptlen; /* size of encryption key (smb_encrypt) */ uint16_t smb_encryptoff; /* offet (from SMB hdr start) to smb_encrypt */ uint16_t smb_bcc; /* minimum value = 0 */#if 0 uint8_t smb_apasswd[*]; /* account password (* = smb_apasslen value) */ uint8_t smb_aname[]; /* account name string */ uint8_t smb_encrypt[*]; /* encryption key. (* = smb_encryptlen value) */#endif} SmbLm20_SessionSetupAndXReq;/* Extended response as defined in LM 2.0 document */typedef struct _SmbLm20_SessionSetupAndXResp /* smb_wct = 3 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_res2; /* reserved (pad to word) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_action; /* request mode: bit0 = Logged in successfully - BUT as GUEST */ uint16_t smb_bcc; /* min value = 0 */#if 0 smb_encresp[]; /* server response to request encryption key */#endif} SmbLm20_SessionSetupAndXResp;/* Extended request as defined in LM 2.1 document */typedef struct _SmbLm21_SessionSetupAndXReq /* smb_wct = 10 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_reh2; /* reserved (must be zero) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_bufsize; /* the consumers max buffer size */ uint16_t smb_mpxmax; /* actual maximum multiplexed pending requests */ uint16_t smb_vc_num; /* 0 = first (only), non zero - additional VC number */ uint32_t smb_sesskey; /* Session Key (valid only if smb_vc_num != 0) */ uint16_t smb_apasslen; /* size of account password (smb_apasswd) */ uint32_t smb_rsvd; /* reserved */ uint16_t smb_bcc; /* minimum value = 0 */#if 0 uint8_t smb_apasswd[*]; /* account password (* = smb_apasslen value) */ uint8_t smb_aname[]; /* account name string */ uint8_t smb_domain[]; /* name of domain that client was authenticated on */ uint8_t smb_mativeos[]; /* native operation system of client */ uint8_t smb_nativelm[]; /* native LAN Manager type */#endif} SmbLm21_SessionSetupAndXReq;/* Extended response as defined in LM 2.1 document */typedef struct _SmbLm21_SessionSetupAndXResp /* smb_wct = 3 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_res2; /* reserved (pad to word) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_action; /* request mode: bit0 = Logged in successfully - BUT as GUEST */ uint16_t smb_bcc; /* min value = 0 */#if 0 uint8_t smb_nativeos[]; /* server's native operating system */ uint8_t smb_nativelm[]; /* server's native LM type */#endif} SmbLm21_SessionSetupAndXResp;/* Extended request as defined in NT LM 1.0 document */typedef struct _SmbNt10_SessionSetupAndXReq /* smb_wct = 13 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_reh2; /* reserved (must be zero) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_bufsize; /* the consumers max buffer size */ uint16_t smb_mpxmax; /* actual maximum multiplexed pending requests */ uint16_t smb_vc_num; /* 0 = first (only), non zero - additional VC number */ uint32_t smb_sesskey; /* Session Key (valid only if smb_vc_num != 0) */ uint16_t smb_ci_passlen; /* case insensitive password length */ uint16_t smb_cs_passlen; /* case sensitive password length */ uint32_t smb_rsvd; /* reserved */ uint32_t smb_cap; /* capabilities */ uint16_t smb_bcc; /* minimum value = 0 */#if 0 uint8_t smb_ci_passwd[*]; /* case insensitive password (* = smb_ci_passlen) */ uint8_t smb_cs_passwd[*]; /* case sensitive password (* = smb_cs_passlen) */ uint8_t smb_aname[]; /* ascii or unicode account name string */ uint8_t smb_domain[]; /* ascii or unicode name of domain that client was authenticated on */ uint8_t smb_nativeos[]; /* ascii or unicode native operation system of client */ uint8_t smb_nativelm[]; /* ascii or unicode native LAN Manager type */#endif} SmbNt10_SessionSetupAndXReq;/* Extended request for security blob */typedef struct _SmbNt10_SessionSetupAndXReq12 /* smb_wct = 12 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_reh2; /* reserved (must be zero) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_bufsize; /* the consumers max buffer size */ uint16_t smb_mpxmax; /* actual maximum multiplexed pending requests */ uint16_t smb_vc_num; /* 0 = first (only), non zero - additional VC number */ uint32_t smb_sesskey; /* Session Key (valid only if smb_vc_num != 0) */ uint16_t smb_blob_len; /* length of security blob */ uint32_t smb_rsvd; /* reserved */ uint32_t smb_cap; /* capabilities */ uint16_t smb_bcc; /* minimum value = 0 */#if 0 uint8_t smb_blob[]; /* security blob */ uint8_t smb_nativeos[]; /* ascii or unicode native operation system of client */ uint8_t smb_nativelm[]; /* ascii or unicode native LAN Manager type */#endif} SmbNt10_SessionSetupAndXReq12;/* Extended response as defined in NT LM 1.0 document */typedef struct _SmbNt10_SessionSetupAndXResp /* smb_wct = 3 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_res2; /* reserved (pad to word) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_action; /* request mode: bit0 = Logged in successfully - BUT as GUEST */ uint16_t smb_bcc; /* min value = 0 */#if 0 uint8_t smb_nativeos[]; /* ascii or unicode server's native operating system */ uint8_t smb_nativelm[]; /* ascii or unicode server's native LM type */ uint8_t smb_domain[]; /* ascii or unicode logon domain of the user */#endif} SmbNt10_SessionSetupAndXResp;/* Extended response for security blob */typedef struct _SmbNt10_SessionSetupAndXResp4 /* smb_wct = 4 */{ uint8_t smb_wct; /* count of 16-bit words that follow */ uint8_t smb_com2; /* secondary (X) command, 0xFF = none */ uint8_t smb_res2; /* reserved (pad to word) */ uint16_t smb_off2; /* offset (from SMB hdr start) to next cmd (@smb_wct) */ uint16_t smb_action; /* request mode: bit0 = Logged in successfully - BUT as GUEST */ uint16_t smb_blob_len; /* length of security blob */ uint16_t smb_bcc; /* min value = 0 */#if 0 uint8_t smb_blob[]; /* security blob */ uint8_t smb_nativeos[]; /* ascii or unicode server's native operating system */ uint8_t smb_nativelm[]; /* ascii or unicode server's native LM type */ uint8_t smb_domain[]; /* ascii or unicode logon domain of the user */#endif} SmbNt10_SessionSetupAndXResp4;/******************************************************************** * Logoff AndX :: smb_com = SMB_COM_LOGOFF_ANDX * * Valid smb_com2: * Session Setup AndX *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -