diff --git a/cper-parse.c b/cper-parse.c
index 39faff6..ee670e1 100644
--- a/cper-parse.c
+++ b/cper-parse.c
@@ -207,9 +207,7 @@
     json_object_object_add(section_descriptor_ir, "revision", revision_to_ir(section_descriptor->Revision));
 
     //Validation bits.
-    json_object* validation_bits = json_object_new_object();
-    json_object_object_add(validation_bits, "fruIDValid", json_object_new_boolean(section_descriptor->SecValidMask & 0b1));
-    json_object_object_add(validation_bits, "fruStringValid", json_object_new_boolean((section_descriptor->SecValidMask & 0b10) >> 1));
+    json_object* validation_bits = bitfield_to_ir(section_descriptor->SecValidMask, 2, CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES);
     json_object_object_add(section_descriptor_ir, "validationBits", validation_bits);
 
     //Flag bits.
diff --git a/cper-parse.h b/cper-parse.h
index 77c5ea9..439f731 100644
--- a/cper-parse.h
+++ b/cper-parse.h
@@ -3,6 +3,7 @@
 #include "json.h"
 
 #define CPER_HEADER_VALID_BITFIELD_NAMES (const char*[]) {"platformIDValid", "timestampValid", "partitionIDValid"}
+#define CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES (const char*[]) {"fruIDValid", "fruStringValid"}
 #define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES (const char*[]) \
     {"primary", "containmentWarning", "reset", "errorThresholdExceeded", "resourceNotAccessible", "latentError", \
     "propagated", "overflow"}
