typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; typedef int64_t QWORD; #include "nu_defines.h" typedef struct { BYTE netbios_command; BYTE netbios_flags; WORD netbios_size; DWORD Protocol; /* Protocol identifier 0xFF,"SMB" */ BYTE Command; /* Command Code, look below */ BYTE Status[4]; BYTE Flags; WORD Flags2; WORD Pad[6]; /* Ensure 12 bytes len */ WORD TreeID; WORD ProcessID; WORD UserID; WORD MultiplexID; } SMB_HEADER; typedef struct { BYTE WordCount; WORD Buffer[0]; } SMB_PARAMS; typedef struct { WORD ByteCount; BYTE Buffer[0]; } SMB_BYTES; typedef struct { SMB_PARAMS *params; SMB_BYTES *bytes; } SMB_DATA; typedef struct { SMB_COMMAND cmd; SMB_COMMAND_FLAG flags; SMB_STATUS (*handler)(SMB_DATA *data); } SMB_COMMAND_HANDLER;