'\x01\x00\x00\x004\x12\x00\x00\x00'
^ this '4' is not part of a hex escape
actually the same as:
'\x01\x00\x00\x00\x34\x12\x00\x00\x00'
Since the ASCII code for "4" is 0x34.
Since you used the standard (native) format, Python used its own alignment for the data, so the second field was aligned with an offset of 4 and 3 zeros that were added before it.
, , >BIB <BIB ( big-endian little-endian ). '\x01\x00\x00\x12\x34\x00' '\x01\x34\x12\x00\x00\x00'. , , , , big-endian little-endian 0x1234.
. : , .