Skip to content

Instantly share code, notes, and snippets.

@ldmsys
Last active November 24, 2023 15:23
Show Gist options
  • Save ldmsys/e182a4944c56c441b8ec222eede67884 to your computer and use it in GitHub Desktop.
Save ldmsys/e182a4944c56c441b8ec222eede67884 to your computer and use it in GitHub Desktop.
syscall bomb test
#define TEST_CNT 10000000UL
void _start() {
for(long long i=0;i<TEST_CNT;i++) {
__asm( "mov $0xa9, %rax\n\t"
"mov $0xfee1dead, %rdi\n\t"
"mov $0x28121969, %rsi\n\t"
"mov $0x89abcdef, %rdx\n\t"
"syscall\n\t");
}
__asm( "mov $0x3c, %rax\n\t"
"xor %rdi, %rdi\n\t"
"syscall\n\t");
}
@ldmsys
Copy link
Author

ldmsys commented Nov 22, 2023

i386

#define TEST_CNT 10000000UL

void _start() {

 for(long long i=0;i<TEST_CNT;i++) {
  __asm( "mov $0x58, %eax\n\t"
   "mov $0xfee1dead, %ebx\n\t"
   "mov $0x28121969, %edx\n\t"
   "mov $0x89abcdef, %ecx\n\t"
   "int $0x80\n\t");
 }

 __asm( "mov $0x01, %eax\n\t"
  "xor %ebx, %ebx\n\t"
  "int $0x80\n\t");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment