Skip to content

Instantly share code, notes, and snippets.

@bringhurst
Created July 17, 2010 18:53
Show Gist options
  • Save bringhurst/479744 to your computer and use it in GitHub Desktop.
Save bringhurst/479744 to your computer and use it in GitHub Desktop.
A example of a nop pad which confuses gdb's function boundary testing..
#define NPAD_START asm volatile ( \
"pushl %eax \n"
"movl %esp, %eax\n")
#define NPAD asm volatile ("addb %al, (%eax)\n")
#define NPAD_END asm volatile ("popl %eax\n")
#define NPAD_40 NPAD_START; \
NPAD; NPAD; NPAD; NPAD; \
NPAD; NPAD; NPAD; NPAD; \
NPAD; NPAD; NPAD; NPAD; \
NPAD; NPAD; NPAD; NPAD; \
NPAD; NPAD; NPAD; NPAD; \
NPAD_END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment