This is an interesting question but I'm not sure it's solvable in a general way. MX files are not really definitions but rather low level kernel state data, as I understand.
A potential, limited method would:
Record a "snapshot" of all definitions
load a MX file
Record a second "snapshot" and look for changes
Copy new/changed definitions and export them to a .M file
To even attempt this it would be helpful to to define limitations of the class of data in the .mx files.
For example: are they all OwnValues
/DownValues
definitions made in the same (Global`
?) context?
A rough start of this is shown in answer to: DumpSave for the forgetful
DumpSave
is not a good way to save data. Instead ofDumpSave
useExport
which doesn't write variable names into the file and makes automatic format conversions easy, should you ever need them in the future. You can usemx
withExport
, but it's probably better toCompress
the expression andExport
it to"String"
instead. $\endgroup$