-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add the processing of import table
- Loading branch information
Showing
3 changed files
with
446 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* @file import_table.h | ||
* @brief Transform the import table. | ||
* | ||
* @author Chen Zhenshuo (chenzs108@outlook.com) | ||
* @version 1.0 | ||
* @date 2020-01-10 | ||
* | ||
* @par GitHub | ||
* https://github.com/czs108/ | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "image.h" | ||
|
||
#include <windows.h> | ||
|
||
#include <stdbool.h> | ||
|
||
/** | ||
* @brief Calculate the size required for the import table of the new format. | ||
* | ||
* @public @memberof _PE_IMAGE_INFO | ||
* | ||
* @param image_info The PE image. | ||
* @return The required size. | ||
*/ | ||
DWORD CalcNewImpTableSize( | ||
const PE_IMAGE_INFO *const image_info); | ||
|
||
|
||
/** | ||
* @brief Transform the import table into the new format. | ||
* | ||
* @public @memberof _PE_IMAGE_INFO | ||
* | ||
* @param image_info The PE image. | ||
* @param new_table | ||
* The space where the new table will be constructed, | ||
* and its size must be larger than the value returned by `CalcNewImpTableSize()` method. | ||
* Set this to `NULL` to get the required size. | ||
* | ||
* @return The required size for the new import table. | ||
*/ | ||
DWORD TransformImpTable( | ||
const PE_IMAGE_INFO *const image_info, | ||
BYTE *const new_table); | ||
|
||
|
||
/** | ||
* @brief Clear the original import table. | ||
* | ||
* @public @memberof _PE_IMAGE_INFO | ||
* | ||
* @param image_info The PE image. | ||
*/ | ||
void ClearImpTable( | ||
const PE_IMAGE_INFO *const image_info); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.