(self)
Returns the binary associated with the service.
Returns the binary associated with the service.
Returns the binary associated with the service .
def get_binary(self) -> Union[str, interfaces.renderers.BaseAbsentValue]:
        """Returns the binary associated with the service."""
        if self.State.description != "SERVICE_RUNNING":
            return renderers.NotApplicableValue()

        # depending on whether the service is for a process
        # or kernel driver, the binary path is stored differently
        try:
            if "PROCESS" in self.get_type():
                return self.ServiceProcess.BinaryPath.dereference().cast("string",
                                                                         encoding = "utf-16",
                                                                         errors = "replace",
                                                                         max_length = 512)
            else:
                return self.DriverName.dereference().cast("string",
                                                          encoding = "utf-16",
                                                          errors = "replace",
                                                          max_length = 512)
        except exceptions.InvalidAddressException:
            return renderers.UnreadableValue()
def get_binary ( self ) -> Union [ str , interfaces . renderers . BaseAbsentValue ] : if self . State . description != "SERVICE_RUNNING" : return renderers . NotApplicableValue ( ) # depending on whether the service is for a process # or kernel driver, the binary path is stored differently try : if "PROCESS" in self . get_type ( ) : return self . ServiceProcess . BinaryPath . dereference ( ) . cast ( "string" , encoding = "utf-16" , errors = "replace" , max_length = 512 ) else : return self . DriverName . dereference ( ) . cast ( "string" , encoding = "utf-16" , errors = "replace" , max_length = 512 ) except exceptions . InvalidAddressException : return renderers . UnreadableValue ( )