|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
那就把0D0A换成一个或两个空格间隔(2020)
Then replace 0D0A with one or two spaces separated (2020)
|
|
2006-7-19 15:55 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
这样程序就没有通用性了。。
Then this program will lack universality.
|
|
2006-7-19 15:59 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
你的第三条,把回车换行转成0D0A字符,这样就没有通用性了。
比如,一些程序都有根据行来查找字符选项,这样那就不行了。。
Last edited by GOTOmsdos on 2006-7-19 at 16:31 ]
Your third point, converting carriage returns and line feeds to 0D0A characters makes it non-portable. For example, some programs have options to search for characters by line, which then won't work.
Last edited by GOTOmsdos on 2006-7-19 at 16:31 ]
|
|
2006-7-19 16:02 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
GOTOmsdos:
bin2txt 1.0 BinToHexText convertor by grub2linux
Syntax :
bin2txt binFile textFile
binFile : binary file name.
textFile : text file name.
/killline : do not conserve RETURN & LINEFEEDs in binFile.
n : do not conserve RETURN & LINEFEEDs in binFile.
add a RETURN & LINEFEED every n bytes.
/lower : in lower case.
用了后,发现个问题
当转换bin文件到txt时,要想得到编辑器格式(每16byte换行)bin文件中的回车信息就一定被删除,造成txt2bin时无法复原,如果不换行文本只有一行,用记事本打开又极慢,而且不易浏览,不知道这个问题是不是有办法克服,干脆直接固定文本格式,反正每十六位换行的文本看起来就是顺,各种工具转换的.HEX文件也是这样的!
GOTOmsdos:
bin2txt 1.0 BinToHexText convertor by grub2linux
Syntax :
bin2txt binFile textFile
binFile : binary file name.
textFile : text file name.
/killline : do not conserve RETURN & LINEFEEDs in binFile.
n : do not conserve RETURN & LINEFEADs in binFile.
add a RETURN & LINEFEED every n bytes.
/lower : in lower case.
After using it, I found a problem. When converting a bin file to a txt file, if you want to get the editor format (new line every 16 bytes), the carriage return information in the bin file must be deleted, which causes the txt2bin to be unable to restore. If there is no new line, the text is only one line, which is extremely slow to open with Notepad and not easy to browse. I wonder if there is a way to overcome this problem. It is better to directly fix the text format. Anyway, the text with a new line every sixteen bytes looks neat, and this is how the.HEX files converted by various tools are as well!
|
|
2006-8-14 07:09 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
n : do not conserve RETURN & LINEFEEDs in binFile.
add a RETURN & LINEFEED every n bytes.
这个作用形同鸡肋
n : 不在 binFile 中保留回车符和换行符。每 n 字节添加一个回车符和换行符。
This function is like a chicken rib
|
|
2006-8-14 07:18 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
Originally posted by GOTOmsdos at 2006-7-19 04:02 PM:
你的第三条,把回车换行转成0D0A字符,这样就没有通用性了。
比如,一些程序都有根据行来查找字符选项,这样那就不行了。。
Last edited by GOTO ...
这句不理解,另外多一个选项帮助txt还原成bin(不会造成回车歧义)不是更好吗?
修改是不是在这加个开关,对c不是很了解,不知道是不是这句
:(
if(dig==0x0D)
{
//sprintf(w,"%0X%0X",0x0D,0x0A);
fread(&dig0A,1,1,bin);
i++;
if(dig0A==0x0A)
{
if(doLine==0)
fwrite("\x0D\x0A",2,1,txt);
}
Last edited by mornsmile on 2006-8-14 at 07:46 ]
Originally posted by GOTOmsdos at 2006-7-19 04:02 PM:
Your third point, converting carriage return and line feed to 0D0A characters makes it non-universal.
For example, some programs have options to search for characters by line, which won't work then..
Last edited by GOTO ...
This sentence is not understood. Also, having an additional option to help restore txt to bin (without causing carriage return ambiguity) is not better?
Is the modification adding a switch here? Not very familiar with C, not sure if it's this line
:(
if(dig==0x0D)
{
//sprintf(w,"%0X%0X",0x0D,0x0A);
fread(&dig0A,1,1,bin);
i++;
if(dig0A==0x0A)
{
if(doLine==0)
fwrite("\x0D\x0A",2,1,txt);
}
Last edited by mornsmile on 2006-8-14 at 07:46 ]
|
|
2006-8-14 07:39 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
TO mornsmile
你要保留 回车换行 就不用 /killline|n,你要编辑器格式(每16byte换行)就把 N设为16,你既要编辑器格式(每16byte换行)又要原来的回车换行,那弄好后,就不是编辑器格式(每16byte换行)啦!
有换行和没换行是由你选择的呀。。
你说:
n : do not conserve RETURN & LINEFEEDs in binFile.
add a RETURN & LINEFEED every n bytes.
这个作用形同鸡肋 “
你能不能说一下理由?
TO mornsmile
You need to keep the carriage return and line feed, so you don't use /killline|n. If you want the editor format (newline every 16 bytes), set N to 16. If you want both the editor format (newline every 16 bytes) and the original carriage return and line feed, then after setting it up, it won't be the editor format (newline every 16 bytes)!
Whether there are line breaks or not is up to your choice.
You said:
n : do not conserve RETURN & LINEFEEDs in binFile.
add a RETURN & LINEFEED every n bytes.
This function is like a鸡肋 "
Can you please explain the reason?
|
|
2006-8-14 11:42 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
我的意思是不要把bin的0D0A转成换行符号,否则/killline|n后无法还原,就算有编辑器格式也不是原来的二进制信息,所以没有意义,当然我是指当处理含0D0A的bin时
What I mean is not to convert the 0D0A in bin to line break symbols. Otherwise, after /killline|n, it cannot be restored. Even if there is an editor, the format is not the original binary information, so it is meaningless. Of course, I mean when processing bin containing 0D0A.
|
|
2006-8-15 00:44 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
|
2006-8-15 00:52 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
n : do not conserve RETURN & LINEFEEDs in binFile.
add a RETURN & LINEFEED every n bytes.
以上的是一个有用的功能。
如果你要保留回车换行,就当然不用 /killline了嘛,保留嘛。
去掉这个,那要需要这个功能,不就遗憾了?
n : do not conserve RETURN & LINEFEEDs in binFile.
add a RETURN & LINEFEED every n bytes.
The above is a useful feature.
If you want to keep the carriage return and line feed, then of course you don't need /killline, just keep it.
If you remove this, then if you need this function, isn't it a pity?
|
|
2006-8-15 00:55 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
我的意思,不知道有没有讲清楚
就是不要处理掉原来的回车
转换后的文本
0000544C4F5353206572726F72
00000053494E47206572726F72
00000000444F4D41494E206572726F72
改成
0000544C4F5353206572726F720D0A00000053494E47206572726F720D0A00000000444F4D41494E206572726F72
Last edited by mornsmile on 2006-8-15 at 01:15 ]
I mean, I don't know if I made it clear enough.
Just don't remove the original carriage returns.
Convert the text
0000544C4F5353206572726F72
00000053494E47206572726F72
00000000444F4D41494E206572726F72
to
0000544C4F5353206572726F720D0A00000053494E47206572726F720D0A00000000444F4D41494E206572726F72
Last edited by mornsmile on 2006-8-15 at 01:15 ]
|
|
2006-8-15 01:13 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
哦,是这个意思。。
你觉得这样有用,那可以加进去的。。。
Oh, that's the meaning..
If you think this is useful, then it can be added...
|
|
2006-8-15 01:19 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
这才是原16进制码嘛,麻烦改一下高手
This is the original hexadecimal code. Please help modify it, expert.
|
|
2006-8-15 01:22 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 29 楼』:
使用 LLM 解释/回答一下
你的源码也分享下:)
用bcb编译才9k
Share your source code too:)
Compiled with BCB is only 9k
|
|
2006-8-15 01:25 |
|
|
mornsmile
初级用户
 
积分 147
发帖 23
注册 2005-1-23
状态 离线
|
『第 30 楼』:
使用 LLM 解释/回答一下
还有不明白txt2bin的/killline|n是什么作用
There is still confusion about the role of /killline|n in txt2bin.
|
|
2006-8-15 01:29 |
|