Jump to content

Open Club  ·  60 members

DASM
IGNORED

Reconstructing source changes from disassembly?


Karl G

Recommended Posts

This isn't strictly a DASM question, but it seems like the most appropriate place for it.

 

I lost the source for most of my projects when my MacBook died, with Penult being an exception since I was using Git. However, I did lose a few changes from the last beta release I did that I hadn't yet committed. While I can redo these changes, I'd ideally like to recreate them exactly as I had previously done for the sake of consistency/stability.

 

So, what I have is a ROM that contains the up-to-date changes, and source from one version back. What I'd like to know is if there's a clever way to effectively get a diff from my old version that I have the source for to the new version that only exists as a ROM so that I can recreate these changes exactly as I did previously.

 

Thanks in advance for any suggestions!

Link to comment
Share on other sites

My macbook died a month or two back (2013 Macbook pro). As it happens, a couple weeks before that I had purchased a new machiine with the intention of shifting files across. After its demise, I bought a $5 interface thingy from AliExpress, which let me put the SSD on it (M2 somethign or other) and then I was able to mount the drive on my new machine connected via USB to that interface thingy. Works perfectly. So maybe that's one way to recover your files.  That is, open up the old machine and remove the drive.. connect it to some dongle/interface and bob's your uncle.  PM me if you want a link to what I used.

 

Link to comment
Share on other sites

6 minutes ago, Andrew Davie said:

My macbook died a month or two back (2013 Macbook pro). As it happens, a couple weeks before that I had purchased a new machiine with the intention of shifting files across. After its demise, I bought a $5 interface thingy from AliExpress, which let me put the SSD on it (M2 somethign or other) and then I was able to mount the drive on my new machine connected via USB to that interface thingy. Works perfectly. So maybe that's one way to recover your files.  That is, open up the old machine and remove the drive.. connect it to some dongle/interface and bob's your uncle.  PM me if you want a link to what I used.

 

Thanks, but unfortunately that's not an option with my MacBook. Mine was a 2017 MacBook Pro, and doesn't have a removable drive. The SSD chips are soldered directly on the motherboard. The only way the data could be saved is by swapping the chips with another identical model MacBook, which would be non-trivial even if I had another one lying around for that purpose. Mind you, I'm hanging onto the thing on the very off chance that an option to save the data will present itself down the road, though.

Link to comment
Share on other sites

So, per your actual question then... I'd do a hex dump of the binary file.  For the file you have, I'd do a source listing with DASM that shows the byte values alongside the source lines. And I'd also do a hex dump of the binary assembling that produces. Then I'd do a visual diff on the two hex dumps (using, for example, Beyond Compare... which I kinda like).  That would identify the different blocks between the dumps. I'd then correlate those to the source code/hex listing we did earlier, and graft in the hex values into the source code where they should be in the source file.  Finally I'd manually convert the opcodes hex values to mnemonics. The big task left to do would be to figure out what variables the operands refer to.  If you haven'd jiggled around variable positions too much you could also use the symbol table to reconstruct some or most of those correctly That would leave very little to guesswork to finally get the whole thing reconstructed.

 

  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...