def GetPayloadFromOffset(payload_file, offset):
    'Read payload and pad it to 64-byte aligned.'
    with open(payload_file, 'rb') as f:
        f.seek(offset)
        payload = bytearray(f.read())
    rem_len = (len(payload) % 64)
    if rem_len:
        payload += (b'\x00' * (64 - rem_len))
    return payload
Read payload and pad it to 64-byte aligned.
def GetPayloadFromOffset(payload_file, offset):
    
    with open(payload_file, 'rb') as f:
        f.seek(offset)
        payload = bytearray(f.read())
    rem_len = (len(payload) % 64)
    if rem_len:
        payload += (b'\x00' * (64 - rem_len))
    return payload