MCPcopy Create free account
hub / github.com/secdev/scapy / setfieldval

Method setfieldval

scapy/layers/ntlm.py:325–352  ·  view source on GitHub ↗
(self, attr, val)

Source from the content-addressed store, hash-verified

323 raise ValueError(attr)
324
325 def setfieldval(self, attr, val):
326 # Ease compatibility with _NTLMPayloadField
327 try:
328 return super(_NTLMPayloadPacket, self).setfieldval(attr, val)
329 except AttributeError:
330 Payload = super(_NTLMPayloadPacket, self).__getattr__(
331 self._NTLM_PAYLOAD_FIELD_NAME
332 )
333 if attr not in self.get_field(self._NTLM_PAYLOAD_FIELD_NAME).fields_map:
334 raise AttributeError(attr)
335 try:
336 Payload.pop(
337 next(
338 i
339 for i, x in enumerate(
340 super(_NTLMPayloadPacket, self).__getattr__(
341 self._NTLM_PAYLOAD_FIELD_NAME
342 )
343 )
344 if x[0] == attr
345 )
346 )
347 except StopIteration:
348 pass
349 Payload.append([attr, val])
350 super(_NTLMPayloadPacket, self).setfieldval(
351 self._NTLM_PAYLOAD_FIELD_NAME, Payload
352 )
353
354
355class _NTLM_ENUM(IntEnum):

Callers 15

__init__Method · 0.95
do_dissectMethod · 0.45
do_dissectMethod · 0.45
get_responseMethod · 0.45
get_responseMethod · 0.45
get_responseMethod · 0.45
get_responseMethod · 0.45
get_responseMethod · 0.45
get_responseMethod · 0.45
get_responseMethod · 0.45
dns_compressFunction · 0.45
add_payloadMethod · 0.45

Calls 4

get_fieldMethod · 0.80
popMethod · 0.80
__getattr__Method · 0.45
appendMethod · 0.45

Tested by

no test coverage detected