The IDA Pro Book by Eagle Chris
Author:Eagle, Chris [Chris Eagle]
Language: eng
Format: epub, mobi
Tags: COMPUTERS / Software Development & Engineering / General
ISBN: 9781593273958
Publisher: No Starch Press
Published: 2011-06-15T16:00:00+00:00
In the current example, only one segment exists, because IDA creates only one segment to hold the entire file when a file is loaded in binary mode. The two checkbox options shown in the dialog determine how IDA handles relocation entries when segments are moved and whether IDA should move every segment present in the database, respectively. For a file loaded in binary mode, IDA will not be aware of any relocation information. Similarly, with only one segment present in the program, the entire image will be rebased by default.
The AddressOfEntryPoint field specifies the relative virtual address (RVA) of the program entry point. An RVA is a relative offset from the program’s base virtual address, while the program entry point represents the address of the first instruction within the program that will be executed. In this case an entry point RVA of 1000h indicates that the program will begin execution at virtual address 401000h (400000h + 1000h). This is an important piece of information, because it is our first indication of where we should begin looking for code within the database. Before we can do that, however, we need to properly map the remainder of the database to appropriate virtual addresses.
The PE format makes use of sections to describe the mapping of file content to memory ranges. By parsing the section headers for each section in the file, we can complete the basic virtual memory layout of the database. The NumberOfSections field indicates the number of sections contained in a PE file; in this case there are four. Referring once again to the PE specification, we would learn that an array of section header structures immediately follows the IMAGE_NT_HEADERS structure. Individual elements in the array are IMAGE_SECTION_HEADER structures, which we could define in IDA’s Structures window and apply (four times in this case) to the bytes following the IMAGE_NT_HEADERS structure.
Before we discuss segment creation, two additional fields worth pointing out are FileAlignment and SectionAlignment . These fields indicate how the data for each section is aligned[131] within the file and how that same data will be aligned when mapped into memory, respectively. In our example, each section is aligned to a 200h byte offset within the file; however, when loaded into memory, those same sections will be aligned on addresses that are multiples of 1000h. The smaller FileAlignment value offers a means of saving space when an executable image is stored in a file, while the larger SectionAlignment value typically corresponds to the operating system’s virtual memory page size. Understanding how sections are aligned can help us avoid errors when we manually create sections within our database.
After structuring each of the section headers, we finally have enough information to begin creating additional segments within the database. Applying an IMAGE_SECTION_HEADER template to the bytes immediately following the IMAGE_NT_HEADERS structure yields the first section header and results in the following data displayed in our example database:
seg000:00400178 db '.text',0,0,0 ; Name seg000:00400178 dd 440h ; VirtualSize seg000:00400178 dd 1000h ; VirtualAddress seg000:00400178 dd
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12609)
Hello! Python by Anthony Briggs(9931)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9806)
The Mikado Method by Ola Ellnestam Daniel Brolund(9798)
Dependency Injection in .NET by Mark Seemann(9354)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8317)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7777)
Grails in Action by Glen Smith Peter Ledbrook(7710)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7573)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7242)
Microservices with Go by Alexander Shuiskov(7007)
Practical Design Patterns for Java Developers by Miroslav Wengner(6916)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6869)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6431)
Angular Projects - Third Edition by Aristeidis Bampakos(6285)
The Art of Crafting User Stories by The Art of Crafting User Stories(5802)
NetSuite for Consultants - Second Edition by Peter Ries(5730)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5551)
Kotlin in Action by Dmitry Jemerov(5078)
