-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
What is the right way to generate byte_runs with python3?
import cybox.common
import cybox.objects.file_object
file_object = cybox.objects.file_object.File()
file_object.byte_runs = cybox.common.ByteRuns()
file_object.byte_runs.byte_run = cybox.common.ByteRun()
with open('/bin/ls', 'rb') as f:
file_object.byte_runs.byte_run[0].byte_run_data = f.read()
with open('test', 'wb') as f:
f.write(file_object.to_xml())
creates
<cyboxCommon:Byte_Run_Data>b'\x7fELF\x02\x01\x01\....\x00\x00\x00'</cyboxCommon:Byte_Run_Data>
but I would expect CDATA, no b'...' and no \x00.
Metadata
Metadata
Assignees
Labels
No labels