I hve ported tpm2_tools to windows and and am able to run tpm2_getrandom, tpm2_createprimary etc. I am using the ctx file generated by tpm2_createprimary to run tpm2_create. HEre are the commands i used: tpm2_createprimary -c primary.ctx (works)tpm2_create -C primary.ctx -u obj.pub -r obj.priv (fails) This is the error i get: ERROR: Found magic 0x40000001 did not match expected magic of 0xbadcc0de! WARN: The loaded tpm context does not appear to be in the proper format, assuming old format, this will be converted on the next save. ERROR: Could not load tpm context file ERROR: Failed to load_tpm_context_file() ERROR: Unable to run C:\Users\arunsu\source\repos\tpm2-tools-4.0\vstudio\x64\Debug\tpm2-create.exe I see from files.c that the magic is hardcoded. /** * This is the magic for the file header. The header is organized * as a big endian U32 (BEU32) of MAGIC followed by a BEU32 of the * version number. Tools can define their own, individual file * formats as they make sense, but they should always have the header. */ static const UINT32 MAGIC = 0xBADCC0DE; Is this a windows vs Linux issue? Should i change the magic value?