MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / get_param

Method get_param

windows/crypto/cryptmsg.py:20–33  ·  view source on GitHub ↗
(self, param_type, index=0, raw=False)

Source from the content-addressed store, hash-verified

18
19
20 def get_param(self, param_type, index=0, raw=False):
21 data_size = gdef.DWORD()
22 # https://msdn.microsoft.com/en-us/library/windows/desktop/aa380227(v=vs.85).aspx
23 winproxy.CryptMsgGetParam(self, param_type, index, None, data_size)
24 buffer = ctypes.c_buffer(data_size.value)
25 winproxy.CryptMsgGetParam(self, param_type, index, buffer, data_size)
26 if raw:
27 return (buffer, data_size)
28
29 if param_type in self.MSG_PARAM_KNOW_TYPES:
30 buffer = self.MSG_PARAM_KNOW_TYPES[param_type].from_buffer(buffer)
31 if isinstance(buffer, gdef.DWORD): # DWORD -> return the Python int
32 return buffer.value
33 return buffer
34
35 # Certificate accessors
36

Callers 8

nb_certMethod · 0.95
get_raw_certMethod · 0.95
nb_signerMethod · 0.95
get_signer_dataMethod · 0.95
nb_recipientMethod · 0.95
get_recipient_dataMethod · 0.95
contentMethod · 0.95
content_typeMethod · 0.95

Calls 1

from_bufferMethod · 0.45

Tested by

no test coverage detected