c++ - 使用 C++ 从 .exe/.dll 等二进制文件中提取文本

标签 c++

我想解析给定的二进制文件并使用 C++ 从中提取信息(文本)。

有哪些方法可用?

最佳答案

您可以使用strings(1)将文件中的可打印字符串提取到文件或管道中,然后处理这些行。例如:

$ strings werl.exe
!This program cannot be run in DOS mode.
Rich
.text
`.rdata
@.data
.rsrc
QRVh
Could not load module %s.
win_erlexec
Could not find entry point "win_erlexec" in %s.
Could not find key %s in section %s of file %s
Cannot find erlexec.exe
erts-*
\bin
erts-

要将此输出保存到文件 out.txt,请使用重定向:

$ strings werl.exe > out.txt

关于c++ - 使用 C++ 从 .exe/.dll 等二进制文件中提取文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4782050/

相关文章:

java - Java 的 instanceof 的 C++ 版本是什么? : checking, 未转换

c++ - 链接 Google TCMalloc 库的最安全方式

c++ - 是什么导致我的 OpenCV 内存泄漏

c++ - 条件语句的按位与异或

安卓 : JNI ERROR (app bug): local reference table overflow (max=512)

java - Android JNI 中的 native 崩溃 SIGSEGV

c++ - #elif 定义时没有括号

c++ - 如何获取内核对象的安全描述符?

c++ - 错误 C2661 : no overloaded function takes 2 arguments

c++ - std::atomic load 中的段错误?