如何在 Python 中复制代码:
from struct import pack
string = pack("<I", 0x11111111)
print string
在 C? 据我了解 \x11 是一个不可打印的字符,所以......?
如何在 Python 中复制代码:
from struct import pack
string = pack("<I", 0x11111111)
print string
在 C? 据我了解 \x11 是一个不可打印的字符,所以......?
const char *string = "\x11\x11\x11\x11";
puts(string);
char* memory = (char*)malloc(5); //4 bytes plus null
for(uint i=0;i<4;i++){
memory[i] = 0x11; //creating a little-endian 4byte \0x11111111
// avoiding local endianess issues
};
memory[4] = 0; //To make it into a string
printf("%s\n", memory);
free(memory);