
kazymjir wrote:Brainsaw, are you sure?
#include <stdio.h>
int main()
{
char* p=new char[12];*p=0x48;++p;*p=0x65;++p;*p=0x6c;
++p;*p=0x6c;++p;*p=0x6f;++p;*p=0x20;++p;*p=0x57;++p;
*p=0x6f;++p;*p=0x72;++p;*p=0x6c;++p;*p=0x64;++p;
*p=0x0;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;
printf(p);
delete p;
return 0;
}
hybrid wrote:It's also called _tmain, which will probably also not link without a proper main().
#include <stdio.h>
int main() {
char *p=new char[13];
*p++=0x48;*p++=0x65;*p++=0x6c;*p++=0x6c;*p++=0x6f;
*p++=0x20;*p++=0x57;*p++=0x6f;*p++=0x72;*p++=0x6c;*p++=0x64;*p++=0x0A;*p=0;
--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;printf(p);return 0;
}
int main() {
char *p=new char[13];
*p++=0x48;*p++=0x65;*p++=0x6c;*p++=0x6c;*p++=0x6f;
*p++=0x20;*p++=0x57;*p++=0x6f;*p++=0x72;*p++=0x6c;*p++=0x64;*p++=0x0A;*p=0;
--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;--p;
__asm__("\
movl $4, %%eax\n\
movl $0, %%ebx\n\
push %0\n\
pop %%ecx\n\
movl $13,%%edx\n\
int $0x80" : :"g"(p)); return 0;
}
Users browsing this forum: No registered users and 1 guest