且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

对二进制字典文件进行逆向工程以提取字符串

更新时间:2023-01-01 18:19:07

这样的自动化工具似乎不存在,如果存在,它也只能用于非常小的输入文件集.

我终于找到了解决问题的方法.

我有一个 EXE 程序,可以浏览字典并显示单词的定义.

使用 AutoHotkey,我编写了一个相对简单的脚本,从 40 万字的输入列表中搜索每个字的定义,将其复制到剪贴板,然后将其粘贴到另一个输出文本文件中.

我不得不在按键、窗口切换等之间插入一些 Sleep 语句以使脚本稳定.解析"整个字典的估计时间:20 天 :)

I have a ~600MB .DAT file that contains an italian dictionary (accented words with their definitions).

I would like to extract all the strings from this file (a raw dump containing strings and dirty headers/binary data would be all right as long as I can read the words and definitions).

So my question is: Is there a software that could do this in an automated way?

I would tell it: 'I know that this file contains the strings "TREE", "DOG", "CAT", "COLLISION"... now use some brute force, statistical analysis or whatever method to try and find how these strings are encoded'

2 things I'd like to mention:

  • I am software developer but have absolutely no experience or knowledge in reverse engineering, hex editing etc...
  • I do not want to spend hours reading reverse engineering tutorials and doing trial and error using many sofwares. If I don't succeed in extracting what I need in a simple manner, I'll just abandon this task.

I realize that it's probable (if the text is encrypted for instance) that this task could not be performed simply, I just want to give it a try with the best tool available.

It seems that such an automated tool does not exist, of if it did, it would only work for a very small set of input files.

I finally found a solution to my problem.

I have an EXE program that allows browsing the dictionary and displaying the definition of a word.

Using AutoHotkey, I wrote a relatively simple script that searches the definition of every word from a 400k words input list, copies it to the clipboard, then pastes it in another output text file.

I had to insert some Sleep statements between the keystrokes, window switching etc. to make the script stable. Estimated time to "parse" the whole dictionary: 20 days :)