Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add yaml serializer for snapshot meta data #53

Merged

Conversation

schumilo
Copy link
Member

QEMU-Nyx creates and stores several files representing the serialized root snapshot in the configured snapshot directory. With this PR, a YAML file is also created, in which specific snapshot metadata is stored in addition to the binary snapshot files. The file will not be used by QEMU-Nyx anymore after it has been created. However, the front end can easily read the YAML file without having to parse the binary file format used by QEMU-Nyx.
This PR is a WIP and lacks support for in-memory root snapshots.

Below is an example of the output YAML file:

---
process_trace:
    pt_ip_filter_configured_0: true
    pt_ip_filter_configured_1: false
    pt_ip_filter_configured_2: false
    pt_ip_filter_configured_3: false
    pt_ip_filter_0: [0x1000, 0xfffff000]
    pt_ip_filter_1: [0x0, 0x0]
    pt_ip_filter_2: [0x0, 0x0]
    pt_ip_filter_3: [0x0, 0x0]
    parent_cr3: 0x1fa2c000
    disassembler_word_width: 0x40
    mem_mode: 0x4
    pt_trace_mode: true

input_buffer:
    input_buffer_vaddr: 0xf7ff6000
    protect_input_buffer: false
    input_buffer_size: 0x1000

capabilites:
    cap_timeout_detection: false
    cap_only_reload_mode: false
    cap_compile_time_tracing: false
    cap_ijon_tracing: true
    cap_cr3: true
    cap_compile_time_tracing_buffer_vaddr: 0x0
    cap_ijon_tracing_buffer_vaddr: 0xf7ff8000
    cap_coverage_bitmap_size: 0x10000

...

@schumilo schumilo marked this pull request as ready for review August 2, 2023 09:37
@schumilo
Copy link
Member Author

schumilo commented Aug 2, 2023

@Wenzel Feedback would be greatly appreciated!

@schumilo
Copy link
Member Author

schumilo commented Aug 2, 2023

Current yaml file format:

---
qemu_nyx:
    nyx_serialized_state_version: 0x1

processor_trace:
    pt_ip_filter_configured_0: true
    pt_ip_filter_configured_1: false
    pt_ip_filter_configured_2: false
    pt_ip_filter_configured_3: false
    pt_ip_filter_0: [0x1000, 0xfffff000]
    pt_ip_filter_1: [0x0, 0x0]
    pt_ip_filter_2: [0x0, 0x0]
    pt_ip_filter_3: [0x0, 0x0]
    parent_cr3: 0x1fa2b000
    mem_mode: "mm_64_l4_paging"
    pt_trace_mode: true

input_buffer:
    input_buffer_vaddr: 0xf7ff6000
    protect_input_buffer: false
    input_buffer_size: 0x1000

capabilites:
    cap_timeout_detection: false
    cap_only_reload_mode: false
    cap_compile_time_tracing: false
    cap_ijon_tracing: true
    cap_cr3: true
    cap_compile_time_tracing_buffer_vaddr: 0x0
    cap_ijon_tracing_buffer_vaddr: 0xf7ff8000
    cap_coverage_bitmap_size: 0x10000

...```

@Wenzel
Copy link
Contributor

Wenzel commented Aug 2, 2023

@schumilo sorry, i replied on the ither issue, but i was discussibg your proposal as well

IntelLabs/kafl.qemu#10 (comment)

@Wenzel
Copy link
Contributor

Wenzel commented Aug 2, 2023

oh my bad, you added a reply and i missed the notification

i'll have a look

@Wenzel
Copy link
Contributor

Wenzel commented Aug 2, 2023

Facing an internal GCC 11 bug here, but it's not related to your code don't worry.
Can't build QEMU right now.

image

@schumilo schumilo merged commit 347559a into nyx-fuzz:qemu-nyx-4.2.0 Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants