Values of VMCS fields are encoded as per section VMREAD, VMWRITE, and Encodings of VMCS Field (24.11.2, Intel Manual Volume 3C - May 2018).
This encoding can be transcribed into C:
union vmcs_component_encoding
{
struct| // | |
| // Merge .CRT section to .rdata (read only) | |
| // | |
| #pragma comment(linker, "/merge:.CRT=.rdata") | |
| // | |
| // Define variables marking the begin and the end | |
| // of the TLS callback array. | |
| // |
| # | |
| # Tested on freshly installed Ubuntu 16.04 (amd64) | |
| # with VirtualBox 5.1.14 code base. | |
| # | |
| # | |
| # Note: | |
| # After a build, there was VBoxDD.so file missing in the | |
| # out/linux.amd64/release/bin folder. | |
| # The file is located in the out/linux.amd64/release/obj/VBoxDD folder, |
| #include <iostream> | |
| #include <thread> | |
| #include <cstdlib> | |
| #include <cstdint> | |
| #include <cinttypes> | |
| static uint64_t win = 0; | |
| static uint64_t loss = 0; | |
| void thread_printer() |