I wrote a
simple python reader/writer for Miranda NG/Miranda IM's dbx_mmap databases (home.dat).
It supports all event types I've found in Miranda NG's source code.
Also a set of command-line tools based on that (dump contents of the database, diff databases, trace settings changes across a number of backups).
Useful for restoring corrupted DBs, finding duplicate events, dumping old DBs to text or new format etc,
It can edit the database too but has almost no high level editing functions, it can import messages and modules as a proof of concept.
It's mostly tailored to Miranda NG version but IM version shooouuuld be fine too, in theory.
Obviously: Backup your DBs before using this. It works for me but it's pretty raw.