使用MapAndLoad来看可执行文件的段结构

最近研究文件的装载与执行原理, 正好看到这个函数可以加载可执行文件并且使用PLOADED_IMAGE结构来保存内容.\
MapAndLoad
 

The
MapAndLoad function maps an image and preloads data from the mapped file.

BOOL MapAndLoad(
  PSTR ImageName,
  PSTR DllPath,
  PLOADED_IMAGE LoadedImage,
  BOOL DotDll,
  BOOL ReadOnly
);
Parameters
ImageName
[in] Pointer to a null-terminated string that specifies the name of the image that is loaded.
DllPath
[in] Pointer to a null-terminated string that specifies the path used to locate the image if the name provided cannot be found. If NULL is used, then the search path rules set forth in the SearchPath function apply.
LoadedImage
[out] Pointer to a LOADED_IMAGE structure that receives information about the image after it is loaded.
DotDll
[in] Default extension to be used if the image name does not contain a file extension. If the value is TRUE, a .DLL extension is used. If the value is FALSE, then an .EXE extension is used.
ReadOnly
[in] Access mode. If this value is TRUE, the file is mapped for read-access only. If the value is FALSE, the file is mapped for read and write access.
Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值