Ret Address Recorder

轉:http://old.xxxxx.im/viewthread.php?tid=25694

還是以前的名字比較好聽我覺得...
這個很好用的喔...稍微改一下還有很多用途...
這裡教了怎麼寫表跟查表...
  1. // Ret Address Recorder
  2. // Auther: Inndy
  3. [ENABLE]
  4. Alloc(HookProc, 128)
  5. Label(LoopSearch)
  6. Label(Return)
  7. Label(AddToList)
  8. Alloc(EspList, 2048)
  9. Alloc(Count, 4)
  10. RegisterSymbol(HookProc)
  11. RegisterSymbol(EspList)
  12. RegisterSymbol(Count)

  13. HookProc:
  14. Pushad
  15. Mov Eax, [Esp+20]
  16. Cmp Eax, 00400000 // [Esp] 下限
  17. Jl Return
  18. Cmp Eax, 01000000 // [Esp] 上限
  19. Jg Return
  20. Mov Ebx, EspList
  21. Mov Ecx, [Count]
  22. Test Ecx, Ecx
  23. Je AddToList
  24. Dec Ecx
  25. LoopSearch:
  26. Cmp [Ebx+Ecx*4], Eax
  27. Je Return
  28. Test Ecx, Ecx
  29. Je AddToList
  30. Dec Ecx
  31. Jmp LoopSearch
  32. AddToList:
  33. Mov Ecx, [Count]
  34. Mov [Ebx+Ecx*4], Eax
  35. Inc [Count]
  36. Return:
  37. Popad
  38. // Orginal Code Here Please

  39. // Jump Back Here Please

  40. // {Address}:
  41. // Jmp HookProc
  42. [DISABLE]
  43. // Restore Hook Here Please

  44. Dealloc(HookProc)
  45. Dealloc(EspList)
  46. Dealloc(Count)
  47. UnregisterSymbol(HookProc)
  48. UnregisterSymbol(EspList)
  49. UnregisterSymbol(Count)

留言

  1. 網址更新囉:http://old.xxxxx.im/viewthread.php?tid=25694

    回覆刪除

張貼留言

本月最夯