When PE files are loaded into the memory, they are 64 kB aligned

Source: Internet
Author: User

Look at the Win32 compilation of Luo yunbin and see a small problem when searching the kernel32.dll base address. The book says:

MasterProgramThe return address obtained from the stack is passed as a parameter, and then aligned with 64 K, that is, it performs and with 0ffff0000h, and then decreases by 10000 h when searching by page!

Why is it 64 K aligned? Why is it not aligned by the size of one page in the memory? Why do we need to decrease 10000h? Wondering... So Baidu + Google struggled to find the answer... Please refer to this section!

"For modules loaded into the program, the base address is aligned. You can use the debugger to check that each module in the program includes the DLL and the program itself, the last four digits of the base address in hexadecimal format are 0, that is, 0xxxx0000h, that is, the PE Header will appear near these addresses, so the search efficiency is accelerated by subtracting 10000"

I believe you have understood it! 10000h is 64 K! ^_^ Haha, it's a little dish, but if you don't understand me, I hope it will be helpful to you! O (partition _ partition) O

 

 

The same question in the snow found the answer: Turn: http://bbs.pediy.com/showthread.php? T = 99859

 

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.