| 3234 | |
| 3235 | |
| 3236 | class SMB2_Create_Response(_SMB2_Payload, _NTLMPayloadPacket): |
| 3237 | name = "SMB2 CREATE Response" |
| 3238 | Command = 0x0005 |
| 3239 | OFFSET = 88 + 64 |
| 3240 | _NTLM_PAYLOAD_FIELD_NAME = "Buffer" |
| 3241 | fields_desc = [ |
| 3242 | XLEShortField("StructureSize", 0x59), |
| 3243 | ByteEnumField("OplockLevel", 0, SMB2_OPLOCK_LEVELS), |
| 3244 | FlagsField("Flags", 0, -8, {0x01: "SMB2_CREATE_FLAG_REPARSEPOINT"}), |
| 3245 | LEIntEnumField( |
| 3246 | "CreateAction", |
| 3247 | 1, |
| 3248 | { |
| 3249 | 0x00000000: "FILE_SUPERSEDED", |
| 3250 | 0x00000001: "FILE_OPENED", |
| 3251 | 0x00000002: "FILE_CREATED", |
| 3252 | 0x00000003: "FILE_OVERWRITEN", |
| 3253 | }, |
| 3254 | ), |
| 3255 | FileNetworkOpenInformation, |
| 3256 | PacketField("FileId", SMB2_FILEID(), SMB2_FILEID), |
| 3257 | XLEIntField("CreateContextsBufferOffset", None), |
| 3258 | LEIntField("CreateContextsLen", None), |
| 3259 | _NTLMPayloadField( |
| 3260 | "Buffer", |
| 3261 | OFFSET, |
| 3262 | [ |
| 3263 | _NextPacketListField( |
| 3264 | "CreateContexts", |
| 3265 | [], |
| 3266 | SMB2_Create_Context, |
| 3267 | length_from=lambda pkt: pkt.CreateContextsLen, |
| 3268 | ), |
| 3269 | ], |
| 3270 | ), |
| 3271 | ] |
| 3272 | |
| 3273 | def post_build(self, pkt, pay): |
| 3274 | # type: (bytes, bytes) -> bytes |
| 3275 | return ( |
| 3276 | _SMB2_post_build( |
| 3277 | self, |
| 3278 | pkt, |
| 3279 | self.OFFSET, |
| 3280 | { |
| 3281 | "CreateContexts": 80, |
| 3282 | }, |
| 3283 | ) |
| 3284 | + pay |
| 3285 | ) |
| 3286 | |
| 3287 | |
| 3288 | bind_top_down(SMB2_Header, SMB2_Create_Response, Command=0x0005, Flags=1) |
no test coverage detected