How happens the serealization the data in the file blkxxxx.dat in the bitcoin I'm writing a blockchain parser for bitcoin core with C++ and now I want to enrich the data I read with the raw transaction and the previous and next block hashes.

I used this library to convert the hexadecimal to a double sha256 but now my problem is to bring the data I read into the correct format, for example, the VarInt is serialized as corresponding hexadecimal (for example 77 -> 4d).
But on some things, I don't find myself, for example in the conversion of integers of the type uint32 and int32.

I'll give you an example
The version number of the genesis block is 1 and the serialization to the correct hash is 01000000

or the conversion of the nonce of the genesis block which is 2083236893 but the correct form for the serialization is 7c2bac1d

Similarly for

NBits = 486604799 -> serialization = 1d00ffff
timestamp = 1231469665 -> serialization = 495fab29

Sorry for my terrible English but I'm learning.

______ Solution ______

Bitcoin core to use the method for serializing block, into file blk and sending data into the network, to create the hash.

Then, the hash block do create with all data into little endian form.
You are being confused three ways.

First, you need to be careful that some of your numbers in decimal, others are in hexadecimal: 77 decimal -> 4d hexadecimal (so: 77d -> 0x4d)

Second, you need to be careful that most numbers are stored in little endian notation, so 0x00000001 -> 0x01000000. Theymos' discussion why little endian is used.

Third, you have mixed up numbers from the Genesis Block and those from block 125552:

The Genesis block nonce 2083236893d converts to 0x7c2bac1d as hexadecimal not 0x42a14695. 

0x42a14695 is the nonce mentioned at https://en.bitcoin.it/wiki/Block_hashing_algorithm for Block 125552, not for the Genesis block.

Similarly, Nbits 486604799d is for the Genesis block, 0xf2b9441a is for block 125552. Timestamp 1231469665d is for the Genesis block, 0xc7f5d74d is for block 125552.