Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在运行文件之前替换文件中的字节序列,例如 3B 01 40 3F 到 00 00 10 3F。我在 Google 中寻找解决方案,但只有 C# 答案。
替换二进制文件中的字节序列
提前感谢您的帮助。
C# 的答案也应该在这里工作。
void replace(long pos, std::string filename, std::string replacement) { std::ofstream out(filename.c_str()); out.seekp(pos); out.write(replacement.c_str(), replacement.size()); }