ghidra 使用01

示例程序源码

1
2
3
4
5
6
7
#include <stdio.h>

int main() {
printf("hello world!");

return 0;
}

软件使用

  1. 先创建一个个人的工程
  2. 使用 File -> import file 导入 exe到项目里
  3. 右键exe -> open in Default tool
  4. 会提示要分析exe, 直接默认确认

代码

1
2
3
4
5
6
7
8
9
void entry(void)
{
// 初始化栈缓冲区溢出保护
___security_init_cookie();

//C/C++ 运行库的完整初始化,并最终调用 main 或 WinMain
___tmainCRTStartup();
return;
}
  1. 进入 ___tmainCRTStartup();
  2. 找到类似 DAT_00403030 = FUN_00401000(); 通过其跳转到main

分析

  1. 内存4K对齐,所以 代码实际位置在00401000, 1000之前是给pe的 就算pe无法全部使用也得空着

ghidra 使用01
https://fu01.github.io/posts/5541aa69/
作者
Fu01
发布于
2026年10月5日
许可协议