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
QByteArray hex
= "fff0000b800000000000000400";
// Very long hex string hex = hex.data();
int hexx = hex.size(); // outputs "3" while the real size is about 486400 byte
QByteArray hex = "fff0000b800000000000000400"; // Very long hex string
hex = QByteArray::fromHex(hex);
hex = hex.data();
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.
Bookmarks