I am inserting a HEX code in the QByteArray variable,
That hex isn't for a normal txt file, it's for an EXECUTABLE one, so it contains binary information

Qt Code:
  1. QByteArray hex = "fff0000b800000000000000400"; // Very long hex string
  2. hex = QByteArray::fromHex(hex);
  3. hex = hex.data();
  4. int hexx = hex.size(); // outputs "3" while the real size is about 486400 byte
To copy to clipboard, switch view to plain text mode 

also when I output the result it only shows "MZ" and these are the first two characters of the .exe when opend with notpad.
and th rest characters are ASCII and unknown ones.

I need your help to complete this task.
Reason: I want to inject a binary data converted from hex into another process using QProcess.
Thanx.