Limited the name to 10 characters. Added product code.

This commit is contained in:
Steven Mattera 2019-05-08 19:02:52 -04:00
parent 9d39e91fb0
commit 4d7340d64c

View File

@ -79,7 +79,9 @@ typedef struct {
u64 _0x10; u64 _0x10;
u32 ProcessCategory; u32 ProcessCategory;
u32 MainThreadStackSize; u32 MainThreadStackSize;
char Name[0x50]; char Name[0x10];
char ProductCode[0x10];
u8 _0x40[0x30];
u32 Aci0Offset; u32 Aci0Offset;
u32 Aci0Size; u32 Aci0Size;
u32 AcidOffset; u32 AcidOffset;
@ -281,6 +283,12 @@ int CreateNpdm(const char *json, void **dst, u32 *dst_size) {
goto NPDM_BUILD_END; goto NPDM_BUILD_END;
} }
/* Parse product code. */
const cJSON *product_code = cJSON_GetObjectItemCaseSensitive(npdm_json, "product_code");
if (cJSON_IsString(product_code) && (product_code->valuestring != NULL)) {
strncpy(header.ProductCode, product_code->valuestring, sizeof(header.ProductCode) - 1);
}
/* Parse main_thread_stack_size. */ /* Parse main_thread_stack_size. */
u64 stack_size = 0; u64 stack_size = 0;
if (!cJSON_GetU64(npdm_json, "main_thread_stack_size", &stack_size)) { if (!cJSON_GetU64(npdm_json, "main_thread_stack_size", &stack_size)) {