在已编译的 exe 中编辑字符串

Edit a string inside a compiled exe

本文关键字:编辑 字符串 exe 编译      更新时间:2023-10-16

我在Windows中使用Visual Studio c++。

我想做的是在编译的 exe 中搜索一个特定的字符串并将其替换为另一个字符串。

使用记事本++是可能的,但我想做我自己的exe来做到这一点。

例:

  1. 在 blabla 中搜索.exe 查找字符串 "test1"
  2. 将其替换为另一个字符串"test2"

最简单的方法是什么?

谢谢。

你需要

一个十六进制编辑器,Hxd(http://mh-nexus.de/en/hxd/)可以轻松实现