帮助我理解这种二进制文件格式
我正在尝试编写一个小实用程序来生成一个二进制文件,该文件将模仿另一个关闭的应用程序生成的文件。我使用十六进制编辑器来解密格式,因为我一直试图理解格式/编码是什么,以便我可以使用 C++ 或 C# 生成它。
该文件以前四个字节开始:01 00,后跟 FF FE。我的理解是该文件以 SOH 开头,后跟小尾数的字节顺序标记。在这四个字节之后,程序似乎为应用程序 GUI 中的每个字符串字段写入 BSTR。
使用 C#,我生成了一个以 FF FE 开头的 unicode 文件,但我不确定如何首先插入 SOH 字符。
如果有人能够深入了解文件格式或编码以及文件为何以 SOH 字符开头,我将永远感激不已。
先感谢您。
I am attempting to write a small utility to produce a binary file that will mimic the one produced by another closed application. I've used hex editors to decrypt the format by I'm stuck trying to understand what the format/encoding is so that I can produce it using C++ or C#.
The file starts with the first four bytes: 01 00 followed by FF FE. My understanding is that the file begins with SOH followed by the byte order mark for little endian. After these four bytes, the program appears to write BSTR's for each of the string fields from the app's GUI.
Using C#, I have produced a unicode file that starts with FF FE, but I'm not sure how to insert the SOH character first.
I would be forever grateful if someone could offer insight to the file format or encoding and why the file starts with the SOH character.
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对二进制文件格式进行逆向工程可能是一项具有挑战性的任务。从表面上看,我不认为这是一种明显的、众所周知的文件格式......但是有成千上万的文件格式,所以谁知道。
除了法律问题之外,我建议您查看以下一些讨论的资源实现这一目标的方法:
Reverse engineering a binary file format can be a challenging task. On the surface, I don't recognize this as an obvious, well-known file format ... but there are thousands out there, so who knows.
Legal issues aside, I would suggest you look at some of the following resources that talk about approaches to such an endeavor:
如果您在写出前四个字节时遇到困难,这将为您解决。
这将输出以下文件
编辑:添加了 Mark H 关于写出字符串的建议。
If you are just having trouble writing out the first four bytes this will do it for you.
This will output the following file
Edit: Added Mark H's suggestion for writing out a string.