diff --git a/cper-utils.c b/cper-utils.c
index 454fc5b..db41381 100644
--- a/cper-utils.c
+++ b/cper-utils.c
@@ -179,7 +179,11 @@
 //Converts a single timestamp string to an EFI timestamp.
 void string_to_timestamp(EFI_ERROR_TIME_STAMP* out, const char* timestamp)
 {
-    sscanf(timestamp, "%02d%02d-%02d-%02dT%02d:%02d:%02d.000", 
+    //Ignore invalid timestamps.
+    if (timestamp == NULL)
+        return;
+
+    sscanf(timestamp, "%02hhd%02hhd-%02hhd-%02hhdT%02hhd:%02hhd:%02hhd.000", 
             &out->Century,
             &out->Year,
             &out->Month,
@@ -209,7 +213,11 @@
 //Helper function to convert a string into an EDK EFI GUID.
 void string_to_guid(EFI_GUID* out, const char* guid)
 {
-    sscanf(guid, "%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x", 
+    //Ignore invalid GUIDs.
+    if (guid == NULL)
+        return;
+
+    sscanf(guid, "%08x-%04hx-%04hx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx", 
         &out->Data1, 
         &out->Data2, 
         &out->Data3,
diff --git a/ir-parse.c b/ir-parse.c
index 8eb75db..5eaa1ac 100644
--- a/ir-parse.c
+++ b/ir-parse.c
@@ -5,36 +5,123 @@
  **/
 
 #include <stdio.h>
+#include <string.h>
 #include "json.h"
+#include "b64.h"
 #include "edk/Cper.h"
 #include "cper-parse.h"
 #include "cper-utils.h"
+#include "sections/cper-section-generic.h"
+#include "sections/cper-section-ia32x64.h"
+#include "sections/cper-section-arm.h"
+#include "sections/cper-section-memory.h"
+#include "sections/cper-section-pcie.h"
+#include "sections/cper-section-pci-bus.h"
+#include "sections/cper-section-pci-dev.h"
+#include "sections/cper-section-firmware.h"
+#include "sections/cper-section-dmar-generic.h"
+#include "sections/cper-section-dmar-vtd.h"
+#include "sections/cper-section-dmar-iommu.h"
+#include "sections/cper-section-ccix-per.h"
+#include "sections/cper-section-cxl-protocol.h"
+#include "sections/cper-section-ipf.h"
+#include "sections/cper-section-cxl-component.h"
 
 //Private pre-declarations.
 void ir_header_to_cper(json_object* header_ir, EFI_COMMON_ERROR_RECORD_HEADER* header);
+void ir_section_descriptor_to_cper(json_object* section_descriptor_ir, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
 
 //Converts the given JSON IR CPER representation into CPER binary format, piped to the provided file stream.
-//This function performs no validation of the IR against the CPER-JSON specification. For this, call
-//validate_schema() from json-schema.h before attempting to call this function. 
+//This function performs no validation of the IR against the CPER-JSON specification. To ensure a safe call,
+//use validate_schema() from json-schema.h before attempting to call this function. 
 void ir_to_cper(json_object* ir, FILE* out)
 {
     //Create the CPER header.
     EFI_COMMON_ERROR_RECORD_HEADER* header = (EFI_COMMON_ERROR_RECORD_HEADER*)calloc(1, sizeof(EFI_COMMON_ERROR_RECORD_HEADER));
     ir_header_to_cper(json_object_object_get(ir, "header"), header);
     fwrite(header, sizeof(EFI_COMMON_ERROR_RECORD_HEADER), 1, out);
-    
-    //...
-
-    //Free all resources.
     fflush(out);
+
+    //Create the CPER section descriptors.
+    json_object* section_descriptors = json_object_object_get(ir, "sectionDescriptors");
+    int amt_descriptors = json_object_array_length(section_descriptors);
+    EFI_ERROR_SECTION_DESCRIPTOR* descriptors[amt_descriptors];
+    for (int i=0; i<amt_descriptors; i++)
+    {
+        descriptors[i] = (EFI_ERROR_SECTION_DESCRIPTOR*)calloc(1, sizeof(EFI_ERROR_SECTION_DESCRIPTOR));
+        ir_section_descriptor_to_cper(json_object_array_get_idx(section_descriptors, i), descriptors[i]);
+        fwrite(descriptors[i], sizeof(EFI_ERROR_SECTION_DESCRIPTOR), 1, out);
+        fflush(out);
+    }
+    
+    //Run through each section in turn.
+    json_object* sections = json_object_object_get(ir, "sections");
+    int amt_sections = json_object_array_length(sections);
+    for (int i=0; i<amt_sections; i++)
+    {
+        //Get the section itself from the IR.
+        json_object* section = json_object_array_get_idx(sections, i);
+
+        //Find the correct section type, and parse.
+        if (guid_equal(&descriptors[i]->SectionType, &gEfiProcessorGenericErrorSectionGuid))
+            ir_section_generic_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiIa32X64ProcessorErrorSectionGuid))
+        //     ir_section_ia32x64_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiIpfProcessorErrorSectionGuid))
+        //     ir_section_ipf_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiArmProcessorErrorSectionGuid))
+        //     ir_section_arm_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiPlatformMemoryErrorSectionGuid))
+        //     ir_section_platform_memory_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiPlatformMemoryError2SectionGuid))
+        //     ir_section_platform_memory2_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiPcieErrorSectionGuid))
+        //     ir_section_pcie_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiFirmwareErrorSectionGuid))
+        //     ir_section_firmware_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiPciBusErrorSectionGuid))
+        //     ir_section_pci_bus_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiPciDevErrorSectionGuid))
+        //     ir_section_pci_dev_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiDMArGenericErrorSectionGuid))
+        //     ir_section_dmar_generic_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiDirectedIoDMArErrorSectionGuid))
+        //     ir_section_dmar_vtd_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiIommuDMArErrorSectionGuid))
+        //     ir_section_dmar_iommu_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiCcixPerLogErrorSectionGuid))
+        //     ir_section_ccix_per_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiCxlProtocolErrorSectionGuid))
+        //     ir_section_cxl_protocol_to_cper(section, out);
+        // else if (guid_equal(&descriptors[i]->SectionType, &gEfiCxlGeneralMediaErrorSectionGuid)
+        //     || guid_equal(&descriptors[i]->SectionType, &gEfiCxlDramEventErrorSectionGuid)
+        //     || guid_equal(&descriptors[i]->SectionType, &gEfiCxlPhysicalSwitchErrorSectionGuid)
+        //     || guid_equal(&descriptors[i]->SectionType, &gEfiCxlVirtualSwitchErrorSectionGuid)
+        //     || guid_equal(&descriptors[i]->SectionType, &gEfiCxlMldPortErrorSectionGuid))
+        // {
+        //     ir_section_cxl_component_to_cper(section, out);
+        // }
+        else
+        {
+            //Unknown GUID, so read as a base64 unknown section.
+            json_object* encoded = json_object_object_get(section, "data");
+            UINT8* decoded = b64_decode(json_object_get_string(encoded), json_object_get_string_len(encoded));
+            fwrite(decoded, descriptors[i]->SectionLength, 1, out);
+            fflush(out);
+            free(decoded);
+        }
+    }
+
+    //Free all remaining resources.
     free(header);
+    for (int i=0; i<amt_descriptors; i++)
+        free(descriptors[i]);
 }
 
 //Converts a CPER-JSON IR header to a CPER header structure.
 void ir_header_to_cper(json_object* header_ir, EFI_COMMON_ERROR_RECORD_HEADER* header)
 {
     header->SignatureStart = 0x52455043; //CPER
-    printf("beginning write.\n");
 
     //Revision.
     json_object* revision = json_object_object_get(header_ir, "revision");
@@ -60,7 +147,6 @@
     header->RecordLength = (UINT32)json_object_get_uint64(json_object_object_get(header_ir, "recordLength"));
 
     //Timestamp, if present.
-    printf("timestamp write.\n");
     json_object* timestamp = json_object_object_get(header_ir, "timestamp");
     if (timestamp != NULL) 
     {
@@ -69,7 +155,6 @@
     }
 
     //Various GUIDs.
-    printf("guid write.\n");
     json_object* platform_id = json_object_object_get(header_ir, "platformID");
     json_object* partition_id = json_object_object_get(header_ir, "partitionID");
     if (platform_id != NULL)
@@ -79,7 +164,6 @@
     string_to_guid(&header->CreatorID, json_object_get_string(json_object_object_get(header_ir, "creatorID")));
 
     //Notification type.
-    printf("notif type write.\n");
     json_object* notification_type = json_object_object_get(header_ir, "notificationType");
     string_to_guid(&header->NotificationType, json_object_get_string(json_object_object_get(notification_type, "guid")));
 
@@ -88,7 +172,44 @@
     header->PersistenceInfo = json_object_get_uint64(json_object_object_get(header_ir, "persistenceInfo"));
 
     //Flags.
-    printf("flag write.\n");
     json_object* flags = json_object_object_get(header_ir, "flags");
     header->Flags = (UINT32)json_object_get_uint64(json_object_object_get(flags, "value"));
+}
+
+//Converts a single CPER-JSON IR section descriptor into a CPER structure.
+void ir_section_descriptor_to_cper(json_object* section_descriptor_ir, EFI_ERROR_SECTION_DESCRIPTOR* descriptor)
+{
+    //Section offset, length.
+    descriptor->SectionOffset = (UINT32)json_object_get_uint64(json_object_object_get(section_descriptor_ir, "sectionOffset"));
+    descriptor->SectionLength = (UINT32)json_object_get_uint64(json_object_object_get(section_descriptor_ir, "sectionLength"));
+
+    //Revision.
+    json_object* revision = json_object_object_get(section_descriptor_ir, "revision");
+    int minor = json_object_get_int(json_object_object_get(revision, "minor"));
+    int major = json_object_get_int(json_object_object_get(revision, "major"));
+    descriptor->Revision = minor + (major << 8);
+
+    //Validation bits, flags.
+    descriptor->SecValidMask = ir_to_bitfield(json_object_object_get(section_descriptor_ir, "validationBits"), 
+        2, CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES);
+    descriptor->SectionFlags = ir_to_bitfield(json_object_object_get(section_descriptor_ir, "flags"), 
+        8, CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES);
+
+    //Section type.
+    json_object* section_type = json_object_object_get(section_descriptor_ir, "sectionType");
+    string_to_guid(&descriptor->SectionType, json_object_get_string(json_object_object_get(section_type, "data")));
+
+    //FRU ID, if present.
+    json_object* fru_id = json_object_object_get(section_descriptor_ir, "fruID");
+    if (fru_id != NULL)
+        string_to_guid(&descriptor->FruId, json_object_get_string(fru_id));
+
+    //Severity code.
+    json_object* severity = json_object_object_get(section_descriptor_ir, "severity");
+    descriptor->Severity = (UINT32)json_object_get_uint64(json_object_object_get(severity, "code"));
+
+    //FRU text, if present.
+    json_object* fru_text = json_object_object_get(section_descriptor_ir, "fruText");
+    if (fru_text != NULL)
+        strncpy(descriptor->FruString, json_object_get_string(fru_text), 20);
 }
\ No newline at end of file
diff --git a/sections/cper-section-generic.c b/sections/cper-section-generic.c
index 20f14c2..5b77c87 100644
--- a/sections/cper-section-generic.c
+++ b/sections/cper-section-generic.c
@@ -6,6 +6,7 @@
  **/
 
 #include <stdio.h>
+#include <string.h>
 #include "json.h"
 #include "../edk/Cper.h"
 #include "../cper-utils.h"
@@ -74,4 +75,44 @@
     json_object_object_add(section_ir, "instructionIP", json_object_new_uint64(section_generic->InstructionIP));
 
     return section_ir;
+}
+
+//Converts the given CPER-JSON processor-generic error section into CPER binary,
+//outputting to the provided stream.
+void ir_section_generic_to_cper(json_object* section, FILE* out)
+{
+    EFI_PROCESSOR_GENERIC_ERROR_DATA* section_cper = 
+        (EFI_PROCESSOR_GENERIC_ERROR_DATA*)calloc(1, sizeof(EFI_PROCESSOR_GENERIC_ERROR_DATA));
+
+    //Validation bits.
+    section_cper->ValidFields = ir_to_bitfield(json_object_object_get(section, "validationBits"), 
+        11, GENERIC_VALIDATION_BITFIELD_NAMES);
+        
+    //Various name/value pair fields.
+    section_cper->Type = (UINT8)readable_pair_to_integer(json_object_object_get(section, "processorType"));
+    section_cper->Isa = (UINT8)readable_pair_to_integer(json_object_object_get(section, "processorISA"));
+    section_cper->ErrorType = (UINT8)readable_pair_to_integer(json_object_object_get(section, "errorType"));
+    section_cper->Operation = (UINT8)readable_pair_to_integer(json_object_object_get(section, "operation"));
+
+    //Flags.
+    section_cper->Flags = (UINT8)ir_to_bitfield(json_object_object_get(section, "flags"), 4, GENERIC_FLAGS_BITFIELD_NAMES);
+
+    //Various numeric/string fields.
+    section_cper->Level = (UINT8)json_object_get_int(json_object_object_get(section, "level"));
+    section_cper->VersionInfo = json_object_get_uint64(json_object_object_get(section, "cpuVersionInfo"));
+    section_cper->ApicId = json_object_get_uint64(json_object_object_get(section, "processorID"));
+    section_cper->TargetAddr = json_object_get_uint64(json_object_object_get(section, "targetAddress"));
+    section_cper->RequestorId = json_object_get_uint64(json_object_object_get(section, "requestorID"));
+    section_cper->ResponderId = json_object_get_uint64(json_object_object_get(section, "responderID"));
+    section_cper->InstructionIP = json_object_get_uint64(json_object_object_get(section, "instructionIP"));
+
+    //CPU brand string.
+    const char* brand_string = json_object_get_string(json_object_object_get(section, "cpuBrandString"));
+    if (brand_string != NULL)
+        strncpy(section_cper->BrandString, brand_string, 127);
+
+    //Write & flush out to file, free memory.
+    fwrite(section_cper, sizeof(EFI_PROCESSOR_GENERIC_ERROR_DATA), 1, out);
+    fflush(out);
+    free(section_cper);   
 }
\ No newline at end of file
diff --git a/sections/cper-section-generic.h b/sections/cper-section-generic.h
index 78c5705..dd1931d 100644
--- a/sections/cper-section-generic.h
+++ b/sections/cper-section-generic.h
@@ -20,5 +20,6 @@
     {"restartable", "preciseIP", "overflow", "corrected"}
 
 json_object* cper_section_generic_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
+void ir_section_generic_to_cper(json_object* section, FILE* out);
 
 #endif
\ No newline at end of file
diff --git a/testing/cper-test.c b/testing/cper-test.c
index 15b77be..114374c 100644
--- a/testing/cper-test.c
+++ b/testing/cper-test.c
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <string.h>
 #include "../cper-parse.h"
 #include "json.h"
 #include "../json-schema.h"
@@ -8,14 +9,28 @@
 
 int main(int argc, char* argv[]) 
 {
-    test_ir_to_cper(argc, argv);
+    if (!strcmp(argv[1], "convert-to-json"))
+        test_cper_to_ir(argc, argv);
+    else if (!strcmp(argv[1], "convert-to-cper"))
+        test_ir_to_cper(argc, argv);
+    else
+    {
+        printf("Invalid command provided. Must be one of 'convert-to-json' or 'convert-to-cper'.\n");    
+    }
+
     return 0;    
 }
 
 void test_ir_to_cper(int argc, char* argv[])
 {
+    if (argc < 4)
+    {
+        printf("Insufficient number of arguments.\n");
+        return;
+    }
+
     //Read JSON IR from file.
-    json_object* ir = json_object_from_file(argv[1]);
+    json_object* ir = json_object_from_file(argv[2]);
     if (ir == NULL)
     {
         printf("Could not read IR JSON, import returned null.");
@@ -23,7 +38,7 @@
     }
 
     //Open a read for the output file.
-    FILE* cper_file = fopen(argv[2], "w");
+    FILE* cper_file = fopen(argv[3], "w");
     if (cper_file == NULL) {
         printf("Could not open output file, file handle returned null.");
         return;
@@ -38,7 +53,7 @@
 void test_cper_to_ir(int argc, char* argv[])
 {
     //Get a handle for the log file.
-    FILE* cper_file = fopen(argv[1], "r");
+    FILE* cper_file = fopen(argv[2], "r");
     if (cper_file == NULL) {
         printf("Could not open CPER record, file handle returned null.");
         return;
@@ -51,12 +66,12 @@
     printf("\n%s\n", json_output);
 
     //Test JSON validator.
-    if (argc >= 3)
+    if (argc >= 4)
     {
-        printf("Validating output with specification %s...\n", argv[2]);
+        printf("Validating output with specification %s...\n", argv[3]);
         validate_schema_debug_enable();
         char* error_message = malloc(JSON_ERROR_MSG_MAX_LEN);
-        if (!validate_schema_from_file(argv[2], ir, error_message))
+        if (!validate_schema_from_file(argv[3], ir, error_message))
         {
             printf("Validation failed: %s\n", error_message);
         }
