ring0-Traversal IAT (special case Ntos)

Source: Internet
Author: User

http://blog.csdn.net/hgy413/article/details/7786530

The IAT of the original ntos can only be obtained through Image_directory_entry_iat (12), because the init mode is loaded after the ntos is loaded, so image_directory_entry_import corresponding area is released!
Hang on, Dad.
Can be used WinDbg very intuitive to see:
X86:x64: The other IAT traversal codes are as follows: [CPP]View Plaincopy
  1. NTSTATUS enumiattable (ulong_ptr pbase)
  2. {
  3. Pimage_dos_header PDos = (pimage_dos_header) pbase;
  4. Pimage_nt_headers pNt = NULL;
  5. Pimage_import_descriptor pimport = NULL;
  6. Pimage_thunk_data pthunk = NULL;
  7. if (NULL = = PDos
  8. || Image_dos_signature! = pdos->e_magic)
  9. {
  10. return Status_invalid_image_format;
  11. }
  12. PNt = (pimage_nt_headers) ((Puchar) pbase+pdos->e_lfanew);
  13. if (image_nt_signature! = pnt->signature)
  14. {
  15. return Status_invalid_image_format;
  16. }
  17. Pimport = (pimage_import_descriptor) ((Puchar) pbase+pnt->optionalheader.datadirectory[image_directory_ Entry_import].  virtualaddress);
  18. //Enumerate print
  19. While (NULL!=pimport
  20. && Mmisaddressvalid (Pimport)
  21. &&pimport->name! = 0)
  22. {
  23. Pthunk = (Pimage_thunk_data) ((Puchar) pbase+pimport->firstthunk);
  24. While (NULL! = Pthunk
  25. && Mmisaddressvalid (Pthunk)
  26. && pthunk->u1. Function! = 0)
  27. {
  28. Kdprint ("[Enumiattable]-import module:%s-function:%p\r\n", (Puchar) Pbase+pimport->name, PTHUNK->U1 .  Function));
  29. pthunk++;
  30. }
  31. pimport++;
  32. }
  33. return status_success;
  34. }

ring0-Traversal IAT (special case Ntos)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.