c - How to memset() memory to a certain pattern instead of a single byte? -


I am facing a problem today where I get the form of a special pattern like memory 0x 11223344 , therefore, looks like full memory (in hex):

  1122334411223344112233441122334411223344112233441122334411223344 ...  

I understand this How can I do this?

Any thoughts?

Thank you, Boda Cisco.

The pointer must be inserted into the byte as the indicator of the required size (such as UIT for 4 bytes 32_T) and fill it with an integer This is a bit ugly.

  Four Buffs [256] = {0,}; Uint32_t * p = (uint32_t *) buff, i; (I = 0; i & lt; s form (buf) / size (* p); ++ i) {pi [i] = 0x11223344; }  

Not tested!


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -