如何在Python中复制代码:
from struct import pack
string = pack("<I", 0x11111111)
print string
在C?根据我的理解\ x11是一个不可打印的角色所以......?
答案 0 :(得分:2)
const char *string = "\x11\x11\x11\x11";
puts(string);
答案 1 :(得分:1)
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);