So, prior to my stupidity, I made a system.img dump via dd

However, after my stupidity (tried flashing some lib files....), I am now stuck with only stock recovery mode, or download mode.

How can I flash back my system.img? I tried in download mode with heimdall... but it fails with

root@o7thDev:/media/MediaTwo/MyRom# heimdall flash --verbose --no-reboot --SYSTEM system.img
Heimdall v1.4.0

Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna

This software is provided free of charge. Copying and redistribution is

If you appreciate this software and you would like to support future
development please consider donating:

Initialising connection...
Detecting device...
  Manufacturer: "Sasmsung"
       Product: "MSM8960"

        length: 18
  device class: 2
           S/N: 0
       VID:PID: 04E8:685D
     bcdDevice: 0100
   iMan:iProd:iSer: 1:2:0
      nb confs: 1

interface[0].altsetting[0]: num endpoints = 1
Class.SubClass.Protocol: 02.02.01
   endpoint[0].address: 82
       max packet size: 0010
      polling interval: 09

interface[1].altsetting[0]: num endpoints = 2
Class.SubClass.Protocol: 0A.00.00
   endpoint[0].address: 81
       max packet size: 0200
      polling interval: 00
   endpoint[1].address: 01
       max packet size: 0200
      polling interval: 00
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Initialising protocol...
WARNING: Control transfer #1 failed. Result: -9
WARNING: Control transfer #2 failed. Result: -9
WARNING: Control transfer #3 failed. Result: -9
WARNING: Control transfer #4 failed. Result: -9
WARNING: Control transfer #5 failed. Result: -9
WARNING: Control transfer #6 failed. Result: -9
ERROR: Failed to receive handshake response. Retrying...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading SYSTEM
ERROR: Failed to unpack received packet.

ERROR: Failed to confirm end of file transfer sequence!
ERROR: SYSTEM upload failed!

Ending session...
Releasing device interface...
Re-attaching kernel driver...

so I tried creating an update.zip that I could sideload flash in stock recovery, but that fails as well with

E: footer is wrong
E: signature verification failed

If I could get into adb shell, I'd be set... all I'd have to do is dd the system.img back (been there done that in SafeStrap), but when I try adb shell in stock recovery I just get "error: device not found", and in sideload mode, I get

error: closed

Please help? :crying:

  • Heimdall is not designed for flashing images backed up with dd. It's a tool for flashing specifically crafted firmware images. I would suggest flashing a custom recovery via Heimdall in download mode.
    – Chahk
    Jul 1, 2014 at 17:23
  • As far as I know the only custom recovery I can have on this beast is SafeStrap 3.72, which was installed (but of course I can't even get that far). I'll see if I can find a Heimdall flashable version of it though... I'm on the NC1 locked bootloader...
    – Kevin
    Jul 1, 2014 at 17:24
  • Is it possible for you to mount your dd image on a Linux PC and create an update.zip from the contents?
    – dantis
    Apr 20, 2015 at 0:35
  • Seems u need to use ODIN to get back your phone, You will lose all your data though
    – user52093
    Jul 9, 2015 at 5:57

1 Answer 1


Try disabling verification, via safestrap, and try both methods + Sideload again.

I should ask, why heimdall and safestrap? Use Clockworkmod recovery instead of safestrap and ODIN over heimdall. Yes, they require you to get your stuff online beforehand, but clockworkmod has got me out of a lot of soft-bricks

If I was boring, everyone I know would not bother with me :(

  • had no choice but to use safestrap on my AT&T S4 :), but I've since dumped it for a N900T anyways ;)
    – Kevin
    Jul 23, 2015 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .