无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 4591|回复: 7
打印 上一主题 下一主题

[求助] 求一个可以替换"二进制文件"的内容的程序

[复制链接]
跳转到指定楼层
1#
发表于 2006-11-10 04:30:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
比如, 我要替换某文件 0x07 处内容, 将1改为0 ?       有这样的程序?
2#
发表于 2006-11-10 09:58:34 | 只看该作者
winhex就何以办到。
回复

使用道具 举报

3#
 楼主| 发表于 2006-11-10 14:38:21 | 只看该作者
我要命令行工具, 用于自动化操作.   

我找到个方法以,  使用不方便, 不支持长文件名

debug 1.lnk < 1.txt


  1. n 1.lnk
  2. e 115
  3. 10
  4. w
  5. q
复制代码
回复

使用道具 举报

4#
发表于 2006-12-13 00:51:20 | 只看该作者
我也找了很久,实在找不到,正准备自己用turbo C写一个.
功能预计如下:
binrep.exe /?
BinRep.exe  Binary file string replace program
Usage:
           BinRep.exe  <filename> <Position>  <length>  <string>
                <filename>:   The binary file.
                <position>:    The offset of string need to be replaced.
                  <length>:     The length of the string.
                   <string>:     The new string use to replace the old string in binary file.
有什么建议吗?

[ 本帖最后由 tintinbt 于 2006-12-13 12:56 AM 编辑 ]
回复

使用道具 举报

5#
发表于 2006-12-13 21:25:42 | 只看该作者
tintinbt
BinRep.exe  不标明替换的位置? 是查找全部替换??
回复

使用道具 举报

6#
发表于 2006-12-14 01:25:46 | 只看该作者
写好了一个,试试
<position>就是字符串开始位置

  Binrep.exe V1.00 by Figer (tintinbt@gmail.com)  Dec,2006
  This program replace a string in a binary file.

  Usage: Binrep.exe <filename> <startfrom> <length>  <string>  [/Y]
                      <filenae> - The name of the binary file.  文件名
                    <startfrom> - The offset of the old string in binary file.  字符串起始位置
                       <length> - The length of the old string.   字符串长度
                       <string> - The new string. (length must less or equal the old string)   新字符串
                           [/Y] - No prompt to confirm the string replacement      /y参数不需确认,直接替换

  Example: replace string from bios.bin, from the 120th byte, length 10 bytes
    BinRep bios.bin 120 10 CAC63602UA
    Replace string "CAC6360S1K" to "CAC63602UA" (Y/N)?y
    The string "CAC6360S1K" has been replaced to "CAC63602UA"

[ 本帖最后由 tintinbt 于 2006-12-14 01:31 AM 编辑 ]

BINREP.rar

9.64 KB, 下载次数: 84, 下载积分: 无忧币 -2

回复

使用道具 举报

7#
发表于 2006-12-14 14:04:57 | 只看该作者
呵呵,能不能搞个搜索并替换第(?)个的?
回复

使用道具 举报

8#
发表于 2006-12-30 10:15:23 | 只看该作者
原帖由 tintinbt 于 2006-12-14 01:25 AM 发表
写好了一个,试试
<position>就是字符串开始位置

  Binrep.exe V1.00 by Figer (tintinbt@gmail.com)  Dec,2006
  This program replace a string in a binary file.

  Usage: Binrep.exe <filen ...


可以分享一下源码吗?谢谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-4-29 18:32

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表