-
-
[原创]PE知识汇总
-
发表于: 2020-9-22 11:05 3115
-
EXE文件一般不存在输出表,而大部分DLL文件存在,但也不是绝对的。
这里所使用的DLL 是自己所编写的,带有输出函数的DLL
跳转到这些地址查看
Name:
AddressOfFunctions:
AddressOfNames:
AddressOfNameOrdinals:
1:myAdd:0000 1000
2:myDec:0000 1020
IDA 加载查看一下
注释:1000 0000 是ImageBase,上面得出的0000 1000可以理解为偏移
未完待续....
typedef struct _IMAGE_EXPORT_DIRECTORY {
DWORD Characteristics;
/
/
未使用,总为
0
DWORD TimeDateStamp;
/
/
文件创建时间戳
WORD MajorVersion;
/
/
未使用,总为
0
WORD MinorVersion;
/
/
未使用,总为
0
DWORD Name;
/
/
指向一个代表此 DLL名字的 ASCII字符串的 RVA
DWORD Base;
/
/
函数的起始序号
DWORD NumberOfFunctions;
/
/
导出函数的总数
DWORD NumberOfNames;
/
/
以名称方式导出的函数的总数
DWORD AddressOfFunctions;
/
/
指向输出函数地址的RVA
DWORD AddressOfNames;
/
/
指向输出函数名字的RVA
DWORD AddressOfNameOrdinals;
/
/
指向输出函数序号的RVA
} IMAGE_EXPORT_DIRECTORY,
*
PIMAGE_EXPORT_DIRECTORY;
typedef struct _IMAGE_EXPORT_DIRECTORY {
DWORD Characteristics;
/
/
未使用,总为
0
DWORD TimeDateStamp;
/
/
文件创建时间戳
WORD MajorVersion;
/
/
未使用,总为
0
WORD MinorVersion;
/
/
未使用,总为
0
DWORD Name;
/
/
指向一个代表此 DLL名字的 ASCII字符串的 RVA
DWORD Base;
/
/
函数的起始序号
DWORD NumberOfFunctions;
/
/
导出函数的总数
DWORD NumberOfNames;
/
/
以名称方式导出的函数的总数
DWORD AddressOfFunctions;
/
/
指向输出函数地址的RVA
DWORD AddressOfNames;
/
/
指向输出函数名字的RVA
DWORD AddressOfNameOrdinals;
/
/
指向输出函数序号的RVA
} IMAGE_EXPORT_DIRECTORY,
*
PIMAGE_EXPORT_DIRECTORY;
/
/
dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include <math.h>
int
myAdd(
int
a,
int
b,
int
*
result)
{
*
result
=
a
+
b;
return
1
;
}
/
/
导出函数定义
int
myDec(
int
a,
int
b,
int
*
result)
{
*
result
=
abs
(a
-
b);
return
1
;
}
BOOL
APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break
;
}
return
TRUE;
}
/
/
dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include <math.h>
int
myAdd(
int
a,
int
b,
int
*
result)
{
*
result
=
a
+
b;
return
1
;
}
/
/
导出函数定义
int
myDec(
int
a,
int
b,
int
*
result)
{
*
result
=
abs
(a
-
b);
return
1
;
}
BOOL
APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
他的文章
- JS 解混淆----FIN7 使用的一个恶心的JS 脚本 13722
- xxxxxxxxxxxxxxxxxxxxx 10023
- [分享]这段时间学习驱动开发的相关的一些笔记 23096
- [原创]一次样本分析 7893
- [原创]PE知识汇总 4596
赞赏
雪币:
留言: