如何从C中的pe(exe)文件中删除一些数据
在第一个exe中,我定义了带有一些特殊字节作为标签的字符数组,我将其从另一个exe映射到内存,找到所需的标签并放入新数据,但该数据可能比定义的数组短,所以我想剪切这个数组需要的大小!我该怎么做?
in first exe i have defined array of char with some special bytes as label, i mapping it to memory from another exe, finding needed label and putting in it new data, but this data could be shorter then defined array, so i want to cut this array to needed size! how can i do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有什么好的简单方法可以剪切 PE 文件片段。
明显的解决方案是在原始(用您的术语第一个)exe中额外定义一个
length
字段,并用另一个标签标记它。然后第二个 exe 的额外工作是将实际数据长度写入该字段。编辑:如果切割是您的主要目标,您还必须记住:
参考:
http://msdn.microsoft.com/en-us/library/ms809762。 ASPX
There is no fine and simple way to cut out pieces of PE file.
Obvious solution is to additionally define a
length
field in the original (in your terms first) exe and mark it with another label. Then additional work of second exe would be to write to this field actual data length.EDIT: If cutting is your primary goal you must also keep in mind that:
Reference:
http://msdn.microsoft.com/en-us/library/ms809762.aspx