3 ms·
I think something like this gets disallowed these days as .rodata and .data gets mapped NX.
by monocasa 6y ago
I think something like this gets disallowed these days as .rodata and .data gets mapped NX.
- ache7 6y agoUsing compiler hints, data can be placed directly in the code section. Works on x86/x86_64 Linux: char main[] __attribute__ ((section(".text"))) = "\xe8\x0d\0\0\0Hello world!\n" #ifdef __x86_64__ "\x31\xc0\x8d\x50\x0d\xff\xc0\x89\xc7\x5e\x0f\x05\x31\xff\x8d\x47\x3c\x0f\x05"; #else "\x31\xdb\x8d\x53\x0d\x59\x8d\x43\x04\x43\xcd\x80\x31\xdb\x8d\x43\x01\xcd\x80"; #endif
- hinoki 6y agoI wonder if there have been any entries that use return oriented programming? I wasn’t able to find one...