| 7 | |
| 8 | |
| 9 | class Payload(): |
| 10 | def __init__(self, filepath: FilePath): |
| 11 | self.payload_path: FilePath = filepath |
| 12 | self.payload_data: bytes = b"" |
| 13 | |
| 14 | |
| 15 | def init(self) -> bool: |
| 16 | if not os.path.exists(self.payload_path): |
| 17 | logger.error("Payload file does not exist: {}".format(self.payload_path)) |
| 18 | return False |
| 19 | |
| 20 | with open(self.payload_path, 'rb') as f: |
| 21 | self.payload_data = f.read() |
| 22 | |
| 23 | logger.info("-[ Payload: {} ({} bytes)".format( |
| 24 | self.payload_path, len(self.payload_data))) |
| 25 | return True |
| 26 |