Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. static int check_fnstenv_instr(uint8_t* buf, int buf_len, int offset)
  2. {
  3. uint8_t *buf_cpy = buf + offset;
  4. int rv, i;
  5.  
  6. /*
  7. * This array is the fnstenv [esp - 12] instruction in Metasploit.
  8. */
  9. static const uint8_t fnstenv_instr[] = { 0xd9, 0x74, 0x24, 0xf4 };
  10. static const int N = sizeof(fnstenv_instr);
  11.  
  12. if (buf_len - offset >= N) {
  13. for (i = 0; i < N && buf_cpy[i] == fnstenv_instr[i]; i++)
  14. continue;
  15.  
  16. if (i == N) {
  17. rv = 1;
  18. goto out;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